public JsonResult GetAllProductionShiftTypes() { List <ProductionShiftTypeModel> productionShiftTypes = new List <ProductionShiftTypeModel>(); using (ProductionShiftTypeService svc = new ProductionShiftTypeService()) { var dtos = svc.GetAll(); productionShiftTypes.AddRange(Mapper.Map <List <ProductionShiftTypeDto>, List <ProductionShiftTypeModel> >(dtos)); } return(Json(productionShiftTypes, JsonRequestBehavior.AllowGet)); }
private ProductionShiftTypeModel GetDefaultProductionShiftType() { ProductionShiftTypeModel productionShiftType = new ProductionShiftTypeModel(); using (ProductionShiftTypeService svc = new ProductionShiftTypeService()) { var dto = svc.GetAll().FirstOrDefault(); productionShiftType = Mapper.Map <ProductionShiftTypeDto, ProductionShiftTypeModel>(dto); } return(productionShiftType); }
private string LookupShiftTypeCode(int ID) { ProductionShiftTypeModel productionShiftType = new ProductionShiftTypeModel() { Code = string.Empty }; using (ProductionShiftTypeService service = new ProductionShiftTypeService()) { var dto = service.Get(ID); productionShiftType = Mapper.Map <ProductionShiftTypeDto, ProductionShiftTypeModel>(dto); } return(productionShiftType.Code); }