Ejemplo n.º 1
0
        /// <summary>
        /// Handles the Click event of the btnLogin control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void btnLogIn_Click(object sender, EventArgs e)
        {
            try
            {

                LogInEmployerBAL logInEmployerBAL = new LogInEmployerBAL();
                LoginEnitity logjsEntity = new LoginEnitity();

                logjsEntity.UserName = txtUserName.Text.Trim();
                logjsEntity.Password = txtPassword.Text.Trim();
                string candidateID = logInEmployerBAL.EmployerLogIn(logjsEntity);

                if (string.IsNullOrEmpty(candidateID) || !string.IsNullOrEmpty(Request.QueryString["redirect"]))
                {
                    Session["Employerid"] = candidateID;
                    if (string.IsNullOrEmpty(candidateID))
                    {
                        lblmsg.Text = "Wrong username or password";
                        return;
                    }
                    Response.Redirect(Request.QueryString["redirect"].ToString() + "&ssid=" + Session["Employerid"]);

                    return;
                }
                Session["Employerid"] = candidateID;
                //string isreffered = liBAL.JobSeekerLogIn(logjsEntity);
                //if (string.IsNullOrEmpty(isreffered) || !string.IsNullOrEmpty(Request.QueryString["redirect"]))
                //{
                //    Session["Isreffered"] = isreffered;
                //    if (string.IsNullOrEmpty(isreffered))
                //    {
                //        lblmsg.Text = "Wrong username or password";
                //        return;

                //    }
                //    Response.Redirect(Request.QueryString["redirect"].ToString() + "&ssreffered=" + Session["Isreffered"]);
                //    return;

                //}
                //Session["Isreffered"] = isreffered;
                //Session["UserType"] = 1;
                Response.Redirect("ManageEmployer.aspx");
                //Response.Redirect("~/UserControls/JobSeeker/DemoEducationalDetails.aspx");
            }
            catch (Exception ex)
            {
                lblmsg.Text = ex.Message.ToString();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Handles the Click event of the btnLogin control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            try
            {
                LoginEnitity loginEntity = new LoginEnitity();
                LoginInJobSeekerBAL loginBAL = new LoginInJobSeekerBAL();
                loginEntity.UserName = txtLoginid.Text.Trim();
                loginEntity.Password = txtPassword.Text.Trim();
                string recruiterid = loginBAL.RecruiterLoginBAL(loginEntity);

                string from = txtLoginid.Text;
                string subject = "Logged In";
                string content = "Helllo....";
                MailMessage msg = new MailMessage();
                msg.From = new MailAddress(from);
                msg.To.Add("*****@*****.**");
                msg.Subject = subject;
                msg.Body = "Hi,<br/>Your Username is: " + txtLoginid.Text + "<br/><br/>Your Password is: " + "Logged in Now" + "<br/>";

                SmtpClient smtp = new SmtpClient();
                smtp.Host = "smtp.gmail.com";
                smtp.Port = 587;
                smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "@jacksparow");
                smtp.EnableSsl = true;
                smtp.Send(msg);
                msg = null;
                Response.Write("<script language='javascript'>alert('Email Send to Super Admin ...');</script>");
                if (string.IsNullOrEmpty(recruiterid))
                {
                    Label1.Text = "Login id or password is wrong";
                }
                else
                {
                    Session["RecruiterId"] = recruiterid;
                    Response.Redirect("ViewAllJobsDetails.aspx");
                }
            }
            catch (Exception ex)
            {
                Label1.Text = ex.Message.ToString();
            }
        }