コード例 #1
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        string[] Param = new string[2];
        Param[0] = "email";
        Param[1] = TxtEmail.Value;
        //   TxtEmail.Value = "Dsdsdsds";


        DataSet ds = new DataSet();

        ds = CommanDataLoad.ExecuteDataSet("User_Master_Password_Select", "1", "Forgot_Password", Param);

        if (ds != null)
        {
            if (ds.Tables[0].Rows.Count > 0)
            {
                str1 = ds.Tables[0].Rows[0]["email"].ToString();
                str2 = ds.Tables[0].Rows[0]["pass"].ToString();
                str3 = ds.Tables[0].Rows[0]["username"].ToString();
                string mobile = ds.Tables[1].Rows[0]["mobile"].ToString();
                string name   = ds.Tables[1].Rows[0]["emp_name"].ToString();
                // if (TxtEmail.Value == str1)
                //  {
                string strPass = CommanDataLoad.Generate(6, 8);
                string str     = "update usr_login set pass='******' where email='" + TxtEmail.Value + "' or empcode='" + TxtEmail.Value + "'";
                CommanDataLoad.ExecuteNonQuery(str, "2", "Change Pass", "");
                String strbody = "";
                strbody = strbody + "<table><tr><td><img alt='RupeeBoss.com' width='120px' src='http://erp.rupeeboss.com/Common/Images/Logo.png' ' /></td>";
                strbody = strbody + "<td style='font-weight: bold; font-family: Verdana; font-size: 12px;' valign='middle'>";
                strbody = strbody + "Welcome to RupeeBoss-ERP</td></tr></table>";
                strbody = strbody + "<br/>Dear " + str3 + ",<br/>";
                strbody = strbody + "<br/>Your Password is : " + strPass;
                strbody = strbody + "<br/><br/>Thank You";
                strbody = strbody + "<br /><br />RupeeBoss Software Team<br />";
                strbody = strbody + "<br />+91.9920298619<br />";
                strbody = strbody + "<br />[email protected]<br /></p>";
                string stra = "";
                try
                {
                    stra = ClsSendMail.Send_Mail_Direct(str1, strbody, "Password detail", "*****@*****.**");
                    string smsbody = "Dear " + name + ", Your password for RB ERP and APP is " + strPass;
                    CommanDataLoad.Send_SMS_Save_Data(mobile, smsbody, Request.UserHostAddress);
                    GetMessage();
                    Clear();
                }
                catch (Exception ex)
                {
                    Response.Write(stra + "--" + ex.Message);
                    //  GetError();
                }
                Response.Write(stra);
                // }
            }
            else
            {
                lblmsg.Text = "User not found";
            }
        }
        else
        {
            lblmsg.Text = "User not found";
        }
    }