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 bool ClearAllAtt(Framework.Task.Task task, ref string errmsg) { this.BeginTran(); try { BaseDao baseDao = new BaseDao(); YwData entity = task.Entity as YwData; entity.AttachmentCount = 0; Hashtable ht = new Hashtable(); ht.Add("Did", entity.Did); baseDao.UpdateUdf("YwDataAttClear", ht); YwAttach att = new YwAttach(); att.Dataid = entity.Did; baseDao.Delete(att); this.CommitTran(); errmsg = "清空成功"; } catch (Exception ex) { this.RollbackTran(); errmsg = ex.Message; return(false); } return(true); }
public int Delete(SysChinaCity entity) { try { Object result = baseDao.Delete <SysChinaCity>(entity); int iReturn = Convert.ToInt32(result); return(iReturn); } catch (Exception ex) { throw new DalException("调用ActivityDirectRules时,访问Delete时出错", ex); } }
/// <summary> /// 删除ProductsGen /// </summary> /// <param name="productsGen">ProductsGen实体对象</param> /// <returns>状态代码</returns> public int DeleteProductsGen(ProductsGen productsGen) { try { Object result = baseDao.Delete <ProductsGen>(productsGen); int iReturn = Convert.ToInt32(result); return(iReturn); } catch (Exception ex) { throw new DalException("调用ProductsGen时,访问Delete时出错", ex); } }
/// <summary> /// 删除SysCustomerInfo /// </summary> /// <param name="sysCustomerInfo">SysCustomerInfo实体对象</param> /// <returns>状态代码</returns> public int Delete(SysCustomerInfo sysCustomerInfo) { try { Object result = baseDao.Delete <SysCustomerInfo>(sysCustomerInfo); int iReturn = Convert.ToInt32(result); return(iReturn); } catch (Exception ex) { throw new DalException("调用SysCustomerInfo时,访问Delete时出错", ex); } }
/// <summary> /// 删除SysActionLog /// </summary> /// <param name="sysActionLog">SysActionLog实体对象</param> /// <returns>状态代码</returns> public int Delete(SysActionLog sysActionLog) { try { Object result = baseDao.Delete <SysActionLog>(sysActionLog); int iReturn = Convert.ToInt32(result); return(iReturn); } catch (Exception ex) { throw new DalException("调用SysActionLog时,访问Delete时出错", ex); } }
/// <summary> /// 删除CategoriesGen /// </summary> /// <param name="categoriesGen">CategoriesGen实体对象</param> /// <returns>状态代码</returns> public int DeleteCategoriesGen(CategoriesGen categoriesGen) { try { Object result = baseDao.Delete <CategoriesGen>(categoriesGen); int iReturn = Convert.ToInt32(result); return(iReturn); } catch (Exception ex) { throw new DalException("调用CategoriesGen时,访问Delete时出错", ex); } }
/// <summary> /// 删除AgentGen /// </summary> /// <param name="agentGen">AgentGen实体对象</param> /// <returns>状态代码</returns> public int DeleteAgentGen(AgentGen agentGen) { try { Object result = baseDao.Delete <AgentGen>(agentGen); int iReturn = Convert.ToInt32(result); return(iReturn); } catch (Exception ex) { throw new DalException("调用AgentGen时,访问Delete时出错", ex); } }
private bool Delete(Framework.Task.Task task, ref string errmsg) { XtmDepart delModel = new XtmDepart(); delModel.SysKey = task.CommandArgument; BaseDao baseDao = new BaseDao(); XtmDepart temp = new XtmDepart(); temp.ParentId = delModel.Did; int count = baseDao.Count(temp); if (count > 0) { errmsg = "该部门底下挂有子部门,不允许删除"; return(false); } XtmUser userM = new XtmUser(); userM.DepartId = delModel.Did; count = baseDao.Count(userM); if (count > 0) { errmsg = "该部门底下挂有人员,不允许删除"; return(false); } try { baseDao.Delete(delModel); } catch (Exception ex) { 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"); }
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"); }
private bool Delete(Framework.Task.Task task, ref string errmsg) { Yw_txm delModel = new Yw_txm(); delModel.SysKey = task.CommandArgument; BaseDao baseDao = new BaseDao(); try { baseDao.Delete(delModel); } catch (Exception ex) { errmsg = ex.Message; return(false); } if (errmsg != "") { return(false); } errmsg = "删除成功"; task.Rebind = true; return(true); }
/// <summary> /// 删除 /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public int Delete <T>() { return(baseDao.Delete <T>()); }
public virtual int Delete(T obj) { return(_dao.Delete(obj)); }