コード例 #1
0
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        EncryptDecrypt enc = new EncryptDecrypt();

        //Session["PSEEMAIL"] = txtemailid.Text;
        password = enc.EncryptDecryptString("£", txtPassword.Text);
        userid   = txtEmail.Text;

        ds = ba_emplgnemailid.Getmarketingloginbyemailid(userid, password);
        if (ds.Tables[0].Rows.Count > 0)
        {
            Session["PSMEName"] = ds.Tables[0].Rows[0]["Fname"].ToString() + " " + ds.Tables[0].Rows[0]["Mname"].ToString() + " " + ds.Tables[0].Rows[0]["Lname"].ToString();
            Session["Fname"]    = ds.Tables[0].Rows[0]["Fname"].ToString();
            Session["PSMEID"]   = ds.Tables[0].Rows[0]["id"].ToString();

            Session["PSMEMAIL"] = ds.Tables[0].Rows[0]["Emailid"].ToString();

            Session["PSEName"]  = Session["PSMEName"].ToString();
            Session["PSEID"]    = Session["PSMEName"].ToString();
            Session["PSEEMAIL"] = txtEmail.Text;
            Session["PSLogin"]  = "******";
            Session["UID"]      = userid;
            Response.Redirect("marketing/MarketingHomePage.aspx", false);
        }
        else
        {
            lblMsg.Text = "Invalid Credentials...";
        }
    }
コード例 #2
0
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        EncryptDecrypt enc = new EncryptDecrypt();

        password = enc.EncryptDecryptString("£", txtPwd.Text);
        userid   = Session["UID"].ToString();
        ds       = ba_emplgnemailid.Getmarketingloginbyemailid(userid, password);
        if (ds.Tables[0].Rows.Count > 0)
        {
            if (txtxNewPwd.Text != txtRePassword.Text)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('New Password and Re-Type Password Are Not Matched')", true);
            }
            else
            {
                try
                {
                    newPwd = enc.EncryptDecryptString("£", txtxNewPwd.Text);
                    ba_emplgnemailid.ChangePassword(userid, newPwd);
                    // Response.Redirect("~/Marketing/MarketingHomePage.aspx");
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Password Changed Successfully')", true);
                }
                catch (Exception ex)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Password Changed Failure')", true);
                }
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Please Enter Correct Old Password')", true);
        }
    }
コード例 #3
0
    protected void imgbtnLogin_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            if (txtUserId.Text != "" && txtPassword.Text != "")
            {
                EncryptDecrypt enc = new EncryptDecrypt();
                //Session["PSEEMAIL"] = txtemailid.Text;
                password = enc.EncryptDecryptString("£", txtPassword.Text);
                userid   = txtUserId.Text;

                ds = ba_emplgnemailid.Getmarketingloginbyemailid(userid, password);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    Session["PSMEName"]     = ds.Tables[0].Rows[0]["Fname"].ToString() + " " + ds.Tables[0].Rows[0]["Mname"].ToString() + " " + ds.Tables[0].Rows[0]["Lname"].ToString();
                    Session["Fname"]        = ds.Tables[0].Rows[0]["Fname"].ToString();
                    Session["PSMEID"]       = ds.Tables[0].Rows[0]["id"].ToString();
                    Session["logintime"]    = DateTime.Now.ToString();
                    Session["PSMEMAIL"]     = ds.Tables[0].Rows[0]["Emailid"].ToString();
                    Session["PSEName"]      = Session["PSMEName"].ToString();
                    Session["PSEID"]        = Session["PSMEName"].ToString();
                    Session["PSEEMAIL"]     = txtUserId.Text;
                    Session["PSLogin"]      = ds.Tables[0].Rows[0]["Role"].ToString();
                    Session["UID"]          = userid;
                    Session["MarSessionID"] = ds.Tables[0].Rows[0]["sessionID"].ToString();
                    Response.Redirect("marketing/MarketingHomePage.aspx", false);
                }
                else
                {
                    lblMsg.Text = "Invalid Credentials...";
                }
            }
            else
            {
                lblMsg.Text = "Please enter Emailid & Password...";
            }
        }
        catch (Exception ex)
        {
            lblMsg.Text = ex.Message;
        }
    }