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 SaveDepart() { BaseDao baseDao = new BaseDao(); string para = Request.Form[0]; string[] paras = para.Split('|'); XtmUserPri priM = new XtmUserPri(); priM.UserId = int.Parse(paras[0]); priM.PriType = "depart"; baseDao.Delete(priM); for (int i = 1; i < paras.Length - 1; i++) { string[] temp = paras[i].Split('-'); priM.PriId = int.Parse(temp[0]); priM.PriVal = temp[1]; baseDao.Insert(priM); } return("y"); }