private void Load_SelectedMOtagHeader(int Counter) { _t = x.LoadMOHeaderTag(Counter); if (_t != null) { tb_MOTagCounter.Text = Counter.ToString(); tb_Planner.Text = _t.Planner; tb_MO.Text = _t.MO; tb_MOLn.Text = _t.MO_Ln; tb_MOStatus.Text = _t.MO_Status; tb_Order_QTY.Text = _t.Order_Qty.ToString(); tb_QtyReceived.Text = _t.Recv_Qty.ToString(); tb_LineType.Text = _t.LineType.ToString(); tb_FGinWip.Text = _t.FGinWip.ToString(); tb_Parent.Text = _t.Parent_Item_NO.ToString(); tb_ParentDesc.Text = _t.Parent_Item_Desc.ToString(); tb_ParentClass.Text = _t.Parent_ItemRef1; tb_CountedBy.Text = _t.CounterInitials; tb_FGinWip.Text = _t.FGinWip.ToString(); tb_CountedBy.Enabled = true; tb_FGinWip.Enabled = true; Load_MOTag_Lines(_t.MOTagID); } //tb_CountedBy.Enabled=t }
public void Load_MOTags_From_SQL(ref Inventory_System_API x) { //SQL DBMNG = new SQL("FSSERV", "FSDBMR", "AmalAdmin", "Amalgamma16"); CAPA_INVContext context = new CAPA_INVContext(); SQL DBMNG = context.DB_MNG_FS; DataTable TicketMOTags = new DataTable(); List <MOTag> L = new List <MOTag>(); MOTag MOTag2Save = new MOTag(); MOTag MOTag2Compare = new MOTag(); string _query = @"SELECT * FROM [FSDBMR].[dbo].[_CAP_AC_MOTAGS] ORDER BY MOHeaderKey, MOLineKey "; TicketMOTags = DBMNG.Execute_Query(_query); int MOTagHeaderID = 0; foreach (DataRow R in TicketMOTags.Rows) { MOTag2Compare = MOTagLogic.DataRow2MOTag(R); MOTagLine _moTagLine = new MOTagLine(); if ((MOTag2Save.MO != MOTag2Compare.MO) || (MOTag2Save.MO_Ln != MOTag2Compare.MO_Ln)) { MOTag2Save = MOTag2Compare; int counter = x.CreateMOHeaderTag(MOTag2Save); MOTag2Compare = x.LoadMOHeaderTag(counter); MOTagHeaderID = MOTag2Compare.MOTagID; } _moTagLine = MOTagLineLogic.DataRow2MOTagLine(R); _moTagLine.MOTagID = MOTagHeaderID; x.CreateMOTagLine(_moTagLine); //L.Add(MOTagLogic.DataRow2MOTag(R)); //x.CreateCountTiket(TicketTagLogic.DataRow2Tag(R)); } //for (int j = 0; j < L.Count; j++) //{ // x.CreateMOHeaderTag(L[j]); //} context.Dispose(); }