//old way - fake data, no repo, no service
        public ActionResult WorkCenter2(string workCenterGroup, string workCenterId)
        {
            var model = new WorkCenterDisplayModel();
            model.WorkCenterGroup = workCenterGroup;
            model.WorkCenterId = workCenterId;
            switch (workCenterGroup)
            {
                case "Milling":
                case "Slitting":
                    model.TabModel.multiSelect = false;
                    break;
                case "Annealing":
                    model.TabModel.multiSelect = true;
                    break;
            }

            //model = CreateWorkCenterModel(model);

            if (workCenterGroup == "Slitting")
            {
                model.WorkCenterJob[0].Operation = "SLTF";
                model.WorkCenterJob[1].Operation = "SLTF";
                model.WorkCenterJob[2].Operation = "SLTSTR";
            }

            return View(workCenterGroup, model);
        }
 //new way - fake data, USES repo/services/automapper
 public ActionResult Display(string workCenterGroup, string WorkCenterId)
 {
     var jobs = workCenterService.GetJobsForWorkCenter(WorkCenterId,workCenterGroup);
     var model = new WorkCenterDisplayModel(workCenterGroup,WorkCenterId);
     model.TabModel.ActivityDropdowns = workCenterService.GetWorkCenterActivityList(workCenterGroup);
     model.TabModel.multiSelect = workCenterGroup == "Annealing";
     foreach (var job in jobs)
     {
         model.WorkCenterJob.Add(Mapper.Map<WorkCenterJob, WorkCenterGridModel>(job));
     }
     return View(workCenterGroup, model);
 }
        public ActionResult Display(string workCenterGroup, string WorkCenterId)
        {
            workCenterGroup = workCenterService.DetermineWorkCenterGroup(workCenterGroup);
            var jobs = workCenterService.GetJobsForWorkCenter(WorkCenterId, workCenterGroup);
            var model = new WorkCenterDisplayModel(workCenterGroup, WorkCenterId);
            model.TabModel.multiSelect = workCenterGroup == "Annealing";
            model.TabModel.ActivityDropdowns = workCenterService.GetWorkCenterActivityList(workCenterGroup);

            foreach (var job in jobs)
            {
                model.WorkCenterJob.Add(Mapper.Map<WorkCenterJob, WorkCenterGridModel>(job));
                model.JobGroups.Add(job.RouteId);
            }

            var newModel = new List<WorkCenterDisplayModel>(){model};
            /*for (int i = 0; i < 4; i++)
            {
                model.WorkCenterId = model.WorkCenterId + "-" + i;
                newModel.Add(model);
            }
             * */
            return View(workCenterGroup, newModel);
        }
Exemple #4
0
        /*
         * Put this functionality into the view - probably better there.
         *
         *
        public static string OutputAttributeTableSection(this HtmlHelper helper, WorkCenterDisplayModel model)
        {
            var output = new StringBuilder();
            foreach(var mod in model.WorkCenterJob.ToList())
            {
               // output.AppendFormat("<tr><td colspan=\"3\" >{0}</td></tr>", mod.Id);
                output.AppendFormat("<tr><td>Grade</td><td>{0}</td><td>{1}</td></tr>", mod.Grade, mod.Id);
                output.AppendFormat("<tr><td>Grain</td><td>{0}</td><td>{1}</td></tr>", mod.Grain,mod.Id);
                output.AppendFormat("<tr><td>Surface</td><td>{0}</td><td>{1}</td></tr>", mod.Surface,mod.Id);
                output.AppendFormat("<tr><td>Alloy</td><td>{0}</td><td>{1}</td></tr>", mod.ReservedCoilAlloy,mod.Id);
                output.AppendFormat("<tr><td>Temper</td><td>{0}</td><td>{1}</td></tr>", mod.ReservedCoilTemper,mod.Id);
                output.AppendFormat("<tr><td>Width</td><td>{0}</td><td>{1}</td></tr>", mod.ReservedCoilWidth,mod.Id);
                output.AppendFormat("<tr><td>Gauge</td><td>{0}</td><td>{1}</td></tr>", mod.ReservedCoilGauge,mod.Id);
                output.AppendFormat("<tr><td>OD</td><td>{0}</td><td>{1}</td></tr>", mod.ReservedCoilOD,mod.Id);
            }

            return output.ToString();
        }
         *
         */
        /*
         * Put this functionality into the view - probably better there.
         *
         *
        public static string OutputNotesTableSection(this HtmlHelper helper, WorkCenterDisplayModel model,
                                                    string imgClass = "img-to-print",
                                                    string classFirst = "show",
                                                    string classNext = "hide",
                                                    bool showPrint = true)
        {
            var output = new StringBuilder();

            foreach (var mod in model.WorkCenterJob.ToList())
            {
                var imgPosClass = classFirst;
                output.AppendFormat("<tr><td>{0}</td><td>{1}</td><td><div id=\"image-container-{2}\">",mod.NoteId, mod.NoteText,mod.Id);
                int i = 0;
                for(; i < mod.NoteImages.Count(); i++) {
                    var img = mod.NoteImages[i];
                    output.AppendFormat("<a href=\"{0}\" class=\"lightbox\" title=\"{3}\" rel=\"lightbox[{4}]\"><img src=\"{0}\" class=\"{1} {2}\" title=\"{3}\" /></a>",img.Url,imgClass, imgPosClass,img.Caption, mod.Id);

                    if(i == 0)
                        imgPosClass= classNext;
                }
                if (i > 0)
                    output.AppendFormat("</div><p><a href=\"#\" class=\"print-all-lightbox\" rel=\"image-container-{0}\">Print All Images</a></p>",mod.Id);

                output.AppendFormat("</td><td>{0}</td></tr>",mod.Id);

            }
            return output.ToString();
        }
         *
         */
        public static string OuputCutPlanSection(this HtmlHelper helper, WorkCenterDisplayModel model)
        {
            var output = new StringBuilder();
            return null;
        }
Exemple #5
0
        public ActionResult TestAnnealingScreens(string workCenterGroup, string WorkCenterId)
        {
            workCenterGroup = workCenterService.DetermineWorkCenterGroup(workCenterGroup);
            var jobs = workCenterService.GetJobsForWorkCenter(WorkCenterId, workCenterGroup);
            var model = new WorkCenterDisplayModel(workCenterGroup, WorkCenterId);
            model.TabModel.multiSelect = workCenterGroup == "Annealing";
            model.TabModel.ActivityDropdowns = workCenterService.GetWorkCenterActivityList(workCenterGroup);

            foreach (var job in jobs)
            {
                model.WorkCenterJob.Add(Mapper.Map<WorkCenterJob, WorkCenterGridModel>(job));
                model.JobGroups.Add(job.RouteId);
            }
            return View(model);
        }
        public ActionResult Slitting(string id)
        {
            var workCenterGroup = "Slitting";
            var jobs = workCenterService.GetJobsForWorkCenter(id,workCenterGroup);

            var model = new WorkCenterDisplayModel(workCenterGroup, id);
            model.TabModel.ActivityDropdowns = workCenterService.GetWorkCenterActivityList(workCenterGroup);
            model.TabModel.multiSelect = false;
            foreach (var job in jobs)
            {
                model.WorkCenterJob.Add(Mapper.Map<WorkCenterJob, WorkCenterGridModel>(job));
            }
            return View(workCenterGroup, model);
        }