protected void btnRegister_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt = (DataTable)Session["MemberInfo"]; foreach (DataRow dr in dt.Rows) { ViewState["Email"] = dr["Email"].ToString(); } //Check for valid old password object ValidPwd; ValidPwd = clscon.ReturnScalerObject("Login_ValidateMemberPassword", new SqlParameter("@Email", ViewState["Email"].ToString()), new SqlParameter("@Password", txtOldPassword.Text)); //Update the new password in DB if old password check is valid if (ValidPwd != null) { clscon.ExecuteDA("Update_UserMemberPassword", new SqlParameter("@Email", ViewState["Email"].ToString()), new SqlParameter("@Password", txtconfPassword.Text)); MsgBox("Password updated successfully"); } else { MsgBox("Enter valid old password."); } }
//protected int checkCoupon(string CouponName) //{ // int flag = 1; // int a, b, c; // if (Session["MemberInfo"] != null) // { // a = 1; // DataTable dtUser; // dtUser = new DataTable(); // dtUser = (DataTable)Session["MemberInfo"]; // if (dtUser.Rows[0]["memberId"].ToString() == "0") // { // a = 2; // } // } // else // { // a = 2; // } // clsBSD = new BillingShippingDetails(); // DataTable dtbilship1 = new DataTable(); // dtbilship1 = clsBSD.BindBillShip(); // if (cls.CheckExistField("CheckExistField", "InvoiceBillingShipping", "ColourName", txtcolourname.Text, "and IsActive = 1")) // { // } // DataTable dt = new DataTable(); // dt = cls.ReturnDataTable("Select_CouponOnName", new SqlParameter("@CouponName", CouponName)); // if (dt.Rows.Count > 0) // { // } // else // { // flag = 2; // coupon not exist // } // return flag; //} protected string ValidateCoupon(string CouponName) { string amount = ""; int memberid; double orderval; string email; string couponname; if (Session["MemberInfo"] != null) { DataTable dtUser; dtUser = new DataTable(); dtUser = (DataTable)Session["MemberInfo"]; memberid = Convert.ToInt32(dtUser.Rows[0]["memberId"].ToString()); // set memberid } else { memberid = 0; } clsCart = new clsAddToCart(); orderval = clsCart.TotalPriceWithoutDiscount(); // set ordervalue clsBSD = new BillingShippingDetails(); DataTable dtbilship1 = new DataTable(); dtbilship1 = clsBSD.BindBillShip(); email = dtbilship1.Rows[0]["SEmail"].ToString(); // set email couponname = CouponName; // set couponname amount = cls.ReturnScalerObject("GetDiscountOnCoupon", new SqlParameter("@CouponName", couponname), new SqlParameter("@MemberId", memberid), new SqlParameter("@Email", email), new SqlParameter("@OrderValue", orderval)).ToString(); return(amount); }
protected void btnSubmit_Click(object sender, EventArgs e) { //Check for valid old password object ValidPwd; ValidPwd = cls.ReturnScalerObject("Login_ValidatePassword", new SqlParameter("@UserName", Utils.CurrentLoggedInUser()), new SqlParameter("@Password", txtOldPwd.Text)); //Update the new password in DB if old password check is valid if (ValidPwd != null) { cls.ExecuteDA("Update_UserPassword", new SqlParameter("@UserID", Utils.CurrentUser().UserID), new SqlParameter("@Password", txtConfirmPwd.Text), new SqlParameter("@LastPasswordChangeDate", DateTime.Now)); lblMsg.Text = "Password changed successfully."; txtOldPwd.Text = ""; txtNewPwd.Text = ""; txtConfirmPwd.Text = ""; } else { lblMsg.Text = "Enter valid old password."; txtOldPwd.Focus(); } }