Beispiel #1
0
 public void Logon(LogonViewModel model)
 {
     //HttpRequest req = context.Request;
        // _logonViewModel = _logonBinder.BindLogonViewModel(req);
        // _logonView.BilderHtml(_logonViewModel);
     _logonView.BilderHtml(model);
 }
Beispiel #2
0
 public AccountController()
 {
     _logonBinder = new LogonBinder();
     _logonViewModel = new LogonViewModel();
     _viewFactory = new ViewFactory();
     _logonView = _viewFactory.CreateView();
 }
Beispiel #3
0
 public void BilderHtml(LogonViewModel loginViewModel)
 {
     HttpContext.Current.Response.Write("<html>");
     HttpContext.Current.Response.Write("<body>");
     string password = String.Format("<h2> Password:{0} </h2>", loginViewModel.Password);
     string login = String.Format("<h2> Login:{0} </h2>", loginViewModel.Login);
     HttpContext.Current.Response.Write(password);
     HttpContext.Current.Response.Write(login);
     HttpContext.Current.Response.Write("</body>");
     HttpContext.Current.Response.Write("</html>");
 }
Beispiel #4
0
 public LogonViewModel BindLogonViewModel(HttpRequest httpRequest)
 {
     LogonViewModel userData = new LogonViewModel();
     if (httpRequest.Form["txtLogin"] != null)
     {
         userData.Login = httpRequest.Form["txtLogin"].ToString();
     }
     else
     {
         userData.Login = "";
     }
     if (httpRequest.Form["txtPassword"] != null)
     {
         userData.Password = httpRequest.Form["txtPassword"].ToString();
     }
     else
     {
         userData.Password = "";
     }
     return userData;
 }