Example #1
0
        public async Task <ActionResult> DeleteRole(string id)
        {
            RoleDAL dal = new RoleDAL();
            await dal.Delete(id);

            return(ToJsonResult("Success"));
        }
        public ActionResult Delete(int id, FormCollection collection)
        {
            string msg = "删除失败";

            try
            {
                if (id != 0)
                {
                    var role = roleDAL.GetRoleByID(id);
                    ////先删除子表,再删除主表
                    //foreach (var role in account.Role) {
                    //    var RoleModel = roleDAL.GetRoleByID(role.RoleID);
                    //    account.Role.Remove(RoleModel);
                    //}
                    roleDAL.Delete(role);
                }
                // TODO: Add delete logic here
                //return RedirectToAction("Index");
                msg = "删除成功";
                return(Content(msg));
            }
            catch
            {
                return(Content(msg));
                //return View();
            }
        }
Example #3
0
 public int Delete(RoleML Role)
 {
     try
     {
         return(RoleDAL.Delete(Role));
     }
     catch (Exception ex)
     {
         throw new Exception(String.Format("{0}.Delete: {1}", core, ex));
     }
 }
Example #4
0
 static public int Delete(int id)
 {
     return(RoleDAL.Delete(id));
 }
Example #5
0
 public virtual void Delete(int id)
 {
     RoleDAL.Delete(id);
 }
Example #6
0
 public void Delete(int id)
 {
     dal.Delete(id);
 }
Example #7
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(int Rl_ID)
 {
     return(dal.Delete(Rl_ID));
 }
Example #8
0
 /// <summary>
 /// 物理删除
 /// </summary>
 /// <param name="id"></param>
 public static void Delete(int id)
 {
     RoleDAL.Delete(id);
 }
Example #9
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(int RoleId)
 {
     return(dal.Delete(RoleId));
 }
Example #10
0
 public int delete(Role _model)
 {
     return(dal.Delete(_model));
 }
Example #11
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(int Id)
 {
     return(dal.Delete(Id));
 }
Example #12
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(int ID)
 {
     return(dal.Delete(ID));
 }
Example #13
0
 public int Delete(long id)
 {
     return(RoleDAL.Delete(id));
 }
Example #14
0
 public override bool Delete(ORules role)
 {
     return(rule.Delete(role));
 }