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