public ActionResult Create()
 {
     var editViewModel = new EditViewModel
                             {
                                 ProvinceId = 0,
                                 ProvinceName = string.Empty,
                             };
     return View("Edit", editViewModel);
 }
        public ActionResult Save(EditViewModel editFormModel)
        {
            if (ModelState.IsValid)
            {
                _cantonsManagement.Save(editFormModel);
                return RedirectToAction("Index");
            }

            return View("Edit", editFormModel);
        }
 public ActionResult Edit(int id)
 {
     var cantonInformation = _cantonsManagement.GetProvince(id);
     var editViewModel = new EditViewModel
                             {
                                 ProvinceId = cantonInformation.ProvinceId,
                                 ProvinceName = cantonInformation.Name,
                             };
     return View(editViewModel);
 }
        public void Save(EditViewModel editViewModel)
        {
            var company = Map(editViewModel);

            if (editViewModel.ProvinceId.Equals(0))
            {
                AddCompany(company);
            }
            else
            {
                EditCompany(company);
            }
        }
 private static Province Map(EditViewModel editViewMode)
 {
     return new Province
                {
                    ProvinceId = editViewMode.ProvinceId,
                    Name = editViewMode.ProvinceName.ToUpper(),
                };
 }