Beispiel #1
0
        private void SaveMOLies()
        {
            MOTagLine _moTagLine = new MOTagLine();

            if (tb_CountedBy.Text != "")
            {
                for (int i = 0; i < dgv_MODetail.RowCount; i++)
                {
                    DataRow r = (dgv_MODetail.Rows[i].DataBoundItem as DataRowView).Row;
                    //DataRow r = (DataRow)(dgv_MODetail.Rows[i].DataBoundItem);
                    _moTagLine = MOTagLineLogic.DataRow2MOTagLine_FromDGV(r);
                    x.UpdateMOMOTagLine(_moTagLine);
                }
            }
            else
            {
                MessageBox.Show("Please update the header first.");
            }
        }
Beispiel #2
0
        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();
        }