protected void btnRegister_Click(object sender, EventArgs e) { int intActionResult = 0; string strSystemMessage = string.Empty; //CaptchaControl1.ValidateCaptcha(txtCaptcha.Text); //if (CaptchaControl1.UserValidated) //{ intActionResult = this.AddRecord_UserProfile(); if (intActionResult > 0) { this.Session["CLSF_PROFILE_EMAIL"] = txtEmail1.Text; Response.Redirect("UserProfile_Step02.aspx"); } if (intActionResult == -1) { strSystemMessage += "This email address already used in another user profile."; strSystemMessage += "<br/><br/>"; strSystemMessage += "<strong>How did this happen? </strong>"; strSystemMessage += "<ul>"; strSystemMessage += "<li>You may have already registered with www.apnerdeal.com earlier but forgot about it.</li>"; strSystemMessage += "<li>If you share your email address with someone else, they may have signed up for a ApnerDeal Free Classified account with this address.</li>"; strSystemMessage += "</ul>"; lblSystemMessage.Text = UTLUtilities.ShowErrorMessage(strSystemMessage); } //} }
protected void saveChangeInnerDiscount(object sender, EventArgs e) { int rowsCount = GridView2.Rows.Count; GridViewRow gridRow; TextBox effectiveDateTextBox; TextBox expirydateTextBox; DateTime effectiveDate; DateTime expirydate; DateTimeValidation.Date_Validation dateValidation = new DateTimeValidation.Date_Validation(); for (int i = 0; i <= rowsCount; i++) { gridRow = GridView2.Rows[i]; strCouponID = GridView2.DataKeys[i]["CouponID"].ToString(); strCouponCode = GridView2.DataKeys[i]["CouponCode"].ToString(); strProfileIDDiscount = GridView2.DataKeys[i]["ProfileID"].ToString(); effectiveDateTextBox = (TextBox)gridRow.FindControl("effectiveDateTextBox"); expirydateTextBox = (TextBox)gridRow.FindControl("expirydateTextBox"); if (Int32.TryParse(strCouponID, out intCouponID) && Int32.TryParse(strProfileIDDiscount, out intProfileIDDiscount) && DateTime.TryParse(dateValidation.date_Format_Back_End(effectiveDateTextBox.Text.Trim()), out effectiveDate) && DateTime.TryParse(dateValidation.date_Format_Back_End(expirydateTextBox.Text.Trim()), out expirydate)) { try { using (BC_Product bcProduct = new BC_Product()) { DateTime EffDate = Convert.ToDateTime(effectiveDate); success = success && bcProduct.Update_DiscounteffectiveDate(intCouponID, intProfileIDDiscount, effectiveDate, expirydate); } } catch (Exception ex) { success = false; lblSystemMessageDiscount.Text = UTLUtilities.ShowErrorMessage("Error:" + ex.Message); } } else { success = false; } lblSystemMessageDiscount.Text = success ? UTLUtilities.ShowSuccessMessage("<br />Your discount date range were successfully updated!<br />") : UTLUtilities.ShowGeneralMessage("<br />Some Effective Date or Expiry Date updates failed! Please verify your Ads List!<br />"); } this.LoadList_PostedAllDiscount(); }
private void SelectRecordDiscount() { DiscountZone discountZone = new DiscountZone(); DateTimeValidation dateTimeValidation = new DateTimeValidation(); DiscountManegar manager = new DiscountManegar(); DataTable dt = new DataTable(); discountZone.CouponID = CouponID; discountZone.ProfileID = ProfileID; discountZone.CouponCode = CouponCode; dt = manager.LoadRecord_BS_SpecificDiscount(discountZone); if (dt.Rows.Count > 0) { couponTitleTextBox.Text = dt.Rows[0]["CouponTitle"].ToString(); couponDescriptionTextBox.Text = dt.Rows[0]["CouponDescription"].ToString(); txtFromDate.Text = dt.Rows[0]["CouponEffectiveDate"].ToString(); txtToDate.Text = dt.Rows[0]["CouponExpirydate"].ToString(); string PrientedCouponNeed = dt.Rows[0]["PrintedCouponNeed"].ToString(); if (PrientedCouponNeed == "True") { isPrintedCouponNeedRadioButtonList.SelectedValue = "True"; } else if (PrientedCouponNeed == "False") { isPrintedCouponNeedRadioButtonList.SelectedValue = "False"; } string CouponTemplate = dt.Rows[0]["UseBoromelaCoupon"].ToString(); if (CouponTemplate == "UsedBoromelaCouponTemplate") { DiscountType.SelectedValue = "1"; Enable_Panel(userCouponUpload, false); Enable_Panel(urlPanel, false); } else if (CouponTemplate == "UsedCompanyCouponTemplate") { DiscountType.SelectedValue = "2"; Enable_Panel(userCouponUpload, true); Enable_Panel(urlPanel, false); ImagePath = dt.Rows[0]["UserUploadedCouponPath"].ToString(); } else if (CouponTemplate == "UsedCompanyURL") { DiscountType.SelectedValue = "3"; Enable_Panel(urlPanel, true); Enable_Panel(userCouponUpload, false); urlTextBox.Text = dt.Rows[0]["DiscountCouponURL"].ToString(); } termsConditionsTextBox.Text = dt.Rows[0]["TermsCondition"].ToString(); } else { strSystemMessage = "<table style='width:500px; border:1px dashed #666666;'>"; strSystemMessage += "<tr>"; strSystemMessage += "<td colspan='2' style='width:100%; color:#000000; padding-top:7px; padding-left:10px;'>"; strSystemMessage += "Product Profile not found!"; strSystemMessage += "<br/><br/>"; strSystemMessage += "<strong>How did this happen? </strong>"; strSystemMessage += "<ul>"; strSystemMessage += "<li>You login session may be expired.</li>"; strSystemMessage += "<li>Your Discount may be deleted by ApnerDeal authority for some reason.</li>"; strSystemMessage += "</ul>"; strSystemMessage += "</td>"; strSystemMessage += "</tr>"; strSystemMessage += "</table>"; lblSystemMessage.Text = UTLUtilities.ShowErrorMessage(strSystemMessage); } }