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(); }
protected void btnSend_Click(object sender, EventArgs e) { int intActionResult = 0; intActionResult = this.AddRecord_ProductOrder(Convert.ToInt32(this.ProductID), txtEmail.Text, txtName.Text, txtMessage.Text); if (intActionResult > 0) { this.SendEmail(Convert.ToInt32(this.ProductID)); lblSystemMessage.Text = UTLUtilities.ShowSuccessMessage("Your message has been sent."); this.Clear(); //Response.Redirect("ItemList_Classifieds.aspx?CID=" + this.CategoryID + "&Location=" + this.Location + "&CMSG=1"); //Response.Redirect("ItemList_Classifieds.aspx?CID=" + this.CategoryID + "&SCID=" + this.SubcategoryID + "&Location=" + this.Location + "&AdType=" + this.AdvertisementType + "&CMSG=1"); } else { Response.Redirect("ItemList_Classifieds.aspx?CID=" + this.CategoryID + "&SCID=" + this.SubcategoryID + "&Location=" + this.Location + "&AdType=" + this.AdvertisementType + "&CMSG=0"); } }