Example #1
0
        static void Load_Tags_From_SQL(ref Inventory_System_API x)
        {
            SQL              DBMNG      = new SQL("FSSERV", "FSDBMR", "AmalAdmin", "Amalgamma16");
            DataTable        TicketTags = new DataTable();
            List <TicketTag> L          = new List <TicketTag>();

            string _query = @"SELECT 
                row_number() over (order by FS_Item.ItemNumber) AS [Counter]
                ,  FS_Item.ItemNumber
                , FS_Item.ItemDescription
                , FS_Item.ItemReference1
                , FS_Item.ItemUM
                , FS_ItemInventory.Stockroom
                , FS_ItemInventory.Bin
                , FS_ItemInventory.InventoryCategory
                , FS_ItemInventory.InventoryQuantity
                , FS_ItemInventory.LotNumber

                FROM         FS_Item INNER JOIN FS_ItemInventory ON FS_Item.ItemKey = FS_ItemInventory.ItemKey
                WHERE (FS_ItemInventory.Stockroom <> 'TC') AND (FS_ItemInventory.Stockroom <> 'OBS')
                order by FS_Item.ItemNumber";

            TicketTags = DBMNG.Execute_Query(_query);

            foreach (DataRow R in TicketTags.Rows)
            {
                L.Add(TicketTagLogic.DataRow2Tag(R));

                //x.CreateCountTiket(TicketTagLogic.DataRow2Tag(R));
            }
            for (int j = 0; j < L.Count; j++)
            {
                x.CreateCountTiket(L[j]);
            }
        }
Example #2
0
        public void Load_Tags_From_SQL(ref Inventory_System_API x, string Location)
        {
            //SQL DBMNG = new SQL("FSSERV", "FSDBMR", "AmalAdmin", "Amalgamma16");

            CAPA_INVContext context  = new CAPA_INVContext();
            SQL             DBMNG    = context.DB_MNG_FS;
            string          JZ       = " WHERE (Stockroom NOT IN ('3','5','FG','NO')) ";
            string          EP       = " WHERE (Stockroom IN ('3','5','FG','NO')) ";
            string          Criteria = "";

            DataTable        TicketTags = new DataTable();
            List <TicketTag> L          = new List <TicketTag>();

            switch (Location)
            {
            case "JZ":
            {
                Criteria = JZ;
                break;
            }

            case "EP":
            {
                Criteria = EP;
                break;
            }

            default:
            {
                Criteria = "";
                break;
            }
            }

            string _query = @"SELECT * FROM [FSDBMR].[dbo].[_CAP_INV_SYS_TicketCount_Tag] " +
                            Criteria +
                            " ORDER BY Stockroom, Bin, ItemNumber";

            TicketTags = DBMNG.Execute_Query(_query);
            int counter = x.GetLastCounter();

            foreach (DataRow R in TicketTags.Rows)
            {
                L.Add(TicketTagLogic.DataRow2Tag(R));

                //x.CreateCountTiket(TicketTagLogic.DataRow2Tag(R));
            }
            for (int j = 0; j < L.Count; j++)
            {
                L[j].Counter = counter + j + 1;
                x.CreateCountTiket(L[j]);
            }
            context.Dispose();
        }
Example #3
0
        static void load_tags_from_CSV(ref Inventory_System_API x)
        {
            CDF_to_DataTable y          = new CDF_to_DataTable(',', "tags.csv", true);
            DataTable        TicketTags = new DataTable();
            List <TicketTag> L          = new List <TicketTag>();

            TicketTags = y.Start_Conversion();
            foreach (DataRow R in TicketTags.Rows)
            {
                //L.Add(TicketTagLogic.DataRow2Tag(R));
                L.Add(Inventory_System_API.TicketTag_DataRow2Tag(R));
            }
            for (int j = 0; j < L.Count; j++)
            {
                x.CreateCountTiket(L[j]);
            }
        }
Example #4
0
        static void Load_Tags_From_Random(ref Inventory_System_API x, int No_Tags)
        {
            DataTable        TicketTags = new DataTable();
            List <TicketTag> L          = new List <TicketTag>();
            Random           r          = new Random();

            TicketTags.Columns.Add("Counter", typeof(int));
            TicketTags.Columns.Add("ItemNumber", typeof(string));
            TicketTags.Columns.Add("ItemDescription", typeof(string));
            TicketTags.Columns.Add("ItemReference1", typeof(string));
            TicketTags.Columns.Add("ItemUM", typeof(string));
            TicketTags.Columns.Add("Stockroom", typeof(string));
            TicketTags.Columns.Add("Bin", typeof(string));
            TicketTags.Columns.Add("InventoryCategory", typeof(string));
            TicketTags.Columns.Add("InventoryQuantity", typeof(int));
            TicketTags.Columns.Add("LotNumber", typeof(string));

            string[] SKT = { "FG", "JZ", "3", "J", "NO" };
            string[] BIN = { "01", "02", "03", "04", "05", "NORTH", "BIN", "B", "QC", "J01", "NORTH" };
            string[] IC  = { "O", "H", "I" };

            int last_tag = x.GetLastCounter();

            for (int i = 1; i < No_Tags; i++)
            {
                TicketTags.Rows.Add(i + last_tag, "201100", "Test Part", "87", "EA"
                                    , SKT[r.Next(0, SKT.Count())]
                                    , BIN[r.Next(0, BIN.Count())]
                                    , IC[r.Next(0, IC.Count())]
                                    , r.Next(1, 512)
                                    , "TestLot-" + r.Next(1, 365).ToString());
            }
            foreach (DataRow R in TicketTags.Rows)
            {
                L.Add(TicketTagLogic.DataRow2Tag(R));
            }
            for (int j = 0; j < L.Count; j++)
            {
                x.CreateCountTiket(L[j]);
            }
        }