protected virtual IScriptView Login(ScriptView view) { var form = view.GetElement <FormSE>("loginForm"); var data = form.Data; data["ip"] = HttpContext.Current.Request.UserHostAddress; var success = SignIn(data); if (success) { view.Redirect(this.SuccessUrl); } else { view.WriteCode(string.Format("loginForm.proxy().showError('{0}');", Strings.WrongUserNamePassword)); } return(view); }
protected virtual IScriptView Login(ScriptView view) { var form = view.GetElement <FormSE>("loginForm"); var data = form.Data; data["ip"] = HttpContext.Current.Request.UserHostAddress; var handler = ModuleController.GetHandler("login"); DTObject dto = handler.Process(data); var success = dto.GetValue <bool>("success"); if (success) { form.Reset(); view.Redirect(this.SuccessUrl); } else { view.GetElement("alertText").SetText(Strings.WrongUserNamePassword); view.GetElement("alert").Visible(); } return(view); }