protected override object[] LoadDataSource(int inclusive, int exclusive) { if (facade == null) { facade = new PauseFacade(base.DataProvider); } string pauseCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPauseCodeQuery.Text)); if (pauseCode != null && pauseCode.Length > 0) { object[] obj = facade.QueryLast(pauseCode); if (obj != null) { Pause pauseQuery = obj[0] as Pause; this.txtPauseReasonEdit.Text = pauseQuery.PauseReason; this.txtPauseUserEdit.Text = pauseQuery.PUser; this.txtPauseDateEdit.Text = pauseQuery.PDate.ToString(); } } else { WebInfoPublish.Publish(this, "$PAUSECODE_CANT_BE_BULL", this.languageComponent1); return(null); } return(this.facade.QueryPauseDetails( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPauseCodeQuery.Text)), FormatHelper.CleanString(this.txtCancleSequenceCodeQuery.Text), inclusive, exclusive)); }
private void cmdQuery_ServerClick(object sender, System.EventArgs e, bool checkAfterSave) { if (!CheckQueryCondition()) { return; } ChearUI(); string strPauseCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPauseCode.Text.Trim())); PauseFacade objFacade = new PauseFacade(this.DataProvider); object objPause = objFacade.GetPause(strPauseCode); if (objPause == null && checkAfterSave == false) { //Message:停发通知单不存在 WebInfoPublish.Publish(this, "$CS_PAUSE_NOT_EXIST", this.languageComponent1); this.txtPauseCode.Focus(); return; } if (((Pause)objPause).Status.EndsWith(PauseStatus.status_cancel) && checkAfterSave == false) { //Message:该停发通知单已经关闭 WebInfoPublish.Publish(this, "$CS_PAUSE_IN_CANCEL", this.languageComponent1); this.txtPauseCode.Focus(); return; } this.txtPauseReason.Text = ((Pause)objPause).PauseReason; this.RequestData(strPauseCode); }
protected override int GetRowCount() { if (facade == null) { facade = new PauseFacade(base.DataProvider); } return(this.facade.QueryPauseDetailsCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPauseCodeQuery.Text)), FormatHelper.CleanString(this.txtCancleSequenceCodeQuery.Text) )); }
private void RequestData(string pauseCode) { PauseFacade objFacade = new PauseFacade(this.DataProvider); // 2005-04-06 this.pagerToolBar.PageSize = this.pagerSizeSelector.PageSize; this.gridHelper.GridBind(PageGridBunding.Page, this.pagerSizeSelector.PageSize); this.pagerToolBar.RowCount = objFacade.GetNotCancelPause2RcardListCount(pauseCode); this.pagerToolBar.InitPager(); this.txtCancelReason.Text = string.Empty; this.txtCancelSeq.Text = string.Empty; }
protected override int GetRowCount() { if (facade == null) { facade = new PauseFacade(this.DataProvider); } return(this.facade.QueryPauseSequenceCount( FormatHelper.CleanString(this.txtStorageCodeQuery.Text), FormatHelper.CleanString(this.txtStackCodeQuery.Text), FormatHelper.CleanString(this.txtPalletCodeQuery.Text), FormatHelper.CleanString(this.txtItemCodeQuery.Text), FormatHelper.CleanString(this.txtPauseCodeQuery.Text), FormatHelper.CleanString(this.txtCancelPauseQuery.Text), true)); }
protected override int GetRowCount() { if (facade == null) { facade = new PauseFacade(base.DataProvider); } return(this.facade.QueryHistoryCount( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPauseCodeQuery.Text)), this.drpPauseStatus.SelectedValue, this.txtItemCodeEdit.Text, FormatHelper.CleanString(this.txtBOMVersionQuery.Text), FormatHelper.TODateInt(this.datePauseStartDateQuery.Text), FormatHelper.TODateInt(this.datePauseEndDateQuery.Text) )); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (facade == null) { facade = new PauseFacade(base.DataProvider); } return(this.facade.QueryHistory( FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPauseCodeQuery.Text)), this.drpPauseStatus.SelectedValue, this.txtItemCodeEdit.Text, FormatHelper.CleanString(this.txtBOMVersionQuery.Text), FormatHelper.TODateInt(this.datePauseStartDateQuery.Text), FormatHelper.TODateInt(this.datePauseEndDateQuery.Text), inclusive, exclusive)); }
private object[] LoadDataSource() { string strPauseCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPauseCode.Text.Trim())); PauseFacade objFacade = new PauseFacade(this.DataProvider); object objPause = objFacade.GetPause(strPauseCode); if (objPause == null || ((Pause)objPause).Status.EndsWith(PauseStatus.status_cancel)) { return(null); } return(this.LoadDataSource(1, int.MaxValue)); }
protected override object[] LoadDataSource(int inclusive, int exclusive) { if (facade == null) { facade = new PauseFacade(this.DataProvider); } return(facade.QueryPauseSequence( FormatHelper.CleanString(this.txtStorageCodeQuery.Text), FormatHelper.CleanString(this.txtStackCodeQuery.Text), FormatHelper.CleanString(this.txtPalletCodeQuery.Text), FormatHelper.CleanString(this.txtItemCodeQuery.Text), FormatHelper.CleanString(this.txtPauseCodeQuery.Text), FormatHelper.CleanString(this.txtCancelPauseQuery.Text), true, inclusive, exclusive)); }
private object[] LoadDataSource(int inclusive, int exclusive) { string strPauseCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPauseCode.Text.Trim())); PauseFacade objFacade = new PauseFacade(this.DataProvider); object objPause = objFacade.GetPause(strPauseCode); if (objPause == null || ((Pause)objPause).Status.EndsWith(PauseStatus.status_cancel)) { return(null); } return(objFacade.GetNotCancelPause2RcardList(FormatHelper.CleanString(strPauseCode), inclusive, exclusive)); }
protected void cmdCancelPause_ServerClick(object sender, System.EventArgs e) { if (!this.CheckCancelPauseUI()) { return; } ArrayList arryList = this.gridHelper.GetCheckedRows(); if (arryList.Count == 0) { WebInfoPublish.Publish(this, "$CS_CHOOSE_ONE_RECORD_AT_LEAST", languageComponent1); return; } IList <CancelPauseQuery> queryList = new List <CancelPauseQuery>(); foreach (GridRecord row in arryList) { CancelPauseQuery obj = new CancelPauseQuery(); obj.PauseCode = row.Items.FindItemByKey("PauseCode").Text; obj.StorageCode = row.Items.FindItemByKey("StorageCode").Text; obj.StackCode = row.Items.FindItemByKey("StackCode").Text; obj.PauseQty = Convert.ToDecimal(row.Items.FindItemByKey("PauseQty").Text); obj.CancelQty = Convert.ToDecimal(row.Items.FindItemByKey("CancelQty").Text); obj.ItemCode = row.Items.FindItemByKey("ItemCode").Text; obj.ItemDescription = row.Items.FindItemByKey("ItemDesc").Text; queryList.Add(obj); } PauseFacade objFacade = new PauseFacade(this.DataProvider); objFacade.CancelPause(this.GetUserCode(), FormatHelper.CleanString(this.txtCancelSeq.Text.Trim()), FormatHelper.CleanString(this.txtCancelReason.Text.Trim()), queryList); cmdQuery_ServerClick(null, null, true); ////Message:解除停发成功 // //WebInfoPublish.Publish(this, "$CS_CANCEL_PAUSE_SUCCESS", languageComponent1); }
protected void Page_Load(object sender, System.EventArgs e) { _GridHelper = new GridHelper(this.gridWebGrid); _PauseFacade = new PauseFacade(this.DataProvider); _WarehouseFacade = new WarehouseFacade(this.DataProvider); if (!this.IsPostBack) { this.InitPageLanguage(this.languageComponent1, false); InitDropDownList_PeiodGroup(); InitDropDownList_FirstClass(); InitWebGrid(); this.chbSAPCompelete.Checked = true; } this._WebQueryHelper = new WebQueryHelper(this.cmdQuery, this.cmdGridExport, this.gridWebGrid, this.pagerSizeSelector, this.pagerToolBar, this.languageComponent1); this._WebQueryHelper.LoadGridDataSource += new EventHandler(WebQueryHelper_LoadGridDataSource); this._WebQueryHelper.DomainObjectToGridRow += new EventHandler(WebQueryHelper_DomainObjectToGridRow); this._WebQueryHelper.DomainObjectToExportRow += new EventHandler(WebQueryHelper_DomainObjectToExportRow); }
private void txtPauseCode_Leave(object sender, EventArgs e) { PauseFacade objFacade = new PauseFacade(this.DataProvider); if (this.txtPauseCode.Value.Trim().Length != 0) { object objPause = objFacade.GetPause(FormatHelper.CleanString(this.txtPauseCode.Value.Trim())); if (objPause != null) { this.txtPauseReason.Value = ((Pause)objPause).PauseReason; this.txtPauseReason.ReadOnly = true; } else { this.txtPauseReason.ReadOnly = false; } } else { this.txtPauseReason.ReadOnly = false; } }
protected override void Grid_ClickCell(GridRecord row, string commandName) { //base.Grid_ClickCell(cell); if (commandName == "DetailsMore") { this.Response.Redirect(this.MakeRedirectUrl("./FPauseSequenceQueryNew.aspx", new string[] { "storageCode", "stackCode", "palletCode", "itemCode", "pauseCode", "cancelCode" }, new string[] { "", "", "", "", row.Items.FindItemByKey("PauseCode").Value.ToString().Trim(), "" })); } if (commandName == "Download") { string pauseCode = row.Items.FindItemByKey("PauseCode").Value.ToString(); string pauseQty = row.Items.FindItemByKey("PauseCount").Value.ToString(); if (facade == null) { facade = new PauseFacade(base.DataProvider); } object[] pauseObj = facade.QueryPauseSequence("", "", "", "", pauseCode, "", false, 0, 100000); if (pauseObj == null) { ExceptionManager.Raise(this.GetType(), "停发通知单不存在"); } PauseQuery pauseQuery = pauseObj[0] as PauseQuery; string originalFilePath = this.Request.PhysicalApplicationPath + @"download\PauseCode.htm"; if (!File.Exists(originalFilePath)) { ExceptionManager.Raise(this.GetType(), "文件[PauseCode.htm]不存在"); } string fileContent = File.ReadAllText(originalFilePath, Encoding.GetEncoding("GB2312")); fileContent = fileContent.Replace("$$PauseCode$$", pauseCode); fileContent = fileContent.Replace("$$ModelCode$$", pauseQuery.MModelCode == "" ? " " : pauseQuery.MModelCode); fileContent = fileContent.Replace("$$BOMVersion$$", pauseQuery.BOM == "" ? " " : pauseQuery.BOM); fileContent = fileContent.Replace("$$ItemCode$$", pauseQuery.MCode == "" ? " " : pauseQuery.MCode); fileContent = fileContent.Replace("$$ItemDescription$$", pauseQuery.MDesc == "" ? " " : pauseQuery.MDesc); fileContent = fileContent.Replace("$$PauseQty$$", pauseQty == "" ? " " : pauseQty); fileContent = fileContent.Replace("$$PauseReason$$", pauseQuery.PauseReason == "" ? " " : pauseQuery.PauseReason); string downloadPhysicalPath = this.Request.PhysicalApplicationPath + @"upload\"; if (!Directory.Exists(downloadPhysicalPath)) { Directory.CreateDirectory(downloadPhysicalPath); } string filename = string.Format("{0}_{1}_{2}", row.Items.FindItemByKey("PauseCode").Value.ToString(), FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString()); string filepath = string.Format(@"{0}{1}{2}", downloadPhysicalPath, filename, ".xls"); while (File.Exists(filepath)) { filename = string.Format("{0}_{1}", filename, "0"); filepath = string.Format(@"{0}{1}{2}", downloadPhysicalPath, filename, ".xls"); } StreamWriter writer = new StreamWriter(filepath, false, System.Text.Encoding.GetEncoding("GB2312")); writer.Write(fileContent); writer.Flush(); writer.Close(); this.DownloadFile(filename); } }
private void btnSave_Click(object sender, EventArgs e) { if (this.gridInfo.Rows.Count == 0) { //表格中没有数据 ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_GRID_NO_RECORD")); return; } ////检查是否有选中的数据 // bool blnIsSelected = false; for (int i = 0; i < this.gridInfo.Rows.Count; i++) { if (this.gridInfo.Rows[i].Cells["checked"].Value.ToString().ToLower().Equals("true")) { blnIsSelected = true; break; } for (int j = 0; j < this.gridInfo.Rows[i].ChildBands[0].Rows.Count; j++) { if (this.gridInfo.Rows[i].ChildBands[0].Rows[j].Cells["checked"].Value.ToString().ToLower().Equals("true")) { blnIsSelected = true; break; } else { for (int m = 0; m < this.gridInfo.Rows[i].ChildBands[0].Rows[j].ChildBands[0].Rows.Count; m++) { if (this.gridInfo.Rows[i].ChildBands[0].Rows[j].ChildBands[0].Rows[m].Cells["checked"].Value.ToString().ToLower().Equals("true")) { blnIsSelected = true; break; } } } } } if (!blnIsSelected) { //Message:请至少选中一笔记录 ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_CHOOSE_ONE_RECORD_AT_LEAST")); return; } if (this.txtPauseCode.Value.Trim().Length == 0) { //Message:请输入停发通知单 ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_INPUT_PAUSE_CODE")); this.txtPauseCode.TextFocus(true, true); return; } string strPauseCode = FormatHelper.CleanString(this.txtPauseCode.Value.Trim()); if (this.txtPauseReason.Value.Trim().Length == 0) { //Message:请输入停发原因 ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_INPUT_PAUSE_REASON")); this.txtPauseReason.TextFocus(true, true); return; } string strPauseReason = FormatHelper.CleanString(this.txtPauseReason.Value.Trim()); PauseFacade objFacade = new PauseFacade(this.DataProvider); object objPause = objFacade.GetPause(strPauseCode); if (objPause != null) { if (((Pause)objPause).Status.Equals(PauseStatus.status_cancel)) { //Message:停发通知单已经关闭,请输入停发通知单 ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_PAUSE_IN_CANCEL,$CS_INPUT_PAUSE_CODE")); this.txtPauseCode.TextFocus(false, true); return; } if (!((Pause)objPause).Status.Equals(PauseStatus.status_pause)) { //Message:停发通知单状态错误 ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_PAUSE_STATUS_ERROR " + ((Pause)objPause).Status)); this.txtPauseCode.TextFocus(false, true); return; } } ////Message:确定把所选择的序列号加入该停发通知单内? // if (MessageBox.Show(UserControl.MutiLanguages.ParserMessage("$CS_ADD_RCARD_TO_PAUSE") + "?", UserControl.MutiLanguages.ParserMessage("$CS_CONFIRM"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(DataProvider); Pause pause = new Pause(); pause.PauseCode = strPauseCode; pause.PauseReason = strPauseReason; pause.CancelReason = " "; pause.Status = PauseStatus.status_pause; pause.PUser = ApplicationService.Current().LoginInfo.UserCode; pause.PDate = dbDateTime.DBDate; pause.PTime = dbDateTime.DBTime; pause.CancelUser = "******"; //pause.CancelDate = dbDateTime.DBDate; //pause.CancelTime = dbDateTime.DBTime; pause.MaintainUser = ApplicationService.Current().LoginInfo.UserCode; pause.MaintainDate = dbDateTime.DBDate; pause.MaintainTime = dbDateTime.DBTime; IList <Pause2Rcard> pause2RcardList = new List <Pause2Rcard>(); for (int i = 0; i < this.gridInfo.Rows.Count; i++) { for (int j = 0; j < this.gridInfo.Rows[i].ChildBands[0].Rows.Count; j++) { for (int m = 0; m < this.gridInfo.Rows[i].ChildBands[0].Rows[j].ChildBands[0].Rows.Count; m++) { if (this.gridInfo.Rows[i].ChildBands[0].Rows[j].ChildBands[0].Rows[m].Cells["checked"].Value.ToString().ToLower().Equals("true")) { string rcard = this.gridInfo.Rows[i].ChildBands[0].Rows[j].ChildBands[0].Rows[m].Cells["rcard"].Value.ToString(); if (objFacade.CheckExistPause2Rcard(strPauseCode, rcard)) { ////Message: 已经存在停发资料 // ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_ALREADY_EXIST_PAUSE2RCARD $CS_Param_RunSeq=" + rcard)); return; } Pause2Rcard objPause2Rcard = new Pause2Rcard(); objPause2Rcard.PauseCode = strPauseCode; objPause2Rcard.SerialNo = rcard; objPause2Rcard.ItemCode = this.gridInfo.Rows[i].ChildBands[0].Rows[j].ChildBands[0].Rows[m].Cells["itemcode"].Value.ToString(); objPause2Rcard.CancelSeq = " "; objPause2Rcard.BOM = this.gridInfo.Rows[i].Cells["bom"].Value.ToString(); objPause2Rcard.MOCode = this.gridInfo.Rows[i].ChildBands[0].Rows[j].ChildBands[0].Rows[m].Cells["mocode"].Value.ToString(); objPause2Rcard.Status = PauseStatus.status_pause; objPause2Rcard.CancelReason = " "; objPause2Rcard.PUser = ApplicationService.Current().LoginInfo.UserCode; objPause2Rcard.PDate = dbDateTime.DBDate; objPause2Rcard.PTime = dbDateTime.DBTime; objPause2Rcard.CancelUser = "******"; objPause2Rcard.MaintainUser = ApplicationService.Current().LoginInfo.UserCode; objPause2Rcard.MaintainDate = dbDateTime.DBDate; objPause2Rcard.MaintainTime = dbDateTime.DBTime; pause2RcardList.Add(objPause2Rcard); } } } } objFacade.PauseRcard(pause, pause2RcardList); ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Success, "$CS_Save_Success")); this.m_dsPauseInfo.Clear(); this.m_dtDetail.Clear(); this.m_dtHead.Clear(); this.txtPauseReason.Value = ""; this.txtPauseCode.TextFocus(true, true); } }
private void btnQuiry_Click(object sender, EventArgs e) { ////检查查询必输项 // if (!this.CheckUI()) { return; } this.m_dsPauseInfo.Clear(); this.m_dtHead.Clear(); this.m_dtDetail.Clear(); PauseFacade objFacade = new PauseFacade(this.DataProvider); DataCollectFacade dcf = new DataCollectFacade(DataProvider); string sourceRCardStart = dcf.GetSourceCard(this.txtRcardFrom.Value.Trim().ToUpper(), string.Empty); string sourceRCardEnd = dcf.GetSourceCard(this.txtRcardTo.Value.Trim().ToUpper(), string.Empty); ////Query Grid Head // object[] objHeadList = objFacade.GetPauseInfoFromHead(FormatHelper.CleanString(this.txtModelCode.Value.Trim()), FormatHelper.CleanString(this.txtBOM.Value.Trim()), FormatHelper.CleanString(this.txtItemDesc.Value.Trim()), this.inINVdateFrom.Value.ToString() == null ? "" : FormatHelper.TODateInt(this.inINVdateFrom.Value).ToString(), this.inINVDateTo.Value.ToString() == null ? "" : FormatHelper.TODateInt(this.inINVDateTo.Value).ToString(), FormatHelper.CleanString(sourceRCardStart), FormatHelper.CleanString(sourceRCardEnd), this.chkIsFinished.Checked, FormatHelper.CleanString(this.txtBigSSCode.Value.Trim())); if (objHeadList == null) { ApplicationRun.GetInfoForm().Add( new UserControl.Message(MessageType.Error, "$CS_No_Data_To_Display")); return; } DataRow dr; foreach (PauseSetting obj in objHeadList) { dr = this.m_dtHead.NewRow(); dr["checked"] = "false"; dr["itemcode"] = obj.ItemCode; dr["itemdesc"] = obj.ItemDescription; dr["bom"] = obj.BOM; dr["invqty"] = obj.qty; this.m_dtHead.Rows.Add(dr); } ////Query Grid Detail // object[] objDetailList = objFacade.GetPauseInfoFromDetail(FormatHelper.CleanString(this.txtModelCode.Value.Trim()), FormatHelper.CleanString(this.txtBOM.Value.Trim()), FormatHelper.CleanString(this.txtItemDesc.Value.Trim()), this.inINVdateFrom.Value.ToString() == null ? "" : FormatHelper.TODateInt(this.inINVdateFrom.Value).ToString(), this.inINVDateTo.Value.ToString() == null ? "" : FormatHelper.TODateInt(this.inINVDateTo.Value).ToString(), FormatHelper.CleanString(sourceRCardStart), FormatHelper.CleanString(sourceRCardEnd), this.chkIsFinished.Checked, FormatHelper.CleanString(this.txtBigSSCode.Value.Trim())); foreach (PauseSetting obj in objDetailList) { dr = this.m_dtDetail.NewRow(); dr["checked"] = "false"; dr["itemcode"] = obj.ItemCode; dr["palletcode"] = obj.PalletCode; dr["palletqty"] = obj.qty; dr["bom"] = obj.BOM; this.m_dtDetail.Rows.Add(dr); } ////Query Grid PalletDetail // object[] objPalletDetailList = objFacade.GetPauseInfoFromPalletDetail(FormatHelper.CleanString(this.txtModelCode.Value.Trim()), FormatHelper.CleanString(this.txtBOM.Value.Trim()), FormatHelper.CleanString(this.txtItemDesc.Value.Trim()), this.inINVdateFrom.Value.ToString() == null ? "" : FormatHelper.TODateInt(this.inINVdateFrom.Value).ToString(), this.inINVDateTo.Value.ToString() == null ? "" : FormatHelper.TODateInt(this.inINVDateTo.Value).ToString(), FormatHelper.CleanString(sourceRCardStart), FormatHelper.CleanString(sourceRCardEnd), this.chkIsFinished.Checked, FormatHelper.CleanString(this.txtBigSSCode.Value.Trim())); foreach (PauseSetting obj in objPalletDetailList) { dr = this.m_dtPalletDetail.NewRow(); dr["checked"] = "false"; dr["itemcode"] = obj.ItemCode; dr["bigsscode"] = obj.BigSSCode; dr["rcard"] = obj.Rcard; dr["palletcode"] = obj.PalletCode; dr["mocode"] = obj.MOCode; dr["finishdate"] = FormatHelper.ToDateString(obj.FinishedDate, "/"); dr["ininvdate"] = FormatHelper.ToDateString(obj.InInvDate, "/"); dr["bom"] = obj.BOM; this.m_dtPalletDetail.Rows.Add(dr); } }