public JsonResult GetAllProductionShiftDefaults(int lineId)
        {
            List <ProductionShiftUseModel> productionShiftUse = new List <ProductionShiftUseModel>();

            using (ProductionShiftUseService service = new ProductionShiftUseService())
            {
                var dto = service.GetAllByLineId(lineId);
                productionShiftUse.AddRange(Mapper.Map <List <ProductionShiftUseDto>, List <ProductionShiftUseModel> >(dto));
                productionShiftUse.AddRange(AddMissingShifts(dto, lineId));
            }
            return(Json(productionShiftUse, JsonRequestBehavior.AllowGet));
        }
        public JsonResult SetProductionLineSchedule(int lineId, string startDate)
        {
            TPO.Web.Core.ResponseMessage responseMessage;

            try
            {
                using (ProductionShiftUseService service = new ProductionShiftUseService())
                {
                    var dtos = service.GetAllByLineId(lineId);
                    foreach (var dto in dtos)
                    {
                        service.SetProductionLineSchedule(dto, startDate);
                    }
                }

                responseMessage = SetResponseMesssage(ActionTypeMessage.SuccessfulSave);
            }
            catch (Exception exc)
            {
                responseMessage = SetResponseMesssage(ActionTypeMessage.FailedSave, exc.Message);
            }

            return(Json(responseMessage, JsonRequestBehavior.AllowGet));
        }