public JsonResult GetScrimTypeResult() { List <ScrimTypeModel> model = new List <ScrimTypeModel>(); using (ScrimTypeService svc = new ScrimTypeService()) { var dtos = svc.GetAll(); model.AddRange(Mapper.Map <List <ScrimTypeDto>, List <ScrimTypeModel> >(dtos)); } return(Json(model, JsonRequestBehavior.AllowGet)); }
private void GetRollTypesList() { List <ScrimTypeDto> dtos = new List <ScrimTypeDto>(); using (ScrimTypeService service = new ScrimTypeService()) { dtos.AddRange(service.GetAll()); } ViewBag.ScrimType = new SelectList(dtos.Select(s => new { ID = s.ID, Description = string.Format("{0} | {1}", s.Code, s.Description) }).ToList(), "ID", "Description"); // return RedirectToAction("Details", new { id = model.Id }); }
////needs work //public CurrentScrimViewModel CurrentScrimViewModelViewModel_Get(int? ID) //{ // ScrimTypeService scrimTypeBL = new ScrimTypeService(); // List<ScrimTypeDto> scrimTypes = scrimTypeBL.GetAll(); // scrimTypes.Insert(0, new ScrimTypeDto() { Code = "N/A" }); // GetRollTypesList(); // ViewBag.ScrimRoll = new SelectList(new List<TPOCurrentScrimModel>()); // ProductionLineService prodLineBL = new ProductionLineService(); // List<ProductionLinesDto> lines = prodLineBL.GetAll(); // ViewBag.ProductionLine = new SelectList(lines, "Code", "Code"); // TPOCurrentScrimService bl = new TPOCurrentScrimService(); // CurrentScrimViewModel model = new CurrentScrimViewModel(); // TPOCurrentScrimDto tpoCurrentModel = bl.Get(ID != null ? ID.Value : 0); // if (tpoCurrentModel == null) // { // tpoCurrentModel = new TPOCurrentScrimDto(); // model.TPOCurrentScrim = tpoCurrentModel; // } // else // { // model.TPOCurrentScrim = tpoCurrentModel; // } // model.LineID = ID.ToString(); // // TODO: refactor this area // //List<TPOCurrentRawMaterialDto> currentDTOList = GetRawMaterailListing(model.LineID); // //if (!currentDTOList.Any()) // //{ // // currentDTOList = new List<TPOCurrentRawMaterialDto>(); // // model.CurrentRawMaterialList = currentDTOList; // //} // //else // //{ // // model.CurrentRawMaterialList = currentDTOList; // //} // //if (!model.CurrentRawMaterialList.Any()) // //{ // // model.CurrentRawMaterial = new TPOCurrentRawMaterialDto(); // // // TODO: Refactor this area // // //model.CurrentRawMaterial.LineID = "1"; // // //model.TPOCurrentScrim.LineID = "1"; // //} // //else // //{ // // model.CurrentRawMaterialList = currentDTOList; // //} // return model; //} private void GetRollTypesList() { ScrimTypeService stBL = new ScrimTypeService(); ViewBag.ScrimType = new SelectList(stBL.GetAll().Select(s => new { ID = s.ID, Description = string.Format("{0} | {1}", s.Code, s.Description) }).ToList(), "ID", "Description"); }