/// <summary> /// 新增系统 /// </summary> /// <param name="menu"></param> /// <returns></returns> public bool AddSystemInfo(Sys_Systems system) { using (var db = new QYZEntity()) { db.Sys_Systems.AddObject(system); db.SaveChanges(); return(true); } }
/// <summary> /// 新增菜单 /// </summary> /// <param name="menu"></param> /// <returns></returns> public bool AddMenuInfo(Sys_Menus menu) { using (var db = new QYZEntity()) { db.Sys_Menus.AddObject(menu); db.SaveChanges(); return(true); } }
/// <summary> /// 新增模块信息 /// </summary> /// <param name="module"></param> /// <returns></returns> public bool InsertModuleInfo(Sys_Modules module) { using (var db = new QYZEntity()) { db.Sys_Modules.AddObject(module); db.SaveChanges(); return(true); } }
/// <summary> /// 删除模块信息 /// </summary> /// <param name="module"></param> /// <returns></returns> public bool DeleteModuleInfo(Sys_Modules module) { using (var db = new QYZEntity()) { Sys_Modules m = db.Sys_Modules.Where(p => p.ID == module.ID).ToList <Sys_Modules>().FirstOrDefault <Sys_Modules>(); db.Sys_Modules.DeleteObject(m); db.SaveChanges(); return(true); } }
/// <summary> /// 删除系统 /// </summary> /// <param name="menu"></param> /// <returns></returns> public bool DeleteSystemInfo(Sys_Systems system) { using (var db = new QYZEntity()) { Sys_Systems m = db.Sys_Systems.Where(p => p.ID == system.ID).ToList <Sys_Systems>().FirstOrDefault <Sys_Systems>(); db.Sys_Systems.DeleteObject(m); db.SaveChanges(); return(true); } }
/// <summary> /// 更新系统信息 /// </summary> /// <param name="menu"></param> /// <returns></returns> public bool UpdateSystemInfo(Sys_Systems system) { using (var db = new QYZEntity()) { Sys_Systems m = db.Sys_Systems.Where(p => p.ID == system.ID).ToList <Sys_Systems>().FirstOrDefault <Sys_Systems>(); m.Name = system.Name; m.Remark = system.Remark; db.SaveChanges(); return(true); } }
/// <summary> /// 删除菜单 /// </summary> /// <param name="menu"></param> /// <returns></returns> public bool DeleteMenuInfo(Sys_Menus menu) { using (var db = new QYZEntity()) { Sys_Menus m = db.Sys_Menus.Where(p => p.SystemID == menu.SystemID && p.ID == menu.ID).ToList <Sys_Menus>().FirstOrDefault <Sys_Menus>(); db.Sys_Menus.DeleteObject(m); db.SaveChanges(); return(true); } }
/// <summary> /// 更新菜单 /// </summary> /// <param name="menu"></param> /// <returns></returns> public bool UpdateMenuInfo(Sys_Menus menu) { using (var db = new QYZEntity()) { Sys_Menus m = db.Sys_Menus.Where(p => p.SystemID == menu.SystemID && p.ID == menu.ID).ToList <Sys_Menus>().FirstOrDefault <Sys_Menus>(); m.Name = menu.Name; m.ImagePath = menu.ImagePath; m.Remark = menu.Remark; db.SaveChanges(); return(true); } }
/// <summary> /// 新增账户 /// </summary> /// <param name="account"></param> /// <returns></returns> public bool InsertAccount(Sys_Accounts account) { if (account != null && account.UserName != "" && account.PassWord != "") { db.Sys_Accounts.AddObject(account); db.SaveChanges(); return(true); } return(false); }
/// <summary> /// 更新模块信息 /// </summary> /// <param name="modules"></param> /// <returns></returns> public bool UpdateModuleInfo(Sys_Modules modules) { using (var db = new QYZEntity()) { Sys_Modules module = db.Sys_Modules.Where(p => p.ID == modules.ID).ToList <Sys_Modules>().FirstOrDefault <Sys_Modules>(); module.Name = modules.Name; module.MenuID = modules.MenuID; module.ImagePath = modules.ImagePath; module.Parameter = modules.Parameter; module.Remark = modules.Remark; module.StartUpClass = modules.StartUpClass; module.DllName = modules.DllName; db.SaveChanges(); return(true); } }