private bool IsSendItem() { if (_facade == null) { _facade = new WarehouseFacade(base.DataProvider); } object obj = this._facade.GetWarehouseTicket(this.txtTicketNoQuery.Text); if (obj == null) { return(false); } WarehouseTicket tkt = (WarehouseTicket)obj; string strPath = this.MapPath("TransTypeMoStock.xml"); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(strPath); System.Xml.XmlElement eleDoc = doc.DocumentElement; System.Xml.XmlNode elemap = eleDoc.SelectSingleNode("//TransTypeMapping/SendItem"); string strCode = ""; if (elemap != null && elemap.Attributes["Code"] != null) { strCode = elemap.Attributes["Code"].Value; } if (tkt.TransactionTypeCode == strCode) { return(true); } else { return(false); } }
protected override void SetEditObject(object obj) { if (obj == null) { this.txtTransCodeEdit.Text = ""; this.txtMOCodeEdit.Text = ""; this.drpTransTypeEdit.SelectedIndex = -1; this.drpFactoryFromEdit.SelectedIndex = -1; //this.drpSegFromEdit.SelectedIndex = -1; this.drpWHFromEdit.Text = ""; this.drpFactoryToEdit.SelectedIndex = -1; //this.drpSegToEdit.SelectedIndex = -1; this.drpWHToEdit.Text = ""; this.drpTransTypeEdit.Enabled = true; this.txtRefCodeEdit.Text = ""; return; } WarehouseTicket ticket = (WarehouseTicket)obj; this.txtTransCodeEdit.Text = ticket.TicketNo; this.txtMOCodeEdit.Text = ticket.MOCode; SetDropDownValue(this.drpTransTypeEdit, ticket.TransactionTypeCode + ":" + ticket.TicketNo.Substring(0, 1)); SetDropDownValue(this.drpFactoryFromEdit, ticket.FactoryCode); //SetDropDownValue(this.drpSegFromEdit, ticket.SegmentCode); this.drpWHFromEdit.Text = ticket.WarehouseCode; SetDropDownValue(this.drpFactoryToEdit, ticket.TOFactoryCode); //SetDropDownValue(this.drpSegToEdit, ticket.TOSegmentCode); this.drpWHToEdit.Text = ticket.TOWarehouseCode; this.txtRefCodeEdit.Text = ticket.ReferenceCode; this.drpTransTypeEdit.Enabled = false; }
private void DisplayTicketData() { if (_facade == null) { _facade = new WarehouseFacade(base.DataProvider); } string strTicketNo = this.GetRequestParam("ticketno"); object obj = this._facade.GetWarehouseTicket(strTicketNo); if (obj == null) { return; } WarehouseTicket tkt = (WarehouseTicket)obj; this.txtTicketNoQuery.Text = tkt.TicketNo; this.txtTicketUserQuery.Text = tkt.TicketUser; this.txtTicketDateQuery.Text = FormatHelper.ToDateString(tkt.TicketDate); this.txtFactoryFromQuery.Text = tkt.FactoryCode; //this.txtSegmentFromQuery.Text = tkt.SegmentCode; this.txtWarehouseFromQuery.Text = tkt.WarehouseCode; this.txtFactoryToQuery.Text = tkt.TOFactoryCode; //this.txtSegmentToQuery.Text = tkt.TOSegmentCode; this.txtWarehouseToQuery.Text = tkt.TOWarehouseCode; obj = this._facade.GetTransactionType(tkt.TransactionTypeCode); this.txtTransTypeQuery.Text = ((TransactionType)obj).TransactionTypeName; obj = null; tkt = null; this.cmdQuery_Click(null, null); }
protected override object GetEditObject() { if (_facade == null) { _facade = new WarehouseFacade(base.DataProvider); } WarehouseTicket ticket = this._facade.CreateNewWarehouseTicket(); ticket.TicketNo = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtTransCodeEdit.Text, 50)); string str = this.drpTransTypeEdit.SelectedValue; str = str.Substring(0, str.LastIndexOf(":")); ticket.TransactionTypeCode = str; ticket.MOCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeEdit.Text)); ticket.FactoryCode = this.drpFactoryFromEdit.SelectedValue; //ticket.SegmentCode = this.drpSegFromEdit.SelectedValue; ticket.WarehouseCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.drpWHFromEdit.Text)); ticket.TOFactoryCode = this.drpFactoryToEdit.SelectedValue; //ticket.TOSegmentCode = this.drpSegToEdit.SelectedValue; ticket.TOWarehouseCode = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.drpWHToEdit.Text)); ticket.MaintainUser = this.GetUserCode(); ticket.ReferenceCode = this.txtRefCodeEdit.Text; return(ticket); }
protected override string[] FormatExportRecord(object obj) { WarehouseTicketDetail item = (WarehouseTicketDetail)obj; WarehouseTicket tkt = (WarehouseTicket)httkt[item.TicketNo]; string[] strArr = new string[] { item.TicketNo, item.ActualQty.ToString(), tkt.TicketUser, tkt.TransactionUser, FormatHelper.ToDateString(tkt.TicketDate), FormatHelper.ToDateString(tkt.TransactionDate) }; item = null; return(strArr); }
protected override Infragistics.WebUI.UltraWebGrid.UltraGridRow GetGridRow(object obj) { WarehouseTicketDetail item = (WarehouseTicketDetail)obj; WarehouseTicket tkt = (WarehouseTicket)httkt[item.TicketNo]; Infragistics.WebUI.UltraWebGrid.UltraGridRow row = new Infragistics.WebUI.UltraWebGrid.UltraGridRow( new object[] { GetTicketNoDisplay(item), Math.Round(item.ActualQty, 2), tkt.TicketUser, tkt.TransactionUser, FormatHelper.ToDateString(tkt.TicketDate), FormatHelper.ToDateString(tkt.TransactionDate) }); item = null; return(row); }
protected override Infragistics.WebUI.UltraWebGrid.UltraGridRow GetGridRow(object obj) { WarehouseTicketDetail item = (WarehouseTicketDetail)obj; WarehouseTicket tkt = (WarehouseTicket)httkt[item.TicketNo]; string strFactoryCode, strSegCode, strWarehouseCode; string strQty, strActualQty; if (tkt.FactoryCode == this.drpFactoryCodeQuery.SelectedValue && /* tkt.SegmentCode == this.drpSegmentCodeQuery.SelectedValue && */ tkt.WarehouseCode == FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.drpWarehouseCodeQuery.Text))) { strFactoryCode = tkt.FactoryCode; //strSegCode = tkt.SegmentCode; strWarehouseCode = tkt.WarehouseCode; strQty = (-1 * item.ActualQty).ToString(); strActualQty = item.FromWarehouseQty.ToString(); } else { strFactoryCode = tkt.TOFactoryCode; //strSegCode = tkt.TOSegmentCode; strWarehouseCode = tkt.TOWarehouseCode; strQty = item.ActualQty.ToString(); strActualQty = item.ToWarehouseQty.ToString(); } Infragistics.WebUI.UltraWebGrid.UltraGridRow row = new Infragistics.WebUI.UltraWebGrid.UltraGridRow( new object[] { strFactoryCode, //strSegCode, strWarehouseCode, item.ItemCode, item.ItemName, GetTicketNoDisplay(tkt), httranstype[tkt.TransactionTypeCode], Math.Round(Convert.ToDecimal(strQty), 2), Math.Round(Convert.ToDecimal(strActualQty), 2), tkt.TransactionUser, FormatHelper.ToDateString(tkt.TransactionDate) }); item = null; tkt = null; return(row); }
//选择来源工厂、工段,查询所有仓库 /* * private void FillWarehouseFrom(object sender, System.EventArgs e) * { * this.drpWHFromEdit.Items.Clear(); * if (this.drpFactoryFromEdit.SelectedValue == string.Empty) * { * this.drpSegFromEdit.SelectedValue = string.Empty; * } * else * { * this.FillWarehouse(this.drpFactoryFromEdit, this.drpSegFromEdit, this.drpWHFromEdit); * if (sender != null) * { * if (((DropDownList)sender).ID == this.drpFactoryFromEdit.ID) * this.drpFactoryToEdit.SelectedIndex = this.drpFactoryFromEdit.SelectedIndex; * if (((DropDownList)sender).ID == this.drpSegFromEdit.ID) * this.drpSegToEdit.SelectedIndex = this.drpSegFromEdit.SelectedIndex; * FillWarehouseTo(null, null); * } * } * } * private void FillWarehouseTo(object sender, System.EventArgs e) * { * this.drpWHToEdit.Items.Clear(); * if (this.drpFactoryToEdit.SelectedValue == string.Empty) * { * this.drpSegToEdit.SelectedValue = string.Empty; * } * else * this.FillWarehouse(this.drpFactoryToEdit, this.drpSegToEdit, this.drpWHToEdit); * } * private void FillWarehouse(DropDownList drpFactory, DropDownList drpSeg, DropDownList drp) * { * if(_facade==null){_facade = new WarehouseFacade(base.DataProvider);} * string factoryCode = drpFactory.SelectedValue; * string segCode = drpSeg.SelectedValue; * object[] objs = this._facade.GetWarehouseByFactorySeg(segCode, factoryCode); * drp.Items.Clear(); * drp.Items.Add(""); * if (objs != null) * { * for (int i = 0; i < objs.Length; i++) * { * Warehouse wh = (Warehouse)objs[i]; * drp.Items.Add(new ListItem(wh.WarehouseCode, wh.WarehouseCode)); * wh = null; * } * } * objs = null; * } */ #endregion #region Export protected override string[] FormatExportRecord(object obj) { WarehouseTicket ticket = (WarehouseTicket)obj; string[] strValue = new string[] { ticket.TicketNo, ticket.ReferenceCode, GetTransTypeName(ticket.TransactionTypeCode), ticket.MOCode, ticket.FactoryCode, //ticket.SegmentCode, ticket.WarehouseCode, ticket.TOFactoryCode, //ticket.TOSegmentCode, ticket.TOWarehouseCode, GetTicketStatus(ticket.TransactionStatus), ticket.MaintainUser.ToString(), FormatHelper.ToDateString(ticket.MaintainDate) }; ticket = null; return(strValue); }
//选择来源工厂、工段,查询所有仓库 /* * private void FillWarehouseFrom(object sender, System.EventArgs e) * { * this.drpWarehouseCodeQuery.Items.Clear(); * if (this.drpFactoryCodeQuery.SelectedValue == string.Empty) * { * this.drpSegmentCodeQuery.SelectedValue = string.Empty; * } * else * this.FillWarehouse(this.drpFactoryCodeQuery, this.drpSegmentCodeQuery, this.drpWarehouseCodeQuery); * } * private void FillWarehouse(DropDownList drpFactory, DropDownList drpSeg, DropDownList drp) * { * if(_facade==null){_facade = new WarehouseFacade(base.DataProvider);} * string factoryCode = drpFactory.SelectedValue; * string segCode = drpSeg.SelectedValue; * object[] objs = this._facade.GetWarehouseByFactorySeg(segCode, factoryCode); * drp.Items.Clear(); * drp.Items.Add(""); * if (objs != null) * { * for (int i = 0; i < objs.Length; i++) * { * Warehouse wh = (Warehouse)objs[i]; * drp.Items.Add(new ListItem(wh.WarehouseCode, wh.WarehouseCode)); * wh = null; * } * } * objs = null; * } */ #endregion #region Export protected override string[] FormatExportRecord(object obj) { WarehouseTicketDetail item = (WarehouseTicketDetail)obj; WarehouseTicket tkt = (WarehouseTicket)httkt[item.TicketNo]; string strFactoryCode, strSegCode, strWarehouseCode; string strQty, strActualQty; if (tkt.FactoryCode != string.Empty) { strFactoryCode = tkt.FactoryCode; //strSegCode = tkt.SegmentCode; strWarehouseCode = tkt.WarehouseCode; strQty = (-1 * item.ActualQty).ToString(); strActualQty = item.FromWarehouseQty.ToString(); } else { strFactoryCode = tkt.TOFactoryCode; //strSegCode = tkt.TOSegmentCode; strWarehouseCode = tkt.TOWarehouseCode; strQty = item.ActualQty.ToString(); strActualQty = item.ToWarehouseQty.ToString(); } string[] strArr = new string[] { strFactoryCode, //strSegCode, strWarehouseCode, item.ItemCode, item.ItemName, GetTicketNoDisplay(tkt), httranstype[tkt.TransactionTypeCode].ToString(), strQty, strActualQty, tkt.TransactionUser, FormatHelper.ToDateString(tkt.TransactionDate) }; item = null; tkt = null; return(strArr); }
private void DoDataInit() { if (_facade == null) { _facade = new WarehouseFacade(base.DataProvider); } object obj = this._facade.GetWarehouseTicket(this.GetRequestParam("ticketno")); if (obj == null) { throw new Exception(""); } txtPrintTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); WarehouseTicket ticket = (WarehouseTicket)obj; lblTicketNo.Text = "NO: " + ticket.TicketNo; txtFactoryFrom.Text = ticket.FactoryCode; //txtSegmentFrom.Text = ticket.SegmentCode; txtWarehouseFrom.Text = ticket.WarehouseCode; txtFactoryTo.Text = ticket.TOFactoryCode; //txtSegmentTo.Text = ticket.TOSegmentCode; txtWarehouseTo.Text = ticket.TOWarehouseCode; txtCreateUser.Text = this.GetUserCode(); object obj1 = this._facade.GetTransactionType(ticket.TransactionTypeCode); string strType = ((TransactionType)obj1).TransactionTypeName; obj1 = null; ticket = null; lblSubTitle.Text = strType; //this.cmdQuery_Click(null, null); objsDataSource = this.LoadDataSource(0, int.MaxValue); this.gridWebGrid.AllowCustomPaging = true; this.gridWebGrid.VirtualItemCount = this.GetRowCount(); this.gridWebGrid.DataSource = objsDataSource; this.gridWebGrid.DataBind(); }
protected override Infragistics.WebUI.UltraWebGrid.UltraGridRow GetGridRow(object obj) { WarehouseTicket ticket = (WarehouseTicket)obj; Infragistics.WebUI.UltraWebGrid.UltraGridRow row = new Infragistics.WebUI.UltraWebGrid.UltraGridRow( new object[] { "false", ticket.TicketNo, ticket.ReferenceCode, GetTransTypeName(ticket.TransactionTypeCode), ticket.MOCode, ticket.FactoryCode, //ticket.SegmentCode, ticket.WarehouseCode, ticket.TOFactoryCode, //ticket.TOSegmentCode, ticket.TOWarehouseCode, GetTicketStatus(ticket.TransactionStatus), ticket.MaintainUser, FormatHelper.ToDateString(ticket.MaintainDate), "", "", "" }); ticket = null; return(row); }
private string GetTicketNoDisplay(WarehouseTicket tkt) { string strTicketNo = ""; string strHideList = ","; try { string strPath = this.MapPath("TransTypeMoStock.xml"); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(strPath); System.Xml.XmlElement eleDoc = doc.DocumentElement; TransactionType.TRANSACTION_MAPPING = new Hashtable(); System.Xml.XmlNode elemap = eleDoc.SelectSingleNode("//TransTypeMapping"); if (elemap != null) { for (int i = 0; i < elemap.ChildNodes.Count; i++) { if (elemap.ChildNodes[i].NodeType == System.Xml.XmlNodeType.Element) { if (elemap.ChildNodes[i].Attributes["HideTicketNo"] != null && elemap.ChildNodes[i].Attributes["HideTicketNo"].Value == "Yes") { strHideList += elemap.ChildNodes[i].Attributes["Code"].Value + ","; } } } } } catch { strHideList = ""; } if (strHideList.IndexOf("," + tkt.TransactionTypeCode + ",") < 0 || tkt.TicketNo.Substring(0, 1) != "-") { strTicketNo = string.Format("<a href='FQueryTransDtlSP.aspx?ticketno={0}&returnurl={1}' style='color:#2f2f2f'>{0}</a>", tkt.TicketNo, "FQueryTransMP.aspx"); } return(strTicketNo); }