Example #1
0
        public ActionResult DeleteCountry(int id)
        {
            CountryOperator country = new CountryOperator();

            country.Edit(id);
            return(View(country));
        }
Example #2
0
        public ActionResult AddCountry()
        {
            CountryOperator country = new CountryOperator();

            country.Add();
            return(View(country));
        }
Example #3
0
        public ActionResult CountryList(string search = null)
        {
            CountryOperator        country = new CountryOperator();
            List <CountryListView> list    = country.Search(search);

            return(View(list));
        }
Example #4
0
 public ActionResult EditCountry(int id, CountryOperator country)
 {
     if (!ModelState.IsValid)
     {
         ViewBag.ErrorMessage = "Form data is not proper.";
         return(View(country));
     }
     country.Update();
     return(RedirectToAction("CountryList"));
 }
Example #5
0
 public ActionResult AddCountry(CountryOperator model)
 {
     ViewBag.ErrorMessage = String.Empty;
     if (!ModelState.IsValid)
     {
         ViewBag.ErrorMessage = "Form data is not proper.";
         return(View(model));
     }
     model.Update();
     return(RedirectToAction("CountryList"));
 }
Example #6
0
 public ActionResult DeleteCountry(int id, CountryOperator country)
 {
     country.Delete(id);
     return(RedirectToAction("CountryList"));
 }