예제 #1
0
        public ActionResult Edit(FormCollection formCollection)
        {
            //clsState objState = new clsState();
            StateModel objStateModel = new StateModel();

            objStateModel.StateID      = Convert.ToInt32(formCollection["StateID"]);
            objStateModel.StateName    = formCollection["StateName"];
            objStateModel.RefCountryID = Convert.ToInt32(formCollection["RefCountryID"]);
            objStateModel.AddEditState(objStateModel, clsCommon.Update);


            return(RedirectToAction("Index", "State"));
        }
예제 #2
0
        public ActionResult Create(StateModel objStateModel)
        {
            if (ModelState.IsValid)
            {
                //clsState objState = new clsState();
                TryUpdateModel <StateModel>(objStateModel);
                objStateModel.AddEditState(objStateModel, clsCommon.Insert);
                return(RedirectToAction("Index"));
            }
            else
            {
                CountryModel objCountry = new CountryModel();
                objStateModel.countryList = objCountry.GetCountryList().ToList();

                objStateModel.stateList = objStateModel.GetStateList().ToList();

                return(View(objStateModel));
            }
        }