public async Task <ActionResult> ProjectInfo()
        {
            GDFService _svc = new GDFService();
            var        ret  = await _svc.LoginAsync(Session["user"].ToString(), Session["pass"].ToString());

            if (!ret)
            {
                return(null);
            }
            //var id = Convert.ToInt32(Session["id"]);
            var proj = await _svc.GetProjectAsync(Convert.ToInt32(Session["id"]));

            //Project proj = new Project(Session["name"].ToString());

            if (proj == null)
            {
                ViewBag("There is no data in the system!");
            }
            else
            {
                List <StationActivity> stationActivities = new List <StationActivity>(proj.StationActivities);


                List <StationActivity_View> stationActivity_Views = new List <StationActivity_View>();



                foreach (var p in stationActivities)
                {
                    StationActivity_View activity_View = new StationActivity_View();
                    activity_View.Worktime              = p.Worktime;
                    activity_View.Dispersion            = p.Dispersion;
                    activity_View.Position              = p.Position;
                    activity_View.Activation            = p.Activation;
                    activity_View.Behavior              = p.Behavior;
                    activity_View.ShowToolingActivities = p.ShowToolingActivities;


                    stationActivity_Views.Add(activity_View);
                }    //end of foreach

                return(View(stationActivity_Views));
            } //end of else
            return(null);
        }     //end of project info
        public async Task <ActionResult> Product(string name)
        {
            GDFService _svc = new GDFService();
            var        ret  = await _svc.LoginAsync(Session["user"].ToString(), Session["pass"].ToString());

            if (!ret)
            {
                return(null);
            }

            var proj = await _svc.GetProjectAsync(Convert.ToInt32(Session["id"]));



            if (proj == null)
            {
                ViewBag("There is no data in the system!");
            }
            else
            {
                List <StationActivity> stationActivities = new List <StationActivity>(proj.StationActivities);

                StationActivity stationActivity = new StationActivity();

                List <Product> products = new List <Product>();

                List <Product_View> product_Views = new List <Product_View>();

                List <StationActivity_View> stationActivities_Views = new List <StationActivity_View>();
                StationActivity_View        stationActivity_View    = new StationActivity_View();

                foreach (var p in stationActivities)
                {
                    Product_View product = new Product_View();

                    product.Name = p.Product.Name;
                    product.Desc = p.Product.Desc;
                    product_Views.Add(product);
                }//end of foreach

                return(View(product_Views));
            }//end of else

            return(null);
        }//end of project info
Exemple #3
0
        public async Task <ActionResult> Input()
        {
            GDFService _svc = new GDFService();
            var        ret  = await _svc.LoginAsync(Session["user"].ToString(), Session["pass"].ToString());

            if (!ret)
            {
                return(null);
            }

            var proj = await _svc.GetProjectAsync(Convert.ToInt32(Session["id"]));



            if (proj == null)
            {
                ViewBag("There is no data in the system!");
            }
            else
            {
                List <StationActivity> stationActivities = new List <StationActivity>(proj.StationActivities);

                StationActivity stationActivity = new StationActivity();

                List <Process> processes = new List <Process>();

                List <Process_View> process_Views = new List <Process_View>();

                List <StationActivity_View> stationActivities_Views = new List <StationActivity_View>();
                StationActivity_View        stationActivity_View    = new StationActivity_View();

                List <InOut_View> inOut_Views = new List <InOut_View>();

                foreach (var p in stationActivities)
                {
                    Process process = new Process();

                    process = p.Process;
                    processes.Add(process);



                    //Define station object
                    Process_View process_View = new Process_View();

                    foreach (var ele in processes)
                    {
                        //Define a list of InOut Objects
                        List <InOut> inputs = new List <InOut>(ele.Inputs);

                        //Define a list of InOut_View Objects
                        List <InOut_View> input_Views = new List <InOut_View>();
                        foreach (var inp in inputs)
                        {
                            List <Material> materials = new List <Material>(inp.Materials);

                            List <Material_View> material_Views = new List <Material_View>();

                            foreach (var m in materials)
                            {
                                Material_View material_View = new Material_View();
                                material_View.Production = m.Production;
                                material_View.Quantity   = m.Quantity;

                                material_Views.Add(material_View);
                            }

                            return(View(material_Views));
                        }


                        //  List<InOut> outputs = new List<InOut>(ele.Outputs);
                    }

                    process_Views.Add(process_View);
                }//end of foreach

                return(View(process_Views));
            }//end of else

            return(null);
        }//end of project info
        public async Task <ActionResult> ToolingActivity()
        {
            GDFService _svc = new GDFService();
            var        ret  = await _svc.LoginAsync(Session["user"].ToString(), Session["pass"].ToString());

            if (!ret)
            {
                return(null);
            }

            var proj = await _svc.GetProjectAsync(Convert.ToInt32(Session["id"]));



            if (proj == null)
            {
                ViewBag("There is no data in the system!");
            }
            else
            {
                List <StationActivity> stationActivities = new List <StationActivity>(proj.StationActivities);

                StationActivity stationActivity = new StationActivity();



                List <ToolingActivity_View> tooling_Views = new List <ToolingActivity_View>();

                List <StationActivity_View> stationActivities_Views = new List <StationActivity_View>();
                StationActivity_View        stationActivity_View    = new StationActivity_View();

                foreach (var p in stationActivities)
                {
                    ToolingActivity tooling = new ToolingActivity();

                    List <ToolingActivity> toolings = new List <ToolingActivity>(p.ToolingActivities);

                    foreach (var t in toolings)
                    {
                        //Define tooling object
                        ToolingActivity_View tool_View = new ToolingActivity_View();

                        tool_View.Activation     = t.Activation;
                        tool_View.Condition      = t.Condition;
                        tool_View.Behavior       = t.Behavior;
                        tool_View.Headcount      = t.Headcount;
                        tool_View.Quantity       = t.Quantity;
                        tool_View.Worktime       = t.Worktime;
                        tool_View.WorkerBehavior = t.WorkerBehavior;
                        tool_View.Operation      = t.Operation;



                        tooling_Views.Add(tool_View);
                    } //end of foreach tooling activity
                }     //end of foreach

                return(View(tooling_Views));
            } //end of else
            return(null);
        }     //end of project info
