public static bool IsCitePurPlan(string ID) { try { return(PurchasePlanDBHelper.IsCitePurPlan(ID)); } catch (Exception ex) { throw ex; } }
public static string GetRcmPrv(string ProductID) { try { return(PurchasePlanDBHelper.GetRcmPrv(ProductID)); } catch (Exception ex) { throw ex; } }
public static DataTable GetPurchasePlanDetail(string ID) { try { return(PurchasePlanDBHelper.GetPurchasePlanDetail(ID)); } catch (Exception ex) { throw ex; } }
public static DataTable GetPurchaseApply(string CompanyCD, string ProductNo, string ProductName, string StartDate, string EndDate , int pageIndex, int pageCount, string OrderBy, string OrderByType, ref int totalCount, string PurchaseArriveEFIndex, string PurchaseArriveEFDesc) { try { return(PurchasePlanDBHelper.GetPurchaseApply(CompanyCD, ProductNo, ProductName, StartDate, EndDate, pageIndex, pageCount, OrderBy, OrderByType, ref totalCount, PurchaseArriveEFIndex, PurchaseArriveEFDesc)); } catch (Exception ex) { throw ex; } }
public static DataTable SelectPurchasePlan(PurchasePlanModel PurchasePlanM, string OrderBy) { try { DataTable dt = PurchasePlanDBHelper.SelectPurchasePlanPrimary(PurchasePlanM, OrderBy); return(dt); } catch (Exception ex) { throw ex; } }
public static bool CancelClosePurchasePlan(string ID) { //获取登陆用户信息 UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //定义返回变量 bool isSucc = false; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //执行插入操作 try { isSucc = PurchasePlanDBHelper.CancelClosePurchasePlan(ID); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (isSucc) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } LogInfoModel logModel = InitLogInfo(ID); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_CONCELCOMPLETE; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); return(isSucc); }
public static DataTable GetPurchasePlanPrimary(string ID) { try { DataTable dt = PurchasePlanDBHelper.GetPurchasePlanPrimary(ID); dt.Columns.Add("IsCite"); for (int i = 0; i < dt.Rows.Count; ++i) { bool IsCite = PurchasePlanDBHelper.IsCitePurPlan(ID); dt.Rows[i]["IsCite"] = IsCite; } return(dt); } catch (Exception ex) { throw ex; } }
public static DataTable SelectPurchasePlan(PurchasePlanModel PurchasePlanM, int pageIndex, int pageCount, string OrderBy, ref int totalCount) { try { DataTable dt = PurchasePlanDBHelper.SelectPurchasePlanPrimary(PurchasePlanM, pageIndex, pageCount, OrderBy, ref totalCount); //DataColumn JoinName = new DataColumn(); //dt.Columns.Add("IsCite"); //for (int i = 0; i < dt.Rows.Count; i++) //{ // string ID = dt.Rows[i]["ID"].ToString(); // bool IsCite = PurchasePlanDBHelper.IsCitePurPlan(ID); // dt.Rows[i]["IsCite"] = IsCite; //} return(dt); } catch (Exception ex) { throw ex; } }
public static bool CancelConfirm(string ID, string PlanNo, List <ProductModel> ProductMList) { try { ArrayList lstCancelConfirm = new ArrayList(); //更新主表 lstCancelConfirm.Add(PurchasePlanDBHelper.CancelConfirm(ID)); //回写采购申请中已计划数量 if (ProductMList != null) { foreach (ProductModel ProductM in ProductMList) { if (ProductM.FromType == "1") { SqlCommand DescPurApply = PurchasePlanDBHelper.WritePurchaseApplyDesc(ProductM); lstCancelConfirm.Add(DescPurApply); } else if (ProductM.FromType == "2") { SqlCommand DesePurRequire = PurchasePlanDBHelper.WritePurchaseRequireDesc(ProductM); lstCancelConfirm.Add(DesePurRequire); } } } //获取登陆用户信息 UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //撤销审批 string CompanyCD = userInfo.CompanyCD; string BillTypeFlag = ConstUtil.CODING_RULE_PURCHASE; string BillTypeCode = ConstUtil.CODING_RULE_PURCHASE_PLAN; string strUserID = userInfo.UserID;; DataTable dt = FlowDBHelper.GetFlowInstanceInfo(CompanyCD, Convert.ToInt32(BillTypeFlag), Convert.ToInt32(BillTypeCode), Convert.ToInt32(ID)); if (dt.Rows.Count > 0) { string FlowInstanceID = dt.Rows[0]["FlowInstanceID"].ToString(); string FlowStatus = dt.Rows[0]["FlowStatus"].ToString(); string FlowNo = dt.Rows[0]["FlowNo"].ToString(); lstCancelConfirm.Add(FlowDBHelper.CancelConfirmHis(CompanyCD, FlowInstanceID, FlowNo, BillTypeFlag, BillTypeCode, strUserID)); lstCancelConfirm.Add(FlowDBHelper.CancelConfirmTsk(CompanyCD, FlowInstanceID, strUserID)); lstCancelConfirm.Add(FlowDBHelper.CancelConfirmIns(CompanyCD, FlowNo, BillTypeFlag, BillTypeCode, ID, strUserID)); } //定义返回变量 bool isSucc = false; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //执行插入操作 try { isSucc = SqlHelper.ExecuteTransWithArrayList(lstCancelConfirm); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (isSucc) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } LogInfoModel logModel = InitLogInfo(PlanNo); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_UNCONFIRM; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); return(isSucc); } catch (Exception ex) { throw ex; } }
public static bool ConfirmPurchasePlan(string ID, string No, List <ProductModel> ProductMList, out string Reason) { Reason = string.Empty; if (!PurchasePlanDBHelper.CanConfirmPurPlan(ID, out Reason)) { return(false); } ArrayList lstConfirm = new ArrayList(); //写确认人,确认时间 lstConfirm.Add(PurchasePlanDBHelper.ConfirmPurchasePlan(ID)); //回写采购申请 if (ProductMList != null) { foreach (ProductModel ProductM in ProductMList) { if (ProductM.FromType == "1") { lstConfirm.Add(PurchasePlanDBHelper.WritePurchaseApply(ProductM)); } else if (ProductM.FromType == "2") { lstConfirm.Add(PurchasePlanDBHelper.WritePurchaseRequire(ProductM)); } } } //获取登陆用户信息 UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //定义返回变量 bool isSucc = false; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //执行插入操作 try { isSucc = SqlHelper.ExecuteTransWithArrayList(lstConfirm); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (isSucc) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } LogInfoModel logModel = InitLogInfo(No); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_CONFIRM; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); return(isSucc); }
/// <summary> /// 采购计划新增 /// </summary> /// <param name="PurchasePlanM">主表model</param> /// <param name="PurchasePlanSourceMList">明细来源表model列表</param> /// <param name="PurchasePlanDetailMList">明细表model列表</param> /// <param name="IndexIDentity">主表ID</param> /// <returns>bool</returns> public static bool InsertPurchasePlanAll(PurchasePlanModel PurchasePlanM, List <PurchasePlanSourceModel> PurchasePlanSourceMList, List <PurchasePlanDetailModel> PurchasePlanDetailMList, out int IndexIDentity, Hashtable htExtAttr) { ArrayList lstAdd = new ArrayList(); SqlCommand AddPri = PurchasePlanDBHelper.InsertPurchasePlanPrimary(PurchasePlanM); lstAdd.Add(AddPri); foreach (PurchasePlanSourceModel PurchasePlanSourceM in PurchasePlanSourceMList) { SqlCommand AddSource = PurchasePlanDBHelper.InsertPurchasePlanSource(PurchasePlanSourceM); lstAdd.Add(AddSource); } foreach (PurchasePlanDetailModel PurchasePlanDetailM in PurchasePlanDetailMList) { SqlCommand AddDetail = PurchasePlanDBHelper.InsertPurchasePlanDetail(PurchasePlanDetailM); lstAdd.Add(AddDetail); } #region 拓展属性 SqlCommand cmd = new SqlCommand(); GetExtAttrCmd(PurchasePlanM, htExtAttr, cmd); if (htExtAttr.Count > 0) { lstAdd.Add(cmd); } #endregion //获取登陆用户信息 UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //定义返回变量 bool isSucc = false; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //执行插入操作 try { isSucc = SqlHelper.ExecuteTransWithArrayList(lstAdd); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (isSucc) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; IndexIDentity = int.Parse(((SqlCommand)AddPri).Parameters["@IndexID"].Value.ToString()); } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; IndexIDentity = 0; } LogInfoModel logModel = InitLogInfo(PurchasePlanM.PlanNo); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_INSERT; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); return(isSucc); }
/// <summary> /// 删除采购计划 /// </summary> /// <param name="IDs">主表ID串</param> /// <param name="PlanNos">主表PlanNo串</param> /// <returns>bool</returns> public static bool DeletePurchasePlanAll(string IDs, string PlanNos) { ArrayList lstDelete = new ArrayList(); SqlCommand deletepri = PurchasePlanDBHelper.DeletePurchasePlanPrimary(IDs); lstDelete.Add(deletepri); SqlCommand deletesource = PurchasePlanDBHelper.DeletePurchasePlanSource(PlanNos); lstDelete.Add(deletesource); SqlCommand deletedetail = PurchasePlanDBHelper.DeletePurchasePlanDetail(PlanNos); lstDelete.Add(deletedetail); //获取登陆用户信息 UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //定义返回变量 bool isSucc = false; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //执行删除操作 try { isSucc = SqlHelper.ExecuteTransWithArrayList(lstDelete); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (isSucc) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } //获取删除的编号列表 string[] noList = PlanNos.Split(','); //遍历所有编号,登陆操作日志 for (int i = 0; i < noList.Length; i++) { //获取编号 string no = noList[i]; //替换两边的 ' no = no.Replace("'", string.Empty); //操作日志 LogInfoModel logModel = InitLogInfo(no); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_DELETE; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); } return(isSucc); }
/// <summary> /// 修改采购计划 /// </summary> /// <param name="PurchasePlanM">主表model</param> /// <param name="PurchasePlanSourceMList">明细来源表model列表</param> /// <param name="PurchasePlanDetailMList">明细表model列表</param> /// <returns>bool</returns> public static bool UpdatePurchasePlanAll(PurchasePlanModel PurchasePlanM, List <PurchasePlanSourceModel> PurchasePlanSourceMList, List <PurchasePlanDetailModel> PurchasePlanDetailMList, Hashtable htExtAttr) { ArrayList lstUpdate = new ArrayList(); //更新主表 SqlCommand UpdatePri = PurchasePlanDBHelper.UpdatePurchasePlanPrimary(PurchasePlanM); lstUpdate.Add(UpdatePri); #region 拓展属性 SqlCommand cmd = new SqlCommand(); GetExtAttrCmd(PurchasePlanM, htExtAttr, cmd); if (htExtAttr.Count > 0) { lstUpdate.Add(cmd); } #endregion //删除来源表 SqlCommand DeleteSource = PurchasePlanDBHelper.DeletePurchasePlanSource(PurchasePlanM.PlanNo); lstUpdate.Add(DeleteSource); //新增来源表 foreach (PurchasePlanSourceModel PurchasePlanSourceM in PurchasePlanSourceMList) { SqlCommand AddSource = PurchasePlanDBHelper.InsertPurchasePlanSource(PurchasePlanSourceM); lstUpdate.Add(AddSource); } //删除明细表 SqlCommand DeleteDetail = PurchasePlanDBHelper.DeletePurchasePlanDetail(PurchasePlanM.PlanNo); lstUpdate.Add(DeleteDetail); //新增明细表 foreach (PurchasePlanDetailModel PurchasePlanDetailM in PurchasePlanDetailMList) { SqlCommand AddDetail = PurchasePlanDBHelper.InsertPurchasePlanDetail(PurchasePlanDetailM); lstUpdate.Add(AddDetail); } //获取登陆用户信息 UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; //定义返回变量 bool isSucc = false; /* * 定义日志内容变量 * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库 * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件 */ //执行插入操作 try { isSucc = SqlHelper.ExecuteTransWithArrayList(lstUpdate); } catch (Exception ex) { //输出日志 WriteSystemLog(userInfo, ex); } //定义变量 string remark; //成功时 if (isSucc) { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_SUCCESS; } else { //设置操作成功标识 remark = ConstUtil.LOG_PROCESS_FAILED; } LogInfoModel logModel = InitLogInfo(PurchasePlanM.PlanNo); //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空 logModel.Element = ConstUtil.LOG_PROCESS_UPDATE; //设置操作成功标识 logModel.Remark = remark; //登陆日志 LogDBHelper.InsertLog(logModel); return(isSucc); }