public ActionResult Login(Park_Web.Models.Park_Rootweb PRW) { Park_Database.Service.Park_Root_Service db = new Park_Database.Service.Park_Root_Service(); List <Park_Database.Model.Park_Root> rl = new List <Park_Database.Model.Park_Root>(); rl = db.LoadAll(); //Park_Web.Models.Park_Rootweb rw = new Park_Web.Models.Park_Rootweb(); string a = ""; bool f = false; rl.ForEach(x => { if (PRW.Rootweb_ID == x.Root_ID && PRW.Rootweb_Password == x.Root_Password) { string Admin = x.Root_Authority; f = true; PRW.Rootweb_Authority = x.Root_Authority; } }); if (!f) { return(RedirectToAction("Login", "Home")); } return(RedirectToAction("Phome", "Manager", PRW)); }
public static void Create_Root(Park_Database.Service.Park_Root_Service db) { var ID = "root01"; var password = "******"; var Authority = "1"; Park_Database.Model.Park_Root PR = new Park_Database.Model.Park_Root(); PR.Root_ID = ID; PR.Root_Password = password; PR.Root_Authority = Authority; db.Create(PR); Console.WriteLine("使用者資料創建完成"); }
public static void Show_Root(Park_Database.Service.Park_Root_Service db) { List <Park_Database.Model.Park_Root> PR = new List <Park_Database.Model.Park_Root>(); PR = db.LoadAll(); int count = 1; Console.WriteLine("共有" + PR.Count + "筆使用者資料"); PR.ForEach(x => { Console.WriteLine("第" + (count++) + "筆" + "資料"); Console.WriteLine("\t會員ID:" + x.Root_ID); Console.WriteLine("\t密碼:" + x.Root_Password); Console.WriteLine("\t權限:" + x.Root_Authority); Console.WriteLine(); }); }
public static void Main(string[] args) { List <Park_Database.Model.Park_User> PU = new List <Park_Database.Model.Park_User>(); var dbu = new Park_Database.Service.Park_User_Service(); var dba = new Park_Database.Service.Park_Area_Service(); var dbs = new Park_Database.Service.Park_Seats_Service(); var dbt = new Park_Database.Service.Park_Time_Service(); var dbr = new Park_Database.Service.Park_Root_Service(); // Create_User(dbu); //Show_User(dbu); //Create_Area(dba); //Show_Area(dba); //Create_Seats(dbs); //Show_Seats(dbs); // Create_Time(dbt); //Show_Time(dbt); Create_Root(dbr); Show_Root(dbr); Console.ReadKey(); }