Esempio n. 1
0
 public ActionResult Generate(MaterialSimulationViewModel model, ProductPlanViewModel mProductPlan)
 {
     if (!model.SimulationType.Equals(Constants.SimulationType.Material))
     {
         var productPlanViewModel = new ProductPlanViewModel();
         productPlanViewModel.From = model.From;
         productPlanViewModel.To   = model.To;
         //productPlanViewModel.Grid = GenerateGridProduct(model);
         productPlanViewModel.productName = _materialSimulationDomain.GetPreProductName(ConvertHelper.ConvertToDateTimeFull(model.From), ConvertHelper.ConvertToDateTimeFull(model.To));
         productPlanViewModel.LstPreProductPlanSimuItem =
             _materialSimulationDomain.GenerateProductPlan(ConvertHelper.ConvertToDateTimeFull(model.From),
                                                           ConvertHelper.ConvertToDateTimeFull(model.To),
                                                           model.InventoryUnderRetrieval.Equals(Constants.Choice.Yes),
                                                           model.AcceptedMaterialOnly.Equals(Constants.Choice.Yes),
                                                           model.MaterialUsedInOtherCommands.Equals(Constants.Choice.Yes));
         return(PartialView("MaterialSimulation/_PartialMaterialSimulationProductPlan", productPlanViewModel));
     }
     else
     {
         var result        = _materialSimulationDomain.GenerateMaterial(ConvertHelper.ConvertToDateTimeFull(model.From), ConvertHelper.ConvertToDateTimeFull(model.To), model.InventoryUnderRetrieval.Equals(Constants.Choice.Yes), model.AcceptedMaterialOnly.Equals(Constants.Choice.Yes), model.MaterialUsedInOtherCommands.Equals(Constants.Choice.Yes), model.SelectMaterial);
         var materialModel = new MaterialViewModel();
         materialModel.MaterialCode = model.SelectMaterial;
         var material = _materialDomain.GetById(model.SelectMaterial);
         materialModel.MaterialName = material != null?material.F01_MaterialDsp:"";
         materialModel.Chart        = result;
         return(PartialView("MaterialSimulation/_PartialViewMaterialSimulationMaterial", materialModel));
     }
 }
Esempio n. 2
0
        // GET: Master/MaterialSimulation
        public ActionResult Index()
        {
            var model = new MaterialSimulationViewModel()
            {
                Grid = GenerateGrid(), IsPlan = false,
            };

            return(View(model));
        }