private bool Delete(Framework.Task.Task task, ref string errmsg) { XtmUser delModel = new XtmUser(); delModel.SysKey = task.CommandArgument; BaseDao baseDao = new BaseDao(); this.BeginTran(); try { XtmMenuPri delMenuPri = new XtmMenuPri(); delMenuPri.UserId = int.Parse(task.CommandArgument); baseDao.Delete(delMenuPri); XtmUserPri delUserPri = new XtmUserPri(); delUserPri.UserId = int.Parse(task.CommandArgument); baseDao.DeleteUdf("XtmUserPriDeleteAll", delUserPri); baseDao.Delete(delModel); this.CommitTran(); } catch (Exception ex) { this.RollbackTran(); errmsg = ex.Message; return(false); } if (errmsg != "") { return(false); } errmsg = "删除成功"; task.Rebind = true; return(true); }
private string SaveMenu() { string para = Request.Form[0]; string[] paras = para.Split('|'); XtmMenuPri priM = new XtmMenuPri(); priM.UserId = int.Parse(paras[0]); BaseDao baseDao = new BaseDao(); baseDao.Delete(priM); for (int i = 1; i < paras.Length - 1; i++) { string[] temp = paras[i].Split('-'); priM.MenuId = int.Parse(temp[0]); priM.MenuCode = temp[1]; baseDao.Insert(priM); } return("y"); }