예제 #1
0
 public JsonResult AjaxInsertRole(string rolename)
 {
     Role role = new Role();
     role.RoleName = rolename;
     bool result = RoleBml.Insert(role);
     return Json(result, JsonRequestBehavior.AllowGet);
 }
예제 #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;
         }
     }
 }
예제 #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;
         }
     }
 }
예제 #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;
         }
     }
 }