Esempio n. 1
0
        //
        // GET: /Contractor/Edit/Id
        public ActionResult Edit(int id = 0)
        {
            ContractorModel model = null;
            using (ContractorContext context = new ContractorContext())
            {
                model = context.GetContractor(id);
            }

            if (model == null)
            { return RedirectToAction("Index"); }
            // Физическо лице
            else if (model.ContractorTypeId == 1)
            { return View("EditPerson", model); }
            // // Юридическо лице
            else if (model.ContractorTypeId == 2)
            { return View("EditCompany", model); }
            else
            { return RedirectToAction("Index"); }
        }