public ActionResult MobilAdd(FormCollection frm) { strApiSandBox = frm["ApiSandBox"].ToString(); Auth.cSettings[0].Demo = strApiSandBox; if (ModelState.IsValid) { if (Auth.GetAccesToken(strApiSandBox, out strMessage)) { Auth.cSettings[0].Hydro_ID = frm["HydroID"].ToString(); if (Auth.AutAdd(Auth.cSettings[0].Hydro_ID, strApiSandBox, out strMessage)) { Auth.cSettings[0].Message = strMessage; ViewBag.Message = Auth.cSettings[0].Message; return(RedirectToAction("MobilAuth")); } else { Auth.cSettings[0].ErrorMessage = strMessage; return(RedirectToAction("MobilAdd")); } } else { return(View()); } } return(View()); }