Ejemplo n.º 1
0
        protected void btnsetpsw_Click(object sender, EventArgs e)
        {
            BusinessLayer.PasswordEncryp psw = new BusinessLayer.PasswordEncryp();
            try
            {
                string   urldata = HttpContext.Current.Request.Url.AbsoluteUri;
                string[] Utime   = urldata.Split('-');
                string   scode   = Utime[1];
                //string centerid=Utime[6];
                //string stype=Utime[7];
                string PASSWORD  = txtpsw.Text;
                string CPASSWORD = txtcpsw.Text;
                string EPsw      = psw.Encryptdata(PASSWORD);
                int    Pws       = psw.passwordsave(EPsw, scode);

                if (Pws > 0)
                {
                    Response.Write("<script language='javascript'>window.alert('Thanks! Your Password has been set successfully.');window.location='../RTO/SetPassword.aspx?-thanku';</script>");
                }
            }
            catch
            { }
        }
Ejemplo n.º 2
0
 protected void btnlogin_Click(object sender, EventArgs e)
 {
     BusinessLayer.AccountManager accMgr = new BusinessLayer.AccountManager();
     Entities.Account             entObj = new Entities.Account();
     BusinessLayer.PasswordEncryp pwd    = new BusinessLayer.PasswordEncryp();
     try
     {
         string    pws      = txtpassword.Text;
         string    email    = txtusername.Text;
         string    password = pwd.Encryptdata(pws);
         DataTable dtlogin  = new DataTable();
         dtlogin = accMgr.CheckLogindetailsBLL(email, password);
         if (dtlogin.Rows.Count > 0)
         {
             string Type       = dtlogin.Rows[0]["LoginType_VCR"].ToString();
             string Login_Id   = dtlogin.Rows[0]["LoginID_INT"].ToString();
             string CCode      = dtlogin.Rows[0]["LoginCode_VCR"].ToString();
             string CenterCode = "";
             string Id         = "";
             if (CCode.Contains("_"))     //Split RTO_tblLoginCredential LoginCode_VCR to  center code And Id
             {
                 string[] findCenterCode = CCode.Split('_');
                 CenterCode = findCenterCode[0]; //Center Code
                 Id         = findCenterCode[1]; //User id like Staff id
             }
             else
             {
                 CenterCode = CCode;
                 Id         = CCode;
             }
             //Code for-----------You have active session some where.Do you Want to Logout from Other Active Session
             int ActiveStatus = Convert.ToInt32(dtlogin.Rows[0]["LoginActiveStatus_INT"].ToString());
             if (ActiveStatus != 1)
             {
                 return;
             }
             // Session Declare
             HttpContext.Current.Session["LoginID_INT"]   = Login_Id;
             HttpContext.Current.Session["CenterCode"]    = CenterCode;
             HttpContext.Current.Session["LoginType"]     = Type;
             HttpContext.Current.Session["Id"]            = Id; //User id like Staff id
             HttpContext.Current.Session["LoginCode_VCR"] = CCode;
             if (Type == "SuperAdmin")
             {
                 Response.Redirect("~/SuperAdmin/SuperAdmin_Dashboard.aspx");
             }
             else if (Type == "Admin")
             {
                 Response.Redirect("~/RTOAdmin/RTOAdminDashboard.aspx");
             }
             else if (Type == "user")
             {
                 if (Id == "p505783")
                 {
                     Response.Redirect("~/RTOStaff/LL_Exam_Call.aspx");
                 }
                 else if (Id == "a244301")
                 {
                     Response.Redirect("~/RTOStaff/DL_Exam_Call.aspx");
                 }
                 else
                 {
                     Response.Redirect("~/RTOStaff/RTOStaffDashboard.aspx");
                 }
             }
         }
         else
         {
             Response.Write("<script language='javascript'>window.alert('Invalid Login Credentials !!!');</script>");
         }
     }
     catch
     { }
 }