private static List <OrderDataForEfficiencyStructure> GetCurrentShiftMstOrders(DataGridView mstGrid)
        {
            List <OrderDataForEfficiencyStructure> result = new List <OrderDataForEfficiencyStructure>();

            foreach (DataGridViewRow row in mstGrid.Rows)
            {
                int qty = int.Parse(row.Cells["ColumnMstQty"].Value.ToString());
                //if (qty == 0) continue;
                DateTime start = (DateTime)row.Cells["MstOrdersStart"].Value;
                DateTime end   = (DateTime)row.Cells["MstOrdersEnd"].Value;
                if (start == end)
                {
                    end = end.AddMinutes(1);
                }
                var owningShift  = DateTools.GetOrderOwningShift(start, end);
                var currentShift = DateTools.whatDayShiftIsit(DateTime.Now);
                if (currentShift.fixedDate != owningShift.fixedDate)
                {
                    continue;
                }


                string modelId = row.Cells["Column12NC"].Value.ToString().Replace(" ", "");

                result.Add(new OrderDataForEfficiencyStructure()
                {
                    start   = start,
                    end     = end,
                    modelId = modelId,
                    qty     = qty
                });
            }
            return(result);
        }
Beispiel #2
0
        private static List <OrderDataForEfficiencyStructure> GetCurrentShiftLgOrders(DataGridView lgGrid)
        {
            List <OrderDataForEfficiencyStructure> result = new List <OrderDataForEfficiencyStructure>();

            foreach (DataGridViewRow row in lgGrid.Rows)
            {
                if (row.Cells["EndDate"].Value == null)
                {
                    continue;
                }
                DateTime start        = DateTime.Parse(row.Cells["StartDate"].Value.ToString());
                DateTime end          = DateTime.Parse(row.Cells["EndDate"].Value.ToString());
                var      owningShift  = DateTools.GetOrderOwningShift(start, end);
                var      currentShift = DateTools.whatDayShiftIsit(DateTime.Now);
                if (currentShift.fixedDate != owningShift.fixedDate)
                {
                    continue;
                }

                int    qty     = int.Parse(row.Cells["ColumnQty"].Value.ToString());
                string modelId = row.Cells["ColumnModel"].Value.ToString().Replace(" ", "");

                result.Add(new OrderDataForEfficiencyStructure()
                {
                    start    = start,
                    end      = end,
                    modelId  = modelId,
                    qty      = qty,
                    rowIndex = row.Index
                });
            }
            return(result);
        }