Add project files.

This commit is contained in:
Atakan Doğan Özban
2026-02-13 23:40:52 +01:00
parent cf37f33a1e
commit 202dc16a52
199 changed files with 98481 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using atakanozbancom.Models.classes;
namespace atakanozbancom.Controllers
{
public class loginController : Controller
{
// GET: Login
Context c = new Context();
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Index(admin ad)
{
var bilgiler = c.admins.FirstOrDefault(x => x.username == ad.username && x.password == ad.password);
if (bilgiler != null)
{
FormsAuthentication.SetAuthCookie(bilgiler.username, false);
Session["username"] = bilgiler.username.ToString();
return RedirectToAction("Index", "admin");
}
else
{
return View();
}
}
public ActionResult logout()
{
FormsAuthentication.SignOut();
return RedirectToAction("index", "login");
}
}
}