Ejemplo n.º 1
0
        public PowerCord(string paramFilePath)
        {
            string optionName = this.GetType().Name;
            var    dt         = ConvertCSVtoDataTable(paramFilePath);
            var    newSort    = (from row in dt.AsEnumerable()

                                 group row by new
            {
                wiresQty = row.Field <string>("Wires Qty"),
                Workcenter = row.Field <string>("Work Center")
            } into grp
                                 select new
            {
                workcenter = grp.Key.Workcenter,
                wires = grp.Key.wiresQty,
                Sum = grp.Sum(r => Double.Parse(r.Field <string>("Time (min)")))
            }).ToList();


            foreach (var row in newSort)
            {
                ParametersTB.AddInstance("WiresQty", row.wires);


                OptionTB.AddInstance(optionName, row.Sum);
                OptionTB.AddParam(optionName, row.Sum, "WiresQty", row.wires);
                using (var db = new TimeContext())
                {
                    foreach (var fixture in db.Fixtures)
                    {
                        FixtureTB.AddOption(fixture.FxCode, row.workcenter, optionName, row.Sum);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public Nightlight(string paramFilePath)
        {
            string optionName = this.GetType().Name;
            var    dt         = ConvertCSVtoDataTable(paramFilePath);

            var newSort = (from row in dt.AsEnumerable()

                           group row by new
            {
                ID = row.Field <string>("Fixture Type"),


                Workcenter = row.Field <string>("Work Center")
            } into grp
                           //orderby grp.Key
                           select new
            {
                Fixture = grp.Key.ID,

                workcenter = grp.Key.Workcenter,
                Sum = grp.Sum(r => Double.Parse(r.Field <string>("Time(min)")))
            }).ToList();


            using (var db = new TimeContext())
            {
                foreach (var row in newSort)
                {
                    FixtureTB.AddInstance(row.Fixture, row.workcenter);
                    OptionTB.AddInstance(optionName, row.Sum);

                    FixtureTB.AddOption(row.Fixture, row.workcenter, optionName, row.Sum);
                }
            }
        }
Ejemplo n.º 3
0
        public Remo(string paramFilePath)
        {
            string optionName = this.GetType().Name;
            var    dt         = ConvertCSVtoDataTable(paramFilePath);
            var    newSort    = (from row in dt.AsEnumerable()

                                 group row by new
            {
                Workcenter = row.Field <string>("Work Center")
            } into grp
                                 select new
            {
                workcenter = grp.Key.Workcenter,

                Sum = grp.Sum(r => Double.Parse(r.Field <string>("Time(min)")))
            }).ToList();

            foreach (var row in newSort)
            {
                using (var db = new TimeContext())
                {
                    foreach (var fixture in db.Fixtures.Where(r => r.WorkCenter == row.workcenter))
                    {
                        FixtureTB.AddOption(fixture.FxCode, row.workcenter, optionName, row.Sum);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public DustCover(string paramFilePath)
        {
            string optionName = this.GetType().Name;
            var    dt         = ConvertCSVtoDataTable(paramFilePath);
            var    newSort    = (from row in dt.AsEnumerable()

                                 group row by new
            {
                Length = row.Field <string>("Length"),

                Workcenter = row.Field <string>("Work Center")
            } into grp
                                 //orderby grp.Key
                                 select new
            {
                length = Int32.Parse(grp.Key.Length),
                workcenter = grp.Key.Workcenter,

                Sum = grp.Sum(r => Double.Parse(r.Field <string>("Time (min)")))
            }).ToList();

            foreach (var row in newSort)
            {
                OptionTB.AddInstance(optionName, row.Sum, row.length);
                using (var db = new TimeContext())
                {
                    foreach (var fixture in db.Fixtures)
                    {
                        FixtureTB.AddOption(fixture.FxCode, row.workcenter, optionName, row.Sum, row.length);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public CB(string paramFilePath)
        {
            string optionName = this.GetType().Name;
            var    dt         = ConvertCSVtoDataTable(paramFilePath);
            var    newSort    = (from row in dt.AsEnumerable()

                                 group row by new
            {
                ID = row.Field <string>("Fixture Type"),

                Workcenter = row.Field <string>("Work Center"),
                LampQty = row.Field <string>("Lamp Qty")
            } into grp
                                 //orderby grp.Key
                                 select new
            {
                ID = grp.Key.ID,
                LampQty = grp.Key.LampQty,
                workcenter = grp.Key.Workcenter,

                Sum = grp.Sum(r => Double.Parse(r.Field <string>("Time(min)")))
            }).ToList();

            foreach (var row in newSort)
            {
                FixtureTB.AddInstance(row.ID, row.workcenter);
                OptionTB.AddInstance(optionName, row.Sum);
                ParametersTB.AddInstance("LampQty", row.LampQty);
                OptionTB.AddParam(optionName, row.Sum, "LampQty", row.LampQty);
                FixtureTB.AddOption(row.ID, row.workcenter, optionName, row.Sum);
            }
        }
Ejemplo n.º 6
0
        public ExitW(string paramFilePath)
        {
            string optionName = this.GetType().Name;
            var    dt         = ConvertCSVtoDataTable(paramFilePath);
            var    newSort    = (from row in dt.AsEnumerable()

                                 group row by new
            {
                ID = row.Field <string>("Fixture Type"),
                Section = row.Field <string>("Section"),
                Circtuit = row.Field <string>("Circuit"),
                Ballast = row.Field <string>("Kind Of Ballast/Driver"),

                Workcenter = row.Field <string>("Work Center")
            } into grp
                                 select new
            {
                fixture = grp.Key.ID,
                Section = grp.Key.Section,
                Circtuit = grp.Key.Circtuit,
                workcenter = grp.Key.Workcenter,
                Ballast = grp.Key.Ballast,

                Sum = grp.Sum(r => Double.Parse(r.Field <string>("Time (min)")))
            }).ToList();


            foreach (var row in newSort)
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("Section", row.Section);
                parameters.Add("Circuit", row.Circtuit);
                parameters.Add("Ballast", row.Ballast);


                FixtureTB.AddInstance(row.fixture, row.workcenter);
                OptionTB.AddInstance(optionName, row.Sum);



                foreach (var instace in parameters)
                {
                    ParametersTB.AddInstance(instace.Key, instace.Value);
                    OptionTB.AddParam(optionName, row.Sum, instace.Key, instace.Value);
                }

                FixtureTB.AddOption(row.fixture, row.workcenter, optionName, row.Sum);
            }
        }
Ejemplo n.º 7
0
        public PowerC(string paramFilePath)
        {
            string optionName = this.GetType().Name;
            var    dt         = ConvertCSVtoDataTable(paramFilePath);
            var    newSort    = (from row in dt.AsEnumerable()

                                 group row by new
            {
                Section = row.Field <string>("Section"),
                Circtuit = row.Field <string>("Circuit"),
                Ballast = row.Field <string>("Kind Of Ballast/Driver"),
                length = row.Field <string>("Length"),
                Workcenter = row.Field <string>("Work Center")
            } into grp
                                 select new
            {
                Section = grp.Key.Section,
                Circtuit = grp.Key.Circtuit,
                workcenter = grp.Key.Workcenter,
                Ballast = grp.Key.Ballast,
                length = grp.Key.length,
                Sum = grp.Sum(r => Double.Parse(r.Field <string>("Total Time (min)")))
            }).ToList();

            foreach (var row in newSort)
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("Section", row.Section);
                parameters.Add("Circuit", row.Circtuit);
                parameters.Add("Ballast", row.Ballast);
                int length = Int32.Parse(row.length);

                OptionTB.AddInstance(optionName, row.Sum, length);


                foreach (var instace in parameters)
                {
                    ParametersTB.AddInstance(instace.Key, instace.Value);
                    OptionTB.AddParam(optionName, row.Sum, instace.Key, instace.Value, length);
                }
                using (var db = new TimeContext())
                {
                    foreach (var fixture in db.Fixtures.Where(r => r.WorkCenter == row.workcenter))
                    {
                        FixtureTB.AddOption(fixture.FxCode, row.workcenter, optionName, row.Sum, length);
                    }
                }
            }
        }
Ejemplo n.º 8
0
        public OpTest(string paramFilePath)
        {
            string optionName = this.GetType().Name;
            var    dt         = ConvertCSVtoDataTable(paramFilePath);

            var newSort = (from row in dt.AsEnumerable()

                           group row by new
            {
                ID = row.Field <string>("Fixture Type"),
                light = row.Field <string>("Lighting"),
                citcuit = row.Field <string>("Circuit"),
                LampQty = row.Field <string>("Lamp/Cartridge Qty"),
                Length = row.Field <string>("Length"),
                Workcenter = row.Field <string>("Work Center")
            } into grp
                           //orderby grp.Key
                           select new
            {
                Fixture = grp.Key.ID,
                light = grp.Key.light,
                circuit = grp.Key.citcuit,
                lampQty = grp.Key.LampQty,
                length = Int32.Parse(grp.Key.Length),
                workcenter = grp.Key.Workcenter,
                Sum = grp.Sum(r => Double.Parse(r.Field <string>("Time (min)")))
            }).ToList();



            foreach (var row in newSort)
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                FixtureTB.AddInstance(row.Fixture, row.workcenter);
                OptionTB.AddInstance(optionName, row.Sum, row.length);
                parameters.Add("Circuit", row.circuit);
                parameters.Add("LampQty", row.lampQty);
                parameters.Add("Light", row.light);
                foreach (var value in parameters)
                {
                    ParametersTB.AddInstance(value.Key, value.Value);
                    OptionTB.AddParam(optionName, row.Sum, value.Key, value.Value, row.length);
                }

                FixtureTB.AddOption(row.Fixture, row.workcenter, optionName, row.Sum);
            }
        }