public ActionResult CreatePage(string name) { T_PE_Roles item = new T_PE_Roles(); item.RoleID = Guid.NewGuid().ToString(); ViewBag.winname = name; return(View(item)); }
public ActionResult Detail(T_PE_Roles obj) { T_PE_Roles obj_or = new RolesViewModle().db.T_PE_Roles.Find(obj.RoleID); foreach (var item in typeof(T_PE_Roles).GetProperties()) { item.SetValue(obj_or, item.GetValue(obj, null), null); } return(this.Direct(new RolesViewModle().update(obj_or))); }
public ActionResult delete(string selection) { JArray src = JArray.Parse(selection); T_PE_Roles[] roles = new T_PE_Roles[src.Count]; foreach (var item in src) { roles[src.IndexOf(item)] = JSON.Deserialize <T_PE_Roles>(src[src.IndexOf(item)].ToString()); } return(this.Direct(new RolesViewModle().delete(roles))); }
public bool insert(T_PE_Roles obj) { try { db.T_PE_Roles.Add(obj); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool update(T_PE_Roles obj) { try { db.Entry(obj).State = System.Data.EntityState.Detached; db.T_PE_Roles.Attach(obj); db.Entry(obj).State = System.Data.EntityState.Modified; db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public ActionResult Create(T_PE_Roles obj) { return(this.Direct(new RolesViewModle().insert(obj))); }