예제 #1
0
        public ActionResult Index(CountryViewModel model, string submit_Country, string submit_State, string submit_City)
        {
            try
            {
                if (submit_Country != (null))
                {
                    //entity.InsertUpdateSelectAdmin(0, model.Name, model.Address, model.MobileNo, model.EmailId, model.gender, model.dob, model.countryId, model.stateId, model.cityId, 1, true);
                    entity.InsertUpdateSelectCountry(0, model.countryName, true, 1);
                }
                else if (submit_State != (null))
                {
                    entity.InsertUpdateSelectState(0, model.stateName, true, 1, model.countryId);
                }
                else if (submit_City != (null))
                {
                    entity.InsertUpdateSelectCity(0, model.cityName, true, 1, model.countryId2, model.stateId);
                }

                //entity.InsertUpdateSelectCountry(0, model.countryName, true, 1);
                ViewBag.CountryDd = new SelectList(entity.countries.Where(models => models.Active == true), "countryId", "countryName");
                ViewBag.stateDd   = new SelectList(entity.states.Where(models => models.Active == true), "stateId", "stateName");
                ViewBag.cityDd    = new SelectList(entity.cities.Where(models => models.Active == true), "cityId", "cityName");
                ViewBag.alert     = "Success";
            }
            catch (Exception e1)
            {
                ViewBag.alert = "Error";
            }
            return(View());
        }