Example #1
0
        public IActionResult Edit(LheForm lheForm)
        {
            if (ModelState.IsValid)
            {
                var module = new LesniHospodarskaEvidenceTableModule(db);
                var ev     = new LesniHospodarskaEvidence
                {
                    Datum             = lheForm.Datum,
                    Mnozstvi          = lheForm.Mnozstvi,
                    Plocha            = lheForm.Plocha,
                    Poznamka          = lheForm.Poznamka,
                    IdPorostniSkupina = "f6d514ef-f51f-4228-8bec-252c0113291f",
                    IdPodvykon        = "141_0",
                    IdDrevina         = "98B80C09988C407C855302ED924A59FC",
                    IdDruhTezby       = "AFE2719213AD4AFD8118C52654F8EE95",
                    Id = lheForm.Id
                };

                module.UpdateLhe(ev);
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(lheForm));
            }
        }
        public void EditButton_ClickCommand(object param)
        {
            var lhe = new LesniHospodarskaEvidence
            {
                Id = lheItem.Id,
                PorostniSkupina = psk,
                Datum           = this.Datum,
                Drevina         = this.Drevina,
                DruhTezby       = this.DruhTezby,
                Podvykon        = this.Podvykon,
                Mnozstvi        = this.Mnozstvi,
                Poznamka        = this.Poznamka,
                Plocha          = this.Plocha
            };

            lheTableModule.UpdateLhe(lhe);
            LheObserver.Instance.NotifyLheTableChanged();
            Close();
        }