Esempio n. 1
0
        protected void LoginButton_Click(object sender, EventArgs e)
        {
            IBusinessDataAuthentication _IBusinessDataAuthentication = GenericFactory <BusinessLayer, IBusinessDataAuthentication> .CreateInstance();

            IBusinessDataAccount _IBusinessDataAccount = GenericFactory <BusinessLayer, IBusinessDataAccount> .CreateInstance();

            try
            {
                string userName = (string)_IBusinessDataAuthentication.ValidUser(TxtUsername.Text, TxtPassword.Text);
                if (userName != null)
                {
                    Message.Text           = "";
                    SessionFacade.USERROLE = (string)_IBusinessDataAccount.GetUserRole(userName);
                    //if(SessionFacade.USERROLE == "Admin")
                    //{
                    //    ((ShoppingMasterPage)Master).AddProductLink.Visible = true;
                    //    ((ShoppingMasterPage)Master).UploadImageLink.Visible = true;
                    //}
                    SessionFacade.USERNAME = userName;
                    if (SessionFacade.PAGEREQUESTED != null)
                    {
                        Response.Redirect(SessionFacade.PAGEREQUESTED);
                    }
                    else
                    {
                        Response.Redirect("Home.aspx");
                    }
                }
                else
                {
                    Message.Text = "Enter Valid Credentials";
                }
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }
Esempio n. 2
0
 public LoginController(IBusinessDataAuthentication businessDataAuthentication)
 {
     // Reference to the Business Layer
     _iBusinessDataAuthentication = businessDataAuthentication;
 }
Esempio n. 3
0
 public LoginController()
 {
     // Reference to the Business Layer
     _iBusinessDataAuthentication = GenericFactory <BusinessLayer, IBusinessDataAuthentication> .CreateInstance();
 }