private void btnLogin_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtUserName.Text) && !string.IsNullOrEmpty(txtPassword.Text))
         {
             BOMerchantManage _boMerchant = _bamermng.SelectMerchantLogin("MerchantLogin", txtUserName.Text, Encryptdata(txtPassword.Text));
             if (_boMerchant != null)
             {
                 if (txtPassword.Text == Decryptdata(_boMerchant.Password))
                 {
                     MDIfrmMerchantDashboard frm = new MDIfrmMerchantDashboard(_boMerchant.MerchantId);
                     frm.Show();
                     this.Hide();
                 }
                 else
                 {
                     MessageBox.Show("Password Invalid");
                 }
             }
             else
             {
                 MessageBox.Show("Username or Password Invalid");
             }
         }
         else
         {
             MessageBox.Show("Please Enter Correct UserName/Password");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 protected void btnMerchantLogin_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtMerchantemailLogin.Text) && !string.IsNullOrEmpty(txtMerchantpwdLogin.Text))
         {
             BOMerchantManage _bomerchantDetail = _bamermng.SelectMerchantLogin("MerchantLogin", txtMerchantemailLogin.Text, Encryptdata(txtMerchantpwdLogin.Text));
             if (_bomerchantDetail != null)
             {
                 if (txtMerchantpwdLogin.Text == Decryptdata(_bomerchantDetail.Password))
                 {
                     if (_bomerchantDetail.ActiveStatus)
                     {
                         Session["Merchantid"]     = _bomerchantDetail.MerchantId;
                         Session["merchantDetail"] = _bomerchantDetail;
                         if (Session["Merchantid"] != null)
                         {
                             Response.Redirect("http://localhost:60956/MerchantLogin.aspx", false);
                         }
                     }
                     else
                     {
                         lblerror.InnerText = "Your account is currently not active. Contact your administrator to activate it.";
                         lblerror.Attributes.Add("Style", "display: block;color: #D8000C;");
                     }
                 }
                 else
                 {
                     lblerror.InnerText = "Password invalid";
                     lblerror.Attributes.Add("Style", "display: block;color: #D8000C;");
                     txtMerchantpwdLogin.Focus();
                 }
             }
             else
             {
                 lblerror.InnerText = "Username or Password invalid";
                 lblerror.Attributes.Add("Style", "display: block;color: #D8000C;");
                 txtMerchantemailLogin.Focus();
             }
         }
         else
         {
             lblerror.InnerText = "Please Enter Correct UserName/Password";
             lblerror.Attributes.Add("Style", "display: block;color: #D8000C;");
             txtMerchantemailLogin.Focus();
         }
     }
     catch (Exception ex)
     {
         Common.LogError(ex);
         lblerror.InnerText = "Server not respond";
         lblerror.Attributes.Add("Style", "display: block;color: #D8000C;");
     }
 }
Beispiel #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (Session["Merchantid"] != null)
         {
             Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
             FilldrpCountry();
             BAMerchantManage _bamermng         = new BAMerchantManage();
             BOMerchantManage mnag              = (BOMerchantManage)Session["merchantDetail"];
             BOMerchantManage _bomerchantDetail = _bamermng.SelectMerchantLogin("MerchantLogin", mnag.EmailId, mnag.Password);
             merchantId = _bomerchantDetail.MerchantId;
             FillMerchantDetail(_bomerchantDetail);
         }
         else
         {
             Response.Redirect("Default.aspx", false);
         }
     }
 }