Beispiel #1
0
    private void Login()
    {
        try
        {
            // string AuthenticationString = "";
            //if (!string.IsNullOrEmpty(hfEmpCode.Value))
            //{
            //AuthenticationString = hfEmpCode.Value; //Request.Form["txtAuthenticationString"];
            if (CheckUserAudit(txtEmployeeCode.Text))
            {
                lblError.Text        = "";
                mSession.CounterCode = cmbCounterCode.SelectedValue;


                Response.Cookies["EmployeeCode"].Value   = txtEmployeeCode.Text;
                Response.Cookies["EmployeeCode"].Expires = DateTime.Now.AddDays(10);

                Response.Cookies["CounterCode"].Value   = mSession.CounterCode;
                Response.Cookies["CounterCode"].Expires = DateTime.Now.AddDays(10);


                Response.Redirect("default.aspx", false);
                //                    FormsAuthentication.DefaultUrl = "~/PublicModule/Default.aspx";
                //FormsAuthentication.RedirectFromLoginPage(, false);
            }
            else
            {
                Response.Cookies["EmployeeCode"].Value = null;


                Response.Cookies["CounterCode"].Value = null;

                lblError.Text = "Invalid 'Employee Code'";
            }
            //}
            //else
            //{

            //}
        }
        catch (Exception ex)
        {
            RadMessageBox.RadMsgBox msg = new RadMessageBox.RadMsgBox();
            msg.ShowAlert(ex.ToString());
        }
    }
Beispiel #2
0
    private void Login()
    {
        try
        {
            // string AuthenticationString = "";
            //if (!string.IsNullOrEmpty(hfEmpCode.Value))
            //{
            //AuthenticationString = hfEmpCode.Value; //Request.Form["txtAuthenticationString"];
            if (CheckUserAudit(txtEmployeeCode.Text))
            {
                lblError.Text = "";
                mSession.CounterCode = cmbCounterCode.SelectedValue;

                Response.Cookies["EmployeeCode"].Value = txtEmployeeCode.Text;
                Response.Cookies["EmployeeCode"].Expires = DateTime.Now.AddDays(10);

                Response.Cookies["CounterCode"].Value = mSession.CounterCode;
                Response.Cookies["CounterCode"].Expires = DateTime.Now.AddDays(10);

                Response.Redirect("default.aspx", false);
                //                    FormsAuthentication.DefaultUrl = "~/PublicModule/Default.aspx";
                //FormsAuthentication.RedirectFromLoginPage(, false);
            }
            else
            {
                Response.Cookies["EmployeeCode"].Value = null;

                Response.Cookies["CounterCode"].Value = null;

                lblError.Text = "Invalid 'Employee Code'";

            }
            //}
            //else
            //{

            //}
        }
        catch (Exception ex)
        {
            RadMessageBox.RadMsgBox msg = new RadMessageBox.RadMsgBox();
            msg.ShowAlert(ex.ToString());
        }
    }