Beispiel #1
0
        public ActionResult NewStateMaintenance(StateMaintenanceModel m)
        {
            bool success = true;

            WebView.WebService._base myWebService;
            myWebService = new WebService._base();

            bool selected = false;

            WebService._base.StateMaintenance newStateMain = new WebService._base.StateMaintenance();

            newStateMain.STATE_ID   = m.StateId;
            newStateMain.STATE_NAME = m.StateName;
            newStateMain.REGION_ID  = m.RegionId;
            success  = myWebService.AddStateMaintenance(newStateMain);
            selected = true;

            if (ModelState.IsValid && selected)
            {
                if (success == true)
                {
                    return(RedirectToAction("NewSave"));
                }
                else
                {
                    return(RedirectToAction("NewSaveFail")); // store to db failed.
                }
            }

            return(View(m));
        }