Exemple #5
0
        public async Task <ActionResult> Station()
        {
            GDFService _svc = new GDFService();
            var        ret  = await _svc.LoginAsync(Session["user"].ToString(), Session["pass"].ToString());

            if (!ret)
            {
                return(null);
            }

            var proj = await _svc.GetProjectAsync(Convert.ToInt32(Session["id"]));



            if (proj == null)
            {
                ViewBag("There is no data in the system!");
            }
            else
            {
                List <StationActivity> stationActivities = new List <StationActivity>(proj.StationActivities);

                StationActivity stationActivity = new StationActivity();

                List <Station> stations = new List <Station>();

                List <Station_View> stations_Views = new List <Station_View>();

                List <StationActivity_View> stationActivities_Views = new List <StationActivity_View>();
                StationActivity_View        stationActivity_View    = new StationActivity_View();

                foreach (var p in stationActivities)
                {
                    Station station = new Station();

                    station = p.Station;
                    stations.Add(station);


                    //Define station object
                    Station_View station_View = new Station_View();

                    station_View.H = station.H;
                    station_View.InputBufferSize  = station.InputBufferSize;
                    station_View.OutputBufferSize = station.OutputBufferSize;
                    station_View.TotalBufferSize  = station.TotalBufferSize;
                    station_View.X    = station.X;
                    station_View.Y    = station.Y;
                    station_View.Name = station.Name;


                    stations_Views.Add(station_View);

                    stations.Add(station);

                    //stationActivities.Add(stationActivity);

                    // stationActivities_Views.Add(stationActivity_View);
                }//end of foreach
                return(View(stations_Views));
                // return View(stationActivities_Views);
            } //end of else
            return(null);
        }     //end of project info
        public async Task <ActionResult> Process()
        {
            GDFService _svc = new GDFService();
            var        ret  = await _svc.LoginAsync(Session["user"].ToString(), Session["pass"].ToString());

            if (!ret)
            {
                return(null);
            }

            var proj = await _svc.GetProjectAsync(Convert.ToInt32(Session["id"]));



            if (proj == null)
            {
                ViewBag("There is no data in the system!");
            }
            else
            {
                List <StationActivity> stationActivities = new List <StationActivity>(proj.StationActivities);

                StationActivity stationActivity = new StationActivity();

                List <Process> processes = new List <Process>();

                List <Process_View> process_Views = new List <Process_View>();

                List <StationActivity_View> stationActivities_Views = new List <StationActivity_View>();
                StationActivity_View        stationActivity_View    = new StationActivity_View();

                foreach (var p in stationActivities)
                {
                    Process process = new Process();

                    process = p.Process;
                    processes.Add(process);


                    //Define station object
                    Process_View process_View = new Process_View();

                    process_View.Desc          = process.Desc;
                    process_View.Disabled      = process.Disabled;
                    process_View.Frequency     = process.Frequency;
                    process_View.InputProcess  = process.InputProcess;
                    process_View.IsFinal       = process.IsFinal;
                    process_View.Name          = process.Name;
                    process_View.OutputProcess = process.OutputProcess;
                    process_View.Setup         = process.Setup;
                    process_View.Worktime      = process.Worktime;
                    process_View.X             = process.X;
                    process_View.Y             = process.Y;

                    /*foreach(var ele in processes)
                     * {
                     *  Product_View product = new Product_View();
                     *  product.Name = ele.Product.Name;
                     * }*/

                    process_Views.Add(process_View);
                }//end of foreach

                return(View(process_Views));
            }//end of else

            return(null);
        }//end of project info