public JsonResult AjaxInsertRole(string rolename)
 {
     Role role = new Role();
     role.RoleName = rolename;
     bool result = RoleBml.Insert(role);
     return Json(result, JsonRequestBehavior.AllowGet);
 }
Esempio n. 2
0
 public static bool Delete(Role role)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             db.Entry(role).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
Esempio n. 3
0
 public static bool SoftDelete(Role role)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             role.DeleteStatus = true;
             bool result = Update(role);
             return result;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
Esempio n. 4
0
 public static bool Insert(Role role)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             role.DeleteStatus = false;
             role.CreateTime = DateTime.Now;
             db.Role.Add(role);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }