protected void btnAddReceiveDetails_Click(object sender, EventArgs e) { Result oResult = new Result(); ReceiveDAL oRDal = new ReceiveDAL(); Receive oReceive = (Receive)Session[Constants.SES_RECEIVE]; string sTrnsNo = string.Empty; if (oReceive != null) { sTrnsNo = oReceive.ReceiveTransNo; } oResult = oRDal.IsExist(ddlSPType.SelectedValue, ddlDenomination.SelectedValue, txtSeries.Text, txtFrom.Text, txtTo.Text); if (oResult.Status) { int iCount = (int)oResult.Return; if (iCount == 0) { if (oReceive != null) { AddRDetailToSession(oReceive); } else { AddRDetailToSession(new Receive()); } } else { ucMessage.OpenMessage("This series already exists!!", Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); } } }
protected void btnSearch_Click(object sender, EventArgs e) { Receive oReceive = new Receive(); ReceiveDAL oReceiveDAL = new ReceiveDAL(); Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; Result oResult = oReceiveDAL.SearchList(ddlSPType.SelectedValue, txtFromDate.Text, txtToDate.Text, txtFromAmount.Text, txtToAmount.Text, rblStatus.SelectedValue, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtSPReceiveList = null; ScriptManager.RegisterStartupScript(this.upSuccess, typeof(string), Constants.POPUP_WINDOW, " HideProgressStatus('ctl00_cphDet_ucSearchSPReceive_lblProgress') ", true); if (oResult.Status) { dtSPReceiveList = (DataTable)oResult.Return; if (dtSPReceiveList.Rows.Count > 0) { gvSearchList.DataSource = dtSPReceiveList; gvSearchList.DataBind(); } else { gvSearchList.DataSource = null; gvSearchList.DataBind(); } } Session[Constants.SES_CONFIG_APPROVE_DATA] = dtSPReceiveList; }
private void SaveAction() { Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; if (oConfig != null) { if (hdDataType.Value != "2") { Receive oReceive = (Receive)Session[Constants.SES_RECEIVE]; //check equality of Amount if (oReceive != null) { int iTotalAmount = oReceive.ReceiveDetailsList.Sum(r => r.Denomination.DenominationID * r.ReceiveQuantity); if (iTotalAmount != Util.GetIntNumber(txtReceiveAmount.Text)) { ucMessage.OpenMessage("Denomination amount & Receive Amount must be equal !!", Constants.MSG_TYPE_INFO); } else { oReceive.ReceiveTransNo = hdReceiveTransNo.Value == "" ? "-1" : hdReceiveTransNo.Value; oReceive.SPType.SPTypeID = ddlSPType.SelectedItem.Value; oReceive.ReceiveDate = Util.GetDateTimeByString(txtReceiveDate.Text); oReceive.ReceiveAmount = Util.GetIntNumber(txtReceiveAmount.Text); oReceive.SPType.SPTypeID = ddlSPType.SelectedItem.Value; oReceive.UserDetails = ucUserDet.UserDetail; oReceive.UserDetails.MakerID = oConfig.UserName; oReceive.UserDetails.MakeDate = DateTime.Now; ucUserDet.ResetData(); ReceiveDAL oReceiveDAL = new ReceiveDAL(); Result oResult = (Result)oReceiveDAL.Save(oReceive); if (oResult.Status) { InitializeData(); ucMessage.OpenMessage(Constants.MSG_SUCCESS_SAVE, Constants.MSG_TYPE_SUCCESS); ucUserDet.ResetData(); } else { ucMessage.OpenMessage(Constants.MSG_ERROR_SAVE, Constants.MSG_TYPE_ERROR); } } } } else { ucMessage.OpenMessage(Constants.MSG_APPROVED_SAVE_DATA, Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); } } }
/// <summary> /// LogicDeleteInfo /// </summary> /// <param name="id"></param> /// <param name="loginUser"></param> /// <returns></returns> public bool LogicDeleteInfo(long id, string loginUser) { int cnt = new ReceiveDAL().GetCounts("[STATUS] = " + (int)WmmOrderStatusConstants.Created + " and [FID] in (select [RECEIVE_FID] from [LES].[TT_WMM_RECEIVE_DETAIL] with(nolock) where [VALID_FLAG] = 1 and [ID] = " + id + ")"); if (cnt == 0) { throw new Exception("MC:0x00000178");///入库单状态为已创建时才能删除材料 } return(dal.LogicDelete(id, loginUser) > 0 ? true : false); }
protected void btnAddDenomination_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(ddlDDDenom.SelectedItem.Value) && !string.IsNullOrEmpty(txtDDQuantity.Text)) { ReceiveDAL rd = new ReceiveDAL(); Result oResult = rd.CheckScripAvailabilty(ddlSpType.SelectedItem.Value, Convert.ToInt32(ddlDDDenom.SelectedItem.Value), Convert.ToInt32(txtDDQuantity.Text)); if (oResult.Status) { DuplicateIssue oDI = (DuplicateIssue)Session[Constants.SES_DUPLICATE_ISSUE]; DataTable dt = (DataTable)oDI.DtDuplicateScripsList; DataRow row = null; decimal dMax = Util.GetDecimalNumber(txtTotalStopAmount.Text); decimal dOld = Util.GetDecimalNumber(txtTotalAmount.Text); decimal dNext = dOld + Util.GetDecimalNumber(ddlDDDenom.SelectedItem.Value) * Util.GetIntNumber(txtDDQuantity.Text); if (dNext <= dMax) { for (int i = 0; i < Util.GetIntNumber(txtDDQuantity.Text); i++) { row = dt.NewRow(); row["Denomination"] = ddlDDDenom.SelectedItem.Value; row["DuplicateMark"] = txtDuplicateMark.Text; dt.Rows.Add(row); } // Clear fields.. ddlDDDenom.SelectedIndex = 0; // txtDuplicateMark.Text = string.Empty; txtDDQuantity.Text = "1"; oDI.DtDuplicateScripsList = dt; gvDenomDetail.DataSource = oDI.DtDuplicateScripsList; gvDenomDetail.DataBind(); Session[Constants.SES_DUPLICATE_ISSUE] = oDI; Calculation(); } else { ucMessage.OpenMessage("Duplicate amount and stop certificate amount must be same", Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); } } else { ucMessage.OpenMessage("Scrips are not available for denomination (" + ddlDDDenom.SelectedValue + "). Please check.", Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); } } }
private void StockInfoLoad(string sTypeID) { Session[SEC_RE_DATA] = null; if (!string.IsNullOrEmpty(sTypeID)) { Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; Result oResult = new Result(); ReceiveDAL oRecDal = new ReceiveDAL(); oResult = oRecDal.StockDataInfo(ddlSPType.SelectedValue, oConfig.DivisionID, oConfig.BankCodeID); if (oResult.Status) { Session[SEC_RE_DATA] = (DataTable)oResult.Return; } } }
protected void btnDelete_Click(object sender, EventArgs e) { if (!hdDataType.Value.Equals("2")) { ReceiveDAL oReceiveDAL = new ReceiveDAL(); Result oResult = (Result)oReceiveDAL.Detete(hdReceiveTransNo.Value); if (oResult.Status) { LoadPreviousList(); ClearDetailTextValue(); gvReceiveDetail.DataSource = null; gvReceiveDetail.DataBind(); txtTransNo.Text = string.Empty; txtReceiveDate.Text = DateTime.Now.ToString(Constants.DATETIME_FORMAT); ddlSPType.SelectedIndex = 0; ddlDenomination.Items.Clear(); txtReceiveAmount.Text = string.Empty; txtDrawerNumber.Text = string.Empty; txtCabinetNumber.Text = string.Empty; hdReceiveTransNo.Value = string.Empty; hdDenom.Value = string.Empty; ucMessage.OpenMessage(Constants.MSG_SUCCESS_DELETE, Constants.MSG_TYPE_SUCCESS); } else { if (oResult.Message.Equals(Constants.TABLE_MAIN)) { ucMessage.OpenMessage(Constants.MSG_APPROVED_DELETE_DATA, Constants.MSG_TYPE_ERROR); } else { ucMessage.OpenMessage(Constants.MSG_ERROR_DELETE, Constants.MSG_TYPE_ERROR); } } } else { ucMessage.OpenMessage(Constants.MSG_APPROVED_DELETE_DATA, Constants.MSG_TYPE_INFO); ScriptManager.RegisterStartupScript(this.UpdatePanel2, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("info"), true); } }
protected void btnReject_Click(object sender, EventArgs e) { Receive oReceive = new Receive(hdReceiveTransNo.Value); ReceiveDAL oReceiveDAL = new ReceiveDAL(); oReceive.UserDetails = ucUserDet.UserDetail; Result oResult = (Result)oReceiveDAL.Reject(oReceive); if (oResult.Status) { ucMessage.OpenMessage(Constants.MSG_SUCCESS_REJECT, Constants.MSG_TYPE_SUCCESS); } else { ucMessage.OpenMessage(Constants.MSG_ERROR_REJECT, Constants.MSG_TYPE_ERROR); } }
protected void btnReOrder_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(ddlSPType.SelectedValue)) { Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; Result oResult = new Result(); ReceiveDAL oRecDal = new ReceiveDAL(); oResult = oRecDal.StockDataInfo(ddlSPType.SelectedValue, oConfig.DivisionID, oConfig.BankCodeID); if (oResult.Status) { VGD.SetData((DataTable)oResult.Return, "Re-Order notification Detail"); } } else { VGD.SetData(null, "Re-Order notification Detail"); } }
protected void btnApprove_Click(object sender, EventArgs e) { Receive oReceive = new Receive(hdReceiveTransNo.Value); oReceive.SPType.SPTypeID = ddlSPType.SelectedItem.Value; if (gvReceiveDetail.Rows.Count > 0) { ReceiveDetails oRd = null; foreach (GridViewRow row in gvReceiveDetail.Rows) { oRd = new ReceiveDetails(); oRd.Denomination.DenominationID = Util.GetIntNumber(row.Cells[0].Text); oRd.SPSeries = row.Cells[1].Text; oRd.SeriesFrom = row.Cells[2].Text; oRd.SeriesTo = row.Cells[3].Text; oRd.ReceiveQuantity = Util.GetIntNumber(row.Cells[4].Text); oReceive.ReceiveDetailsList.Add(oRd); } } ReceiveDAL oReceiveDAL = new ReceiveDAL(); oReceive.UserDetails = ucUserDet.UserDetail; oReceive.ReceiveAmount = Convert.ToDecimal(txtReceiveAmount.Text); Result oResult = (Result)oReceiveDAL.Approve(oReceive); if (oResult.Status) { ucMessage.OpenMessage(Constants.MSG_SUCCESS_APPROVE, Constants.MSG_TYPE_SUCCESS); } else { ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR); } }
private void LoadPreviousList() { Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; ReceiveDAL oReceiveDAL = new ReceiveDAL(); Result oResult = oReceiveDAL.LoadUnapprovedList(oConfig.UserName, false, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtTmpList = (DataTable)oResult.Return; if (dtTmpList.Rows.Count > 0) { dtTmpList.Columns.Remove("Maker ID"); gvData.DataSource = dtTmpList; gvData.DataBind(); } else { gvData.DataSource = null; gvData.DataBind(); } Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList; }
/// <summary> /// InsertInfo /// </summary> /// <param name="info"></param> /// <returns></returns> public long InsertInfo(ReceiveDetailInfo info) { ReceiveInfo receiveInfo = new ReceiveDAL().GetInfo(info.ReceiveFid.GetValueOrDefault()); if (receiveInfo == null) { throw new Exception("MC:0x00000084");///数据错误 } if (dal.GetList("[RECEIVE_FID] = N'" + info.ReceiveFid + "' and [PART_NO] = N'" + info.PartNo + "' and [SUPPLIER_NUM] = N'" + info.SupplierNum + "'", string.Empty).Count > 0) { throw new Exception("MC:0x00000464");///同物料号供应商不能一致 } //if (receiveInfo.Status.GetValueOrDefault() != (int)WmmOrderStatusConstants.Created) // throw new Exception("MC:0x00000152");///入库单处理已创建状态时才能添加材料 int cnt = 0; ///入库单是否按供应商类型校验 string receiveOrderValidSupplierTypeFlag = new ConfigDAL().GetValueByCode("RECEIVE_ORDER_VALID_SUPPLIER_TYPE_FLAG"); if (receiveOrderValidSupplierTypeFlag.ToLower() == "true") { ///需要校验入库单的供应商是否为储运供应商 cnt = new SupplierDAL().GetCounts("[SUPPLIER_TYPE] = " + (int)SupplierTypeConstants.LogisticsSupplier + " and [SUPPLIER_NUM] = N'" + receiveInfo.SupplierNum + "'"); ///储运供应商标记 bool logisticsSupplierFlag = cnt == 0 ? false : true; if (logisticsSupplierFlag) { cnt = dal.GetCounts("[PART_NO] = N'" + info.PartNo + "' and [SUPPLIER_NUM] = N'" + info.SupplierNum + "' and [RECEIVE_FID] = N'" + info.ReceiveFid.GetValueOrDefault() + "'"); if (cnt > 0) { throw new Exception("MC:0x00000175");///同一入库单下不能出现相同供应商的物料编码 } } else { ///入库单明细与入库单不是同一家供应商 cnt = new ReceiveDAL().GetCounts("[SUPPLIER_NUM] = N'" + info.SupplierNum + "' and [FID] = N'" + info.ReceiveFid.GetValueOrDefault() + "'"); if (cnt == 0) { throw new Exception("MC:0x00000176");///入库单的物料供应商与入库明细的供应商不一致 } cnt = dal.GetCounts("[PART_NO] = N'" + info.PartNo + "' and [RECEIVE_FID] = N'" + info.ReceiveFid.GetValueOrDefault() + "'"); if (cnt > 0) { throw new Exception("MC:0x00000177");///同一入库单下不能出现相同的物料编码 } } } ///明细中供应商缺失时,从单据上获取 if (string.IsNullOrEmpty(info.SupplierNum)) { info.SupplierNum = receiveInfo.SupplierNum; } ///单据号 if (string.IsNullOrEmpty(info.TranNo)) { info.TranNo = receiveInfo.ReceiveNo; } ///拉动单号 if (string.IsNullOrEmpty(info.RunsheetNo)) { info.RunsheetNo = receiveInfo.RunsheetNo; } ///工厂 if (string.IsNullOrEmpty(info.Plant)) { info.Plant = receiveInfo.Plant; } ///仓库 if (string.IsNullOrEmpty(info.TargetWm)) { info.TargetWm = receiveInfo.WmNo; } ///存储区 if (string.IsNullOrEmpty(info.TargetZone)) { info.TargetZone = receiveInfo.ZoneNo; } ///来源 ///仓库 //if (string.IsNullOrEmpty(info.WmNo)) info.WmNo = receiveInfo.SourceWmNo; /////存储区 //if (string.IsNullOrEmpty(info.ZoneNo)) info.ZoneNo = receiveInfo.SourceZoneNo; ///创建入库单时实收数量等于需求数量 string createReceiveActualQtyEqualsRequired = new ConfigDAL().GetValueByCode("CREATE_RECEIVE_ACTUAL_QTY_EQUALS_REQUIRED"); if (createReceiveActualQtyEqualsRequired.ToLower() == "true") { info.ActualBoxNum = info.RequiredBoxNum; info.ActualQty = info.RequiredQty; } ///如果需求箱数大于零 if (info.RequiredBoxNum.GetValueOrDefault() > 0) { ///如果未填写单包装毛重,但是填写了总毛重,需要计算 if (info.PerpackageGrossWeight.GetValueOrDefault() == 0 && info.SumWeight.GetValueOrDefault() > 0) { info.PerpackageGrossWeight = info.SumWeight.GetValueOrDefault() / info.RequiredBoxNum.GetValueOrDefault(); } ///体积也是如此处理 if (info.PackageVolume.GetValueOrDefault() == 0 && info.SumVolume.GetValueOrDefault() > 0) { info.PackageVolume = info.SumVolume.GetValueOrDefault() / info.RequiredBoxNum.GetValueOrDefault(); } ///件数也是如此处理 if (info.Package.GetValueOrDefault() == 0 && info.RequiredQty.GetValueOrDefault() > 0) { info.Package = Math.Ceiling(info.RequiredQty.GetValueOrDefault() / info.RequiredBoxNum.GetValueOrDefault()); } } /// return(dal.Add(info)); }
/// <summary> /// UpdateInfo /// </summary> /// <param name="fields"></param> /// <param name="id"></param> /// <returns></returns> public bool UpdateInfo(string fields, long id) { string receiveFid = CommonBLL.GetFieldValue(fields, "RECEIVE_FID"); ReceiveInfo receiveInfo = new ReceiveDAL().GetInfo(Guid.Parse(receiveFid)); if (receiveInfo == null) { throw new Exception("MC:0x00000252");///入库单数据错误 } //if (receiveInfo.Status == (int)WmmOrderStatusConstants.Completed // || receiveInfo.Status == (int)WmmOrderStatusConstants.Closed) // throw new Exception("MC:0x00000253");///入库单状态为已关闭或已完成时不能修改其内容 //if (receiveInfo.Status == (int)WmmOrderStatusConstants.Created) //{ // ///入库单是否按供应商类型校验 // string receiveOrderValidSupplierTypeFlag = new ConfigDAL().GetValueByCode("RECEIVE_ORDER_VALID_SUPPLIER_TYPE_FLAG"); // if (receiveOrderValidSupplierTypeFlag.ToLower() == "true") // { // string supplierNum = CommonBLL.GetFieldValue(fields, "SUPPLIER_NUM"); // string partNo = CommonBLL.GetFieldValue(fields, "PART_NO"); // ///需要校验入库单的供应商是否为储运供应商 // int cnt = new SupplierDAL().GetCounts("[SUPPLIER_TYPE] = " + (int)SupplierTypeConstants.LogisticsSupplier + " and [SUPPLIER_NUM] in (select [SUPPLIER_NUM] from [LES].[TT_WMM_RECEIVE] with(nolock) where [FID] = N'" + receiveFid + "' and [VALID_FLAG] = 1)"); // ///储运供应商标记 // bool logisticsSupplierFlag = cnt == 0 ? false : true; // if (logisticsSupplierFlag) // { // cnt = dal.GetCounts("[ID] <> " + id + " and [PART_NO] = N'" + partNo + "' and [SUPPLIER_NUM] = N'" + supplierNum + "' and [RECEIVE_FID] = N'" + receiveFid + "'"); // if (cnt > 0) // throw new Exception("MC:0x00000175");///同一入库单下不能出现相同供应商的物料编码 // } // else // { // ///入库单明细与入库单不是同一家供应商 // cnt = new ReceiveDAL().GetCounts("[SUPPLIER_NUM] = N'" + supplierNum + "' and [FID] = N'" + receiveFid + "'"); // if (cnt == 0) // throw new Exception("MC:0x00000176");///入库单的物料供应商与入库明细的供应商不一致 // cnt = dal.GetCounts("[ID] <> " + id + " and [PART_NO] = N'" + partNo + "' and [RECEIVE_FID] = N'" + receiveFid + "'"); // if (cnt > 0) // throw new Exception("MC:0x00000177");///同一入库单下不能出现相同的物料编码 // } // } //} //else //{ ReceiveDetailInfo receiveDetailInfo = dal.GetInfo(id); ///实收数量 string actualQty = CommonBLL.GetFieldValue(fields, "ACTUAL_QTY"); if (string.IsNullOrEmpty(actualQty)) { actualQty = "NULL"; } if (Convert.ToInt32(actualQty) > receiveDetailInfo.RequiredQty) { throw new Exception("MC:0x00000424"); ///实收数不能大于需求数 } ///实收箱数 string actualBoxNum = CommonBLL.GetFieldValue(fields, "ACTUAL_BOX_NUM"); if (string.IsNullOrEmpty(actualBoxNum)) { actualBoxNum = "NULL"; } ///修改用户 string loginUser = CommonBLL.GetFieldValue(fields, "MODIFY_USER"); fields = "[ACTUAL_QTY] = " + actualQty + ",[ACTUAL_BOX_NUM] = " + actualBoxNum + ",[MODIFY_DATE] = GETDATE(),[MODIFY_USER] = N'" + loginUser + "' "; // } string requiredBoxNum = CommonBLL.GetFieldValue(fields, "REQUIRED_BOX_NUM"); int.TryParse(requiredBoxNum, out int intRequiredBoxNum); ///如果需求箱数大于零 if (intRequiredBoxNum > 0) { string perpackageGrossWeight = CommonBLL.GetFieldValue(fields, "PERPACKAGE_GROSS_WEIGHT"); decimal.TryParse(perpackageGrossWeight, out decimal decimalPerpackageGrossWeight); string sumWeight = CommonBLL.GetFieldValue(fields, "SUM_WEIGHT"); decimal.TryParse(sumWeight, out decimal decimalSumWeight); ///如果未填写单包装毛重,但是填写了总毛重,需要计算 if (decimalPerpackageGrossWeight == 0 && decimalSumWeight > 0) { decimalPerpackageGrossWeight = decimalSumWeight / intRequiredBoxNum; fields = CommonBLL.SetFieldValue(fields, "PERPACKAGE_GROSS_WEIGHT", decimalPerpackageGrossWeight.ToString(), false); } string packageVolume = CommonBLL.GetFieldValue(fields, "PACKAGE_VOLUME"); decimal.TryParse(packageVolume, out decimal decimalPackageVolume); string sumVolume = CommonBLL.GetFieldValue(fields, "SUM_VOLUME"); decimal.TryParse(sumVolume, out decimal decimalSumVolume); ///体积也是如此处理 if (decimalPackageVolume == 0 && decimalSumVolume > 0) { decimalPackageVolume = decimalSumVolume / intRequiredBoxNum; fields = CommonBLL.SetFieldValue(fields, "PACKAGE_VOLUME", decimalPackageVolume.ToString(), false); } string package = CommonBLL.GetFieldValue(fields, "PACKAGE"); decimal.TryParse(package, out decimal decimalPackage); string requiredQty = CommonBLL.GetFieldValue(fields, "REQUIRED_QTY"); decimal.TryParse(requiredQty, out decimal decimalRequiredQty); ///件数也是如此处理 if (decimalPackage == 0 && decimalRequiredQty > 0) { decimalPackage = Math.Ceiling(decimalRequiredQty / intRequiredBoxNum); fields = CommonBLL.SetFieldValue(fields, "PACKAGE", decimalPackage.ToString(), false); } } return(dal.UpdateInfo(fields, id) > 0 ? true : false); }
protected void SearchAction() { string sType = Request.QueryString["pType"]; gvData.DataSource = null; gvData.DataBind(); if (!string.IsNullOrEmpty(sType)) { Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = new DataTable(); Config oConfig = (Config)Session[Constants.SES_USER_CONFIG]; #region Receive if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.RECEIVE).PadLeft(5, '0'))) { lgText.InnerHtml = "SP Receive Approval Queue List"; ReceiveDAL oReceiveDAL = new ReceiveDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Receive' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oReceiveDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtTmpList = (DataTable)oResult.Return; if (dtTmpList != null) { if (dtTmpList.Rows.Count > 0) { gvData.DataSource = dtTmpList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpList; } } } #endregion Receive #region Issue else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.SP_ISSUE).PadLeft(5, '0'))) { lgText.InnerHtml = "SP Issue Approval Queue List"; IssueDAL oIssueDAL = new IssueDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Issue' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oIssueDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtTmpCurrencyList = (DataTable)oResult.Return; if (dtTmpCurrencyList != null) { gvData.DataSource = dtTmpCurrencyList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpCurrencyList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.SP_ISSUE_UPDATE).PadLeft(5, '0'))) { lgText.InnerHtml = "SP Issue Update Approval Queue List"; IssueDAL oIssueDAL = new IssueDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Issue Update' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oIssueDAL.LoadTmpIssueUpdateDataTableList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtTmpIssueUpdateList = (DataTable)oResult.Return; if (dtTmpIssueUpdateList != null) { gvData.DataSource = dtTmpIssueUpdateList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpIssueUpdateList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.SP_ISSUE_OLD).PadLeft(5, '0'))) { lgText.InnerHtml = "SP Old Customer Issue Approval Queue List"; IssueDAL oIssueDAL = new IssueDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Old Customer Issue' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oIssueDAL.LoadUnapprovedOldCustomerIssueList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtTmpIssueUpdateList = (DataTable)oResult.Return; if (dtTmpIssueUpdateList != null) { gvData.DataSource = dtTmpIssueUpdateList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpIssueUpdateList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.SP_ISSUE_ONL).PadLeft(5, '0'))) { lgText.InnerHtml = "SP Online Issue Approval Queue List"; IssueDAL oIssueDAL = new IssueDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'SP Online Issue' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oIssueDAL.LoadUnapprovedOnlineIssueList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtTmpIssueUpdateList = (DataTable)oResult.Return; if (dtTmpIssueUpdateList != null) { gvData.DataSource = dtTmpIssueUpdateList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpIssueUpdateList; } } #endregion Issue #region interst payment else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.INTEREST_PAYMENT).PadLeft(5, '0'))) { lgText.InnerHtml = "Interst Payment Approval Queue List"; InterestPaymentDAL oIntPayDAL = new InterestPaymentDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Interst Payment' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oIntPayDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtTmpIntPayList = (DataTable)oResult.Return; if (dtTmpIntPayList != null) { gvData.DataSource = dtTmpIntPayList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpIntPayList; } } #endregion interst payment #region Encashment else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.ENCASHED).PadLeft(5, '0'))) { lgText.InnerHtml = "Encashment Approval Queue List"; EncashmentDAL oEncashDAL = new EncashmentDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Encashment' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oEncashDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtTmpIntPayList = (DataTable)oResult.Return; if (dtTmpIntPayList != null) { gvData.DataSource = dtTmpIntPayList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtTmpIntPayList; } } #endregion Encashment #region Stop Payment else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.STOP_PAYMENT_MARK).PadLeft(5, '0'))) { lgText.InnerHtml = "Payment Mark Approval Queue List"; StopPaymentDAL oStopPayDAL = new StopPaymentDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Payment Mark' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oStopPayDAL.LoadUnapprovedPaymentMarkList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtList = (DataTable)oResult.Return; if (dtList != null) { gvData.DataSource = dtList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.STOP_PAYMENT_REMOVE_MARK).PadLeft(5, '0'))) { lgText.InnerHtml = "Payment Remove Mark Approval Queue List"; StopPaymentDAL oStopPayDAL = new StopPaymentDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Payment Remove Marks' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oStopPayDAL.LoadUnapprovedPaymentRemoveMarkList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtList = (DataTable)oResult.Return; if (dtList != null) { gvData.DataSource = dtList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.DUPLICATE_ISSUE).PadLeft(5, '0'))) { lgText.InnerHtml = "Duplicate Issues Approval Queue List"; DuplicateIssueDAL oDIDAL = new DuplicateIssueDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Duplicate Issues' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oDIDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtList = (DataTable)oResult.Return; if (dtList != null) { gvData.DataSource = dtList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtList; } } #endregion Stop Payment #region Lien else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.LIEN_MARK).PadLeft(5, '0'))) { lgText.InnerHtml = "Lien Mark Approval Queue List"; LienDAL oLienDAL = new LienDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Lien Mark' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oLienDAL.LoadUnapprovedLienMarkList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtList = (DataTable)oResult.Return; if (dtList != null) { gvData.DataSource = dtList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtList; } } else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.LIEN_MARK_REMOVE).PadLeft(5, '0'))) { lgText.InnerHtml = "Lien Mark Remove Approval Queue List"; LienDAL oLienDAL = new LienDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Lien Mark Remove' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oLienDAL.LoadUnapprovedLienRemoveMarkList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtList = (DataTable)oResult.Return; if (dtList != null) { gvData.DataSource = dtList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtList; } } #endregion Lien #region Reinvestment else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.REINVESTMENT).PadLeft(5, '0'))) { lgText.InnerHtml = "Reinvestment Approval Queue List"; ReinvestmentDAL oRiDAL = new ReinvestmentDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No 'Reinvestment' record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oRiDAL.LoadUnapprovedList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtList = (DataTable)oResult.Return; if (dtList != null) { gvData.DataSource = dtList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtList; } } #endregion Reinvestment #region ACE Register else if (sType.Equals(Convert.ToString((int)Constants.PAGEINDEX_TRANS.ACE_MANAGER).PadLeft(5, '0'))) { lgText.InnerHtml = "ACE Registration Queue List"; IssueDAL oIssueDAL = new IssueDAL(); TemplateBuilder tbGvData = new TemplateBuilder(); tbGvData.AppendLiteralString("No record found"); gvData.EmptyDataTemplate = tbGvData; Result oResult = oIssueDAL.LoadUnapprovedACERegisterList(null, true, oConfig.DivisionID, oConfig.BankCodeID); DataTable dtList = (DataTable)oResult.Return; if (dtList != null) { gvData.DataSource = dtList; gvData.DataBind(); Session[Constants.SES_CONFIG_UNAPPROVE_DATA] = dtList; } } #endregion ACE Register //Make Filter By User //Config oConfig = Session[Constants.SES_USER_CONFIG] as Config; if (!string.IsNullOrEmpty(oConfig.FilterMakerID)) { DDListUtil.Assign(ddlUserName, oConfig.FilterMakerID.Trim()); FilterData(oConfig.FilterMakerID.Trim()); } } }
/// <summary> /// 提交(发布) /// </summary> /// <param name="rowsKeyValues"></param> /// <param name="loginUser"></param> /// <returns></returns> public bool ReleaseInfos(List <string> rowsKeyValues, string loginUser) { ///入库单 List <PlanPullOrderInfo> planPullOrderInfos = dal.GetList("[ID] in (" + string.Join(",", rowsKeyValues.ToArray()) + ")", "[ID]"); if (planPullOrderInfos.Count == 0) { throw new Exception("MC:0x00000084");///数据错误 } StringBuilder @string = new StringBuilder(); foreach (var planPullOrderInfo in planPullOrderInfos) { if (planPullOrderInfo.OrderStatus.GetValueOrDefault() != (int)PullOrderStatusConstants.Created) { throw new Exception("MC:0x00000683");///状态必须为已创建 } ///当出入库单的拉动单号为空时,根据客户委托编号更新出入库单的进仓编号 if (!string.IsNullOrEmpty(planPullOrderInfo.CustTrustNo)) { List <ReceiveInfo> receiveInfos = new ReceiveDAL().GetList("" + "[ASN_NO] = N'" + planPullOrderInfo.CustTrustNo + "' and " + "LEN(ISNULL([RUNSHEET_NO],'')) = 0", string.Empty); List <ReceiveDetailInfo> receiveDetailInfos = new List <ReceiveDetailInfo>(); if (receiveInfos.Count > 0) { receiveDetailInfos = new ReceiveDetailDAL().GetList("" + "[RECEIVE_FID] in ('" + string.Join("','", receiveInfos.Select(d => d.Fid.GetValueOrDefault()).ToArray()) + "')", string.Empty); } List <BarcodeInfo> barcodeInfos = new List <BarcodeInfo>(); if (receiveDetailInfos.Count > 0) { barcodeInfos = new BarcodeDAL().GetList("" + "[CREATE_SOURCE_FID] in ('" + string.Join("','", receiveDetailInfos.Select(d => d.Fid.GetValueOrDefault()).ToArray()) + "')", string.Empty); } foreach (var receiveInfo in receiveInfos) { @string.AppendLine("update [LES].[TT_WMM_RECEIVE] " + "set [RUNSHEET_NO] = N'" + planPullOrderInfo.OrderCode + "' " + "where [ReceiveId] = " + receiveInfo.ReceiveId + ";"); foreach (var receiveDetailInfo in receiveDetailInfos) { @string.AppendLine("update [LES].[TT_WMM_RECEIVE_DETAIL] " + "set [RUNSHEET_NO] = N'" + planPullOrderInfo.OrderCode + "' " + "where [FID] = " + receiveDetailInfo.Fid + ";"); List <BarcodeInfo> barcodes = barcodeInfos.Where(d => d.CreateSourceFid.GetValueOrDefault() == receiveDetailInfo.Fid.GetValueOrDefault()).ToList(); foreach (var barcode in barcodes) { @string.AppendLine("update [LES].[TT_WMM_BARCODE] " + "set [RUNSHEET_NO] = N'" + planPullOrderInfo.OrderCode + "' " + "where [ID] = " + barcode.Id + ";"); } } } List <OutputInfo> outputInfos = new OutputDAL().GetList("[ASN_NO] = N'" + planPullOrderInfo.CustTrustNo + "' and LEN(ISNULL([RUNSHEET_NO],'')) = 0", string.Empty); foreach (var outputInfo in outputInfos) { @string.AppendLine("update [LES].[TT_WMM_OUTPUT] " + "set [RUNSHEET_NO] = N'" + planPullOrderInfo.OrderCode + "' " + "where [ID] = " + outputInfo.OutputId + ";"); @string.AppendLine("update [LES].[TT_WMM_OUTPUT_DETAIL] " + "set [RUNSHEET_NO] = N'" + planPullOrderInfo.OrderCode + "' " + "where [OUTPUT_FID] = N'" + outputInfo.Fid.GetValueOrDefault() + "' and [VALID_FLAG] = 1 and LEN(ISNULL([RUNSHEET_NO],'')) = 0;"); } } } @string.AppendLine("update [LES].[TT_MPM_PLAN_PULL_ORDER] set " + "[ORDER_STATUS] = " + (int)PullOrderStatusConstants.Released + "," + "[PUBLISH_TIME] = GETDATE()," + "[MODIFY_USER] = N'" + loginUser + "'," + "[MODIFY_DATE] = GETDATE() where " + "[ID] in (" + string.Join(",", rowsKeyValues.ToArray()) + ");"); ///执行 using (TransactionScope trans = new TransactionScope()) { if (@string.Length > 0) { CommonDAL.ExecuteNonQueryBySql(@string.ToString()); } trans.Complete(); } return(true); }
private void LoadDataByID(string sTranID, string sApprovalStaus) { Receive oReceive = new Receive(sTranID); ReceiveDAL oReceiveDAL = new ReceiveDAL(); Result oResult = new Result(); oResult = oReceiveDAL.LoadByID(oReceive, sApprovalStaus); oReceive = (Receive)oResult.Return; if (oResult.Status) { Session.Add(Constants.SES_RECEIVE, oReceive); txtTransNo.Text = oReceive.ReceiveTransNo.Trim(); if (oReceive.ReceiveDate != null) { txtReceiveDate.Text = oReceive.ReceiveDate.ToString(Constants.DATETIME_FORMAT); } else { txtReceiveDate.Text = ""; } txtReceiveAmount.Text = oReceive.ReceiveAmount.ToString("N2").Trim(); DDListUtil.Assign(ddlSPType, oReceive.SPType.SPTypeID); StockInfoLoad(oReceive.SPType.SPTypeID); ucUserDet.UserDetail = oReceive.UserDetails; // to load Denomination if (oReceive.SPType.SPTypeID != null) { LoadSPType(); } hdReceiveTransNo.Value = sTranID; if (oReceive.ReceiveDetailsList != null) { SetSPReceiveDetails(oReceive); } //if Approved if (sApprovalStaus.Equals("2")) { EnableDisableControl(true); Util.ControlEnabled(btnReject, false); Util.ControlEnabled(btnApprove, false); Util.ControlEnabled(btnBack, false); Util.ControlEnabled(btnReset, true); Util.ControlEnabled(btnSave, true); Util.ControlEnabled(btnDelete, true); btnSearch.Enabled = true; fsList.Visible = true; } else { EnableDisableControl(false); } } else { Session.Add(Constants.SES_RECEIVE, new Receive()); ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR); } }