protected void btnsubmit_Click(object sender, EventArgs e) { DataSet ds = new DataSet(); ds = CommanDataLoad.ExecuteDataSet("Select * from usr_login where UserId='" + HttpContext.Current.Session["UserId"] + "'", "2", "Change_password", ""); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { string str1 = CommanDataLoad.DecryptPassword(Convert.ToString(ds.Tables[0].Rows[0]["pass"].ToString())); if (txtOldPassword.Text == str1) { if (txtNewPassword.Text == txtConfirmPassword.Text) { string str = "update usr_login set pass='******' where UserId='" + HttpContext.Current.Session["UserId"] + "'"; CommanDataLoad.ExecuteNonQuery(str, "2", "Change Pass", ""); Lblmessage.Text = "Your Password Changed Successfully...!!!"; Response.Redirect("Default.aspx?msg=Password changed successfully...!"); } } else { Lblmessage.Text = "Please enter correct current password...!!!, Please login now with new password..!"; } } } }
protected void btnsubmit_Click(object sender, EventArgs e) { string strPass = CommanDataLoad.Generate(6, 8); // strPass = "******"; try { string[] param = new string[16]; param[0] = "UserName"; param[1] = txtusername.Text; param[2] = "Email"; param[3] = txtemail.Text; param[4] = "UserPassword"; param[5] = CommanDataLoad.EncryptPassword(strPass); param[6] = "GroupId"; param[7] = ddlGroupid.SelectedValue; param[8] = "ip"; param[9] = ClsConnection.StrIP; param[10] = "Mobile"; param[11] = txtmobile.Text; param[12] = "Company_Id"; param[13] = ddlcompany.SelectedValue; param[14] = "empcode"; param[15] = txtempcode.Text; Send_mail(strPass); int rowaffected = CommanDataLoad.ExecuteNonQuery("Usp_User_master_insert", "1", "User_Master", param); if (rowaffected > 0) { Response.Write("<script>alert('Record Inserted Successfully.');</script>"); } ClearControls(); //GridView1.DataBind(); } catch (Exception ex) { lblmsg.Text = "Some Error" + ex.Message.ToString(); //Console.WriteLine("Some ERROR" + ex.Message.ToString()); } }
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"; } }
protected void Button1_Click(object sender, EventArgs e) { string[] Param = new string[6]; Param[0] = "User"; Param[1] = txtuser.Value; Param[2] = "pass"; Param[3] = CommanDataLoad.EncryptPassword(txtpass.Value); Param[4] = "ip"; Param[5] = Request.UserHostAddress; if (chk.Checked) { if (txtpass.Value.ToString().ToUpper().Contains("ADMIN")) { Session["UserId"] = txtuser.Value; Session["UserName"] = txtuser.Value; Session["empcode"] = txtuser.Value; Session["UserGroupId"] = "4"; Response.Cookies["UserGroupId"].Value = "4"; Response.Cookies["empcode"].Value = txtuser.Value; Response.Cookies["UserName"].Value = txtuser.Value; Response.Cookies["Name"].Value = txtuser.Value; Response.Redirect("RBHome.aspx"); } RBERP.PBService.EmployeeRegistrationServiceContractClient client = new RBERP.PBService.EmployeeRegistrationServiceContractClient(); DataSet ds = client.AuthenticateEmployeeLogin(txtuser.Value, txtpass.Value); if (ds != null) { Session["UserId"] = ds.Tables[0].Rows[0]["employee_code"].ToString(); Session["UserName"] = ds.Tables[0].Rows[0]["employee_name"].ToString(); Session["empcode"] = ds.Tables[0].Rows[0]["employee_code"].ToString(); Session["UserGroupId"] = "4"; Response.Cookies["UserGroupId"].Value = "4"; Response.Cookies["empcode"].Value = ds.Tables[0].Rows[0]["employee_code"].ToString(); Response.Cookies["UserName"].Value = txtuser.Value; Response.Cookies["Name"].Value = txtuser.Value; Response.Redirect("RBHome.aspx"); } else { lblmsg.Text = "Incorrect User Name Or Password"; } } else { DataSet ds = new DataSet(); ds = CommanDataLoad.ExecuteDataSet("USP_Select_login", "1", "Login", Param); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { Session["UserId"] = ds.Tables[0].Rows[0]["userid"].ToString(); Session["UserName"] = txtuser.Value; Session["empcode"] = ds.Tables[0].Rows[0]["empcode"].ToString(); //Response.Cookies["empcode"].Value = ds.Tables[0].Rows[0]["empcode"].ToString(); if (ds.Tables[0].Rows[0]["empcode"].ToString().Equals("RB40000155")) { Response.Cookies["empcode"].Value = "RB40000043"; } else { Response.Cookies["empcode"].Value = ds.Tables[0].Rows[0]["empcode"].ToString(); } Response.Cookies["UserName"].Value = txtuser.Value; Response.Cookies["Name"].Value = txtuser.Value; Response.Cookies["UserId"].Value = ds.Tables[0].Rows[0]["userid"].ToString(); Response.Redirect("home.aspx"); } else { lblmsg.Text = "Incorrect User Name Or Password"; } } else { lblmsg.Text = "Incorrect User Name Or Password"; } } }
protected void btnsubmit_Click(object sender, EventArgs e) { string strPass = CommanDataLoad.Generate(6, 8); try { string[] param = new string[16]; param[0] = "Broker_Name"; param[1] = txtbroker.Text; param[2] = "Ip_address"; param[3] = ClsConnection.StrIP; param[4] = "UserId"; param[5] = ClsConnection.Userid; param[6] = "Contact_No"; param[7] = txtcontact.Text; param[8] = "PAN_No"; param[9] = txtPAN.Text; param[10] = "Emp_Code"; param[11] = ddlEmployee.SelectedValue; param[12] = "Email_Id"; param[13] = txtEmail.Text; param[14] = "UserPassword"; param[15] = CommanDataLoad.EncryptPassword(strPass); Send_mail(strPass); int rowaffect = 0; DataSet ds = new DataSet(); ds = CommanDataLoad.ExecuteDataSet("Usp_Insert_BrokerDetail", "1", "Broker Master", param); if (ds != null) { string brokId = ds.Tables[0].Rows[0]["BrokerId"].ToString(); int i = 0; while (i < gvBrokerProd.Rows.Count) { CheckBox chk = (CheckBox)gvBrokerProd.Rows[i].FindControl("chk"); if (chk.Checked == true) { TextBox txtPayout = (TextBox)gvBrokerProd.Rows[i].FindControl("txtPayoutper"); string[] param1 = new string[6]; param1[0] = "Broker_Id"; param1[1] = brokId; param1[2] = "Product_Id"; param1[3] = gvBrokerProd.Rows[i].Cells[1].Text; param1[4] = "PayoutPer"; param1[5] = txtPayout.Text; rowaffect = CommanDataLoad.ExecuteNonQuery("USP_Insert_BrokerProductMapping", "1", "Broker Master", param1); } i = i + 1; } if (rowaffect > 0) { Response.Write("<script>alert('Record Saved Successfully.');</script>"); //BindGrid(); } } ClearControls(); BindGrid(); Load_Grid(); } catch (Exception ex) { lblmsg.Text = "Some Error" + ex.Message.ToString(); } }