示例#1
0
        public ActionResult Detail(Guid id)
        {
            var item  = _service.GetById(id);
            var model = new CreateStandardGeneticLineForm()
            {
                StandardGeneticLine = item
            };

            model.GenerateItems();
            return(View(model));
        }
示例#2
0
        public ActionResult Create(CreateStandardGeneticLineForm form, FormCollection collection)
        {
            if (!ModelState.IsValid)
            {
                ViewBag.Operation = "Create";
                return(View(form).WithError("Se ha producido un error. Por favor valide que los datos ingresados sean correctos"));
            }
            form.StandardGeneticLine.Standard.AllowDecimal = collection["StandardGeneticLine.Standard.AllowDecimal"] == "True";
            StandardGeneticLine item = form.ToStandardGeneticLine();

            _service.Create(item);
            return(Redirect("/StandardGeneticLine/Index/" + form.StandardGeneticLine.GeneticLine.Id).WithSuccess("El estandar se ha creado correctamente"));
        }
示例#3
0
        public ActionResult Edit(Guid id)
        {
            var item = _service.GetById(id);

            ViewBag.Operation = "Edit";

            var model = new CreateStandardGeneticLineForm()
            {
                StandardGeneticLine = item,
            };

            model.GenerateItems();
            return(View("Create", model));
        }
示例#4
0
        public ActionResult Create(Guid geneticLineId, Guid standardId)
        {
            var geneticLine = _geneticLineService.GetById(geneticLineId);
            var standard    = _standardService.GetById(standardId);

            ViewBag.Operation = "Create";

            var model = new CreateStandardGeneticLineForm()
            {
                StandardGeneticLine = new StandardGeneticLine()
                {
                    GeneticLine = geneticLine,
                    Standard    = standard
                }
            };

            model.GenerateItems();
            return(View(model));
        }