/// <summary> /// 增加一条数据 /// </summary> public int Add(SCZM.Model.Proj.proj_Contract model, int submitFlag, out string message) { message = "保存成功!"; if (dal.Exists(model.ProjId, 0)) { message = "对不起,该项目合同已存在!"; return(0); } string errMessage = ""; BLL.System.sys_Process_Exec procBLL = new BLL.System.sys_Process_Exec(); string tableName = "proj_Contract"; if (submitFlag == 1) { message = "保存并提交成功!"; errMessage = procBLL.CheckSubmit(tableName, model.BillSign, model.DepId, "", model.OperaId); if (errMessage != "") { message = errMessage; return(0); } } int rowId = dal.Add(model); if (rowId < 1) { message = "保存失败!"; } else { BLL.System.sys_Attachment attachmenBLL = new BLL.System.sys_Attachment(); string IDList = (model.AttachmentId_Contract == "" || model.AttachmentId_Contract == null ? "" : model.AttachmentId_Contract + ",") + (model.AttachmentId_ControlCard == "" || model.AttachmentId_ControlCard == null ? "" : model.AttachmentId_ControlCard + ",") ; string FileUse = "项目合同"; if (IDList != "") { attachmenBLL.UpdateUseList(Utils.DelLastComma(IDList), FileUse, rowId); } if (submitFlag == 1) { errMessage = procBLL.SetBillProcess_Submit(tableName, rowId.ToString(), 1, model.OperaId); if (errMessage != "") { message = "保存成功,但提交失败,请联系系统管理员!"; } } } return(rowId); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(SCZM.Model.Proj.proj_Payment model, int submitFlag, out string message) { message = "保存成功!"; string errMessage = ""; BLL.System.sys_Process_Exec procBLL = new BLL.System.sys_Process_Exec(); string tableName = "proj_Payment"; Model.Proj.proj_Payment model_old = dal.GetModel(model.ID); //----------------------审核不同意(billState==2)重新保存时,重置审批流为草稿状态,再进行保存------------------ if (model_old.BillState == 2) { int Num = procBLL.DelBillProcess(model.BillSign, model.ID, tableName, model.OperaId, model.OperaName); //if (Num == -1) //{ // message = "对不起,系统出错,请联系系统管理员!"; // return false; //} } //---------------------- if (submitFlag == 1) { message = "保存并提交成功!"; errMessage = procBLL.CheckSubmit(tableName, model.BillSign, model.DepId, "", model.OperaId); if (errMessage != "") { message = errMessage; return(false); } } int rows = dal.Update(model); if (rows == 0) { message = "对不起,该条数据已被其他人删除!"; return(false); } else { if (submitFlag == 1) { errMessage = procBLL.SetBillProcess_Submit(tableName, model.ID.ToString(), 1, model.OperaId); if (errMessage != "") { message = "保存成功,但提交失败,请联系系统管理员!"; } } return(true); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(UHPROJ.Model.Base.shop_NewBuildApply model, int submitFlag, out string message) { message = "保存成功!"; string errMessage = ""; BLL.System.sys_Process_Exec procBLL = new BLL.System.sys_Process_Exec(); string tableName = "shop_NewBuildApply"; if (submitFlag == 1) { message = "保存并提交成功!"; errMessage = procBLL.CheckSubmit(tableName, model.BillSign, model.DepId, "", model.OperaId); if (errMessage != "") { message = errMessage; return(false); } } int rows = dal.Update(model); if (rows == 0) { message = "对不起,该条数据已被其他人删除!"; return(false); } else { BLL.System.sys_Attachment attachmenBLL = new BLL.System.sys_Attachment(); string IDList = (model.AttachmentId_ZSRW == "" || model.AttachmentId_ZSRW == null ? "" : model.AttachmentId_ZSRW + ",") + (model.AttachmentId_GH == "" || model.AttachmentId_GH == null ? "" : model.AttachmentId_GH + ",") ; string FileUse = "加盟申请"; if (IDList != "") { attachmenBLL.UpdateUseList(Utils.DelLastComma(IDList), FileUse, model.ID); } if (submitFlag == 1) { errMessage = procBLL.SetBillProcess_Submit(tableName, model.ID.ToString(), 1, model.OperaId); if (errMessage != "") { message = "保存成功,但提交失败,请联系系统管理员!"; } } return(true); } }
/// <summary> /// 批量取消提交数据 /// </summary> /// <param name="IDList">ID字符串</param> /// <param name="operaId">操作人ID</param> /// <param name="message">返回消息</param> /// <returns></returns> public bool CancelSubmit(string IDList, int operaId, out string message) { message = "取消提交成功!"; BLL.System.sys_Process_Exec procBLL = new BLL.System.sys_Process_Exec(); string tableName = "proj_Payment"; string errMessage = procBLL.CheckCancelSubmit(tableName, IDList, operaId); if (errMessage != "") { message = errMessage; return(false); } errMessage = procBLL.SetBillProcess_Submit(tableName, IDList, 2, operaId); if (errMessage != "") { message = errMessage; return(false); } return(true); }
/// <summary> /// 批量提交数据 /// </summary> /// <param name="IDList">ID字符串</param> /// <param name="operaId">操作人ID</param> /// <param name="message">返回消息</param> /// <returns></returns> public bool Submit(string IDList, int operaId, out string message) { message = "提交成功!"; BLL.System.sys_Process_Exec procBLL = new BLL.System.sys_Process_Exec(); string tableName = "proj_PartnerContract"; string errMessage = procBLL.CheckSubmit(tableName, "", 0, IDList, operaId); if (errMessage != "") { message = errMessage; return(false); } errMessage = procBLL.SetBillProcess_Submit(tableName, IDList, 1, operaId); if (errMessage != "") { message = errMessage; return(false); } return(true); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(SCZM.Model.Proj.proj_Payment model, int submitFlag, out string message) { message = "保存成功!"; string errMessage = ""; BLL.System.sys_Process_Exec procBLL = new BLL.System.sys_Process_Exec(); string tableName = "proj_Payment"; if (submitFlag == 1) { message = "保存并提交成功!"; errMessage = procBLL.CheckSubmit(tableName, model.BillSign, model.DepId, "", model.OperaId); if (errMessage != "") { message = errMessage; return(0); } } int rowId = dal.Add(model); if (rowId < 1) { message = "保存失败!"; } else { if (submitFlag == 1) { errMessage = procBLL.SetBillProcess_Submit(tableName, rowId.ToString(), 1, model.OperaId); if (errMessage != "") { message = "保存成功,但提交失败,请联系系统管理员!"; } } } return(rowId); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(SCZM.Model.Proj.proj_Contract model, int submitFlag, out string message) { message = "保存成功!"; if (dal.Exists(model.ProjId, model.ID)) { message = "对不起,该项目合同已存在!"; return(false); } string errMessage = ""; BLL.System.sys_Process_Exec procBLL = new BLL.System.sys_Process_Exec(); string tableName = "proj_Contract"; Model.Proj.proj_Contract model_old = dal.GetModel(model.ID); if (model_old.BillState == 2) { int Num = procBLL.DelBillProcess(model.BillSign, model.ID, tableName, model.OperaId, model.OperaName); //if (Num == -1) { // message = "对不起,系统出错,请联系系统管理员!"; // return false; //} } if (submitFlag == 1) { message = "保存并提交成功!"; errMessage = procBLL.CheckSubmit(tableName, model.BillSign, model.DepId, "", model.OperaId); if (errMessage != "") { message = errMessage; return(false); } } int rows = dal.Update(model); if (rows == 0) { message = "对不起,该条数据已被其他人删除!"; return(false); } else { BLL.System.sys_Attachment attachmenBLL = new BLL.System.sys_Attachment(); string IDList = (model.AttachmentId_Contract == "" || model.AttachmentId_Contract == null ? "" : model.AttachmentId_Contract + ",") + (model.AttachmentId_ControlCard == "" || model.AttachmentId_ControlCard == null ? "" : model.AttachmentId_ControlCard + ",") ; string FileUse = "项目合同"; if (IDList != "") { attachmenBLL.UpdateUseList(Utils.DelLastComma(IDList), FileUse, model.ID); } // if (submitFlag == 1) { errMessage = procBLL.SetBillProcess_Submit(tableName, model.ID.ToString(), 1, model.OperaId); if (errMessage != "") { message = "保存成功,但提交失败,请联系系统管理员!"; } } return(true); } }