Example #1
0
        protected void BtnLogin_Click(object sender, EventArgs e)
        {
            string pass  = GlobFuncs.Hash(TextBox2.Text.ToString());
            Users  us    = new Users(TextBox1.Text.ToString(), pass);
            person persn = new person();

            persn = us.Login();

            if (persn != null)
            {
                if (persn.CustomId > 0)
                {
                    Session["Person"] = persn;
                    if (Session["orderQuery"] != null)
                    {
                        string sourceString = Session["orderQuery"].ToString();
                        if (sourceString.Contains("order.aspx"))
                        {
                            Response.Redirect(sourceString);
                        }
                    }
                    Response.Redirect("PrivateArea.aspx");
                }
                else if (persn.CustomId == -2)
                {
                    showErrorMwssage(1);
                }
                else if (persn.CustomId == -3)
                {
                    showErrorMwssage(2);
                }
                else
                {
                    showErrorMwssage(3);
                }
            }
            else
            {
                showErrorMwssage(1);
            }
        }
Example #2
0
 protected void BtnChange_Click(object sender, EventArgs e)
 {
     if (pass.Text != pass2.Text)
     {
         Msg3.Visible = true;
         Msg3.Text    = "אימות סיסמה נכשל נא הזן שוב אימות סיסמה";
         pass2.Focus();
     }
     else
     {
         bool b = GlobFuncs.UpdateDB("CustomersTable", "Password", GlobFuncs.Hash(pass.Text.ToString()), "Email", TxtForget.Text.ToString());
         if (b == true)
         {
             person per = new person();
             per = (person)Session["Person"];
             Response.Redirect("PrivateArea.aspx");
         }
         else
         {
             Msg3.Text = "התרחשה שגיאה בעת עדכון הסיסמה, נא נסה שנית";
         }
     }
 }
Example #3
0
        protected void BtnLogin_Click(object sender, EventArgs e)
        {
            string pass  = GlobFuncs.Hash(TextBox2.Text.ToString());
            Users  us    = new Users(TextBox1.Text.ToString(), pass);
            person persn = new person();

            persn = us.Login();

            if (persn != null)
            {
                if (persn.CustomId > 0)
                {
                    Session["Person"] = persn;
                    if (persn.role == 1)
                    {
                        Response.Redirect("PrivateArea.aspx");
                    }
                    else if (persn.role == 3)
                    {
                        Response.Redirect("admin.aspx");
                    }
                }
                else if (persn.CustomId == -2)
                {
                    showErrorMwssage(1);
                }
                else if (persn.CustomId == -3)
                {
                    showErrorMwssage(2);
                }
                else
                {
                    showErrorMwssage(3);
                }
            }
        }
Example #4
0
 protected void BtnReg_Click(object sender, EventArgs e)
 {
     if (TxtCity.SelectedValue == "-1")
     {
         TxtCity.Focus();
         showErrorMwssage(4);
     }
     else if (DdlLicensCode.SelectedValue == "-1")
     {
         DdlLicensCode.Focus();
         showErrorMwssage(5);
     }
     else
     {
         if (GlobFuncs.IsExist(TxtEmail.Text.ToString()) == true)
         {
             TxtEmail.Focus();
             showErrorMwssage(6);
         }
         else if (checkbox1.Checked != true)
         {
             showErrorMwssage(7);
         }
         else if (TxtName.Text.Length == 0)
         {
             TxtName.Focus();
             showErrorMwssage(8);
         }
         else if (TxtAddress.Text.Length == 0)
         {
             TxtAddress.Focus();
             showErrorMwssage(9);
         }
         else if (TxtId.Text.Length == 0)
         {
             TxtId.Focus();
             showErrorMwssage(10);
         }
         else if (TxtDateOfBirth.Text.Length == 0)
         {
             TxtDateOfBirth.Focus();
             showErrorMwssage(11);
         }
         else if (TxtLicenseNumber.Text.Length == 0)
         {
             TxtLicenseNumber.Focus();
             showErrorMwssage(12);
         }
         else if (TxtDateOfIssuanceLicense.Text.Length == 0)
         {
             TxtDateOfIssuanceLicense.Focus();
             showErrorMwssage(13);
         }
         else if (TxtEmail.Text.Length == 0)
         {
             TxtEmail.Focus();
             showErrorMwssage(14);
         }
         else if (TxtPass.Text.Length == 0)
         {
             TxtPass.Focus();
             showErrorMwssage(15);
         }
         else if (TxtPhone.Text.Length == 0)
         {
             TxtPhone.Focus();
             showErrorMwssage(16);
         }
         else
         {
             string pass = GlobFuncs.Hash(TxtPass.Text.ToString());
             Users  Us   = new Users(-1, TxtName.Text.ToString(), TxtAddress.Text.ToString(), int.Parse(TxtCity.Text.ToString()), TxtId.Text.ToString(), DateTime.Parse(TxtDateOfBirth.Text), TxtLicenseNumber.Text.ToString(), int.Parse(DdlLicensCode.Text.ToString()), DateTime.Parse(TxtDateOfIssuanceLicense.Text), TxtEmail.Text.ToString(), pass, TxtPhone.Text.ToString());
             person per  = new person();
             per = Us.RegUser();
             sendRegMessage(per.CustomId, 0.ToString(), per.FullName);
             Session["Person"] = per;
             Response.Redirect("PrivateArea.aspx");
         }
     }
 }