예제 #1
0
        public ActionResult CreatePage(string name)
        {
            T_PE_Roles item = new T_PE_Roles();

            item.RoleID     = Guid.NewGuid().ToString();
            ViewBag.winname = name;
            return(View(item));
        }
예제 #2
0
        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)));
        }
예제 #3
0
        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)));
        }
예제 #4
0
 public bool insert(T_PE_Roles obj)
 {
     try
     {
         db.T_PE_Roles.Add(obj);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #5
0
 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);
     }
 }
예제 #6
0
 public ActionResult Create(T_PE_Roles obj)
 {
     return(this.Direct(new RolesViewModle().insert(obj)));
 }