protected void btnSend_Click(object sender, EventArgs e) { DataTable dt = dlbooking.paymentreminder(blbooking); if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { sendMail(dt.Rows[i]["Email"].ToString(), dt.Rows[i]["FirstName"].ToString(), Convert.ToInt32(dt.Rows[i]["BookingID"].ToString())); } lblMsg.ForeColor = System.Drawing.Color.Green; lblMsg.Text = "Reminder mail sent successfully"; } }
private void loaddetails(int bookingid) { blbooking._iBookingId = Convert.ToInt32(bookingid); DataTable dt = dlbooking.paymentreminder(blbooking); if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["Name"] = DataSecurityManager.Decrypt(dt.Rows[i]["Name"].ToString()); dt.Rows[i]["lastname"] = DataSecurityManager.Decrypt(dt.Rows[i]["lastname"].ToString()); dt.Rows[i]["Email"] = DataSecurityManager.Decrypt(dt.Rows[i]["Email"].ToString()); dt.Rows[i]["Telephone"] = DataSecurityManager.Decrypt(dt.Rows[i]["Telephone"].ToString()); } } else { // ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:alert('Your final payment against this booking has been received. There is no outstanding.')", true); //ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('Your final payment against this booking has been received. There is no outstanding.');window.location.href = 'searchproperty1.aspx';", true); //string jv = "alert('Your final payment against this booking has been received. There is no outstanding.');"; //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "msg", jv, true); Response.Redirect("searchproperty1.aspx?ID=01"); // Response.Redirect("searchproperty1.aspx"); } lblAgentName.Text = dt.Rows[0]["Name"].ToString() + " " + dt.Rows[0]["lastname"].ToString(); Session["InvName"] = DataSecurityManager.Decrypt(dt.Rows[0]["Name"].ToString()) + " " + DataSecurityManager.Decrypt(dt.Rows[0]["lastname"].ToString()); try { { lblBillingAddress.Text = dt.Rows[0]["BillingAddress"].ToString(); Session["Address"] = dt.Rows[0]["BillingAddress"].ToString(); } } catch { lblBillingAddress.Text = GetBillingAddress(dt); Session["Address"] = GetBillingAddress(dt); } calculate(dt); Session["getdata"] = dt; }
protected void dgBookings_ItemCommand(object source, DataGridCommandEventArgs e) { string cFormUrl = string.Empty; try { if (e.Item.ItemIndex >= 0) { int iBookingID = Convert.ToInt32(dgBookings.DataKeys[e.Item.ItemIndex].ToString()); switch (e.CommandName.ToString().ToUpper()) { case "EDIT": Response.Redirect("Booking.aspx?bid=" + iBookingID); break; case "VIEW": if (string.Compare(e.Item.Cells[5].Text, "CONFIRMED", true) == 0) { Response.Redirect("Bookingconfirmation.aspx?bid=" + iBookingID.ToString()); } else { Response.Redirect("Booking.aspx?bid=" + iBookingID.ToString() + "&mode=view"); } break; case "CONFIRMATION": Response.Redirect("Bookingconfirmation.aspx?bid=" + iBookingID.ToString()); break; case "VIEWTOURIST": Response.Redirect("ViewTourists.aspx?bid=" + iBookingID.ToString()); break; case "ADDTOURIST": Response.Redirect("touristdetails.aspx?bid=" + iBookingID.ToString()); break; case "CFORMFOREIGNNATIONAL": Response.Redirect("CFormReport.aspx?bid=" + iBookingID.ToString() + "&cftype=fn"); break; case "CFORMINDIANNATIONAL": Response.Redirect("CFormReport.aspx?bid=" + iBookingID.ToString() + "&cftype=in"); break; case "UPLOADTOURIST": Response.Redirect("~\\uploader.aspx?bid=" + iBookingID.ToString() + "&upload=" + ENums.UploadXMLType.Tourist.ToString()); break; case "REMINDER": //Reminder Email //DialogResult result = MessageBox.Show("Are you sure you want to send reminder to the guest for the payment at" + DataSecurityManager.Decrypt(Session["Email"].ToString())+ "", "Yes or No", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); //if (result == DialogResult.Yes) //{ blbooking._iBookingId = iBookingID; DataTable dt = dlbooking.paymentreminder(blbooking); if (dt != null && dt.Rows.Count > 0) { Session["Email"] = dt.Rows[0]["Email"].ToString(); Session["AccomName"] = dt.Rows[0]["AccomName"].ToString(); double amt = 0; for (int i = 0; i < dt.Rows.Count; i++) { amt = amt + Convert.ToDouble(dt.Rows[i]["Amount"].ToString()); } //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:if(confirm('Are you sure you want to send reminder to the guest for the payment at " + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "?');", true); // ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:if(confirm('Are you sure you want to send reminder to the guest for the payment at " + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "?')==false)return false;", true); //RegisterClientScriptBlock //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:confirm('Are you sure you want to send reminder to the guest for the payment at" + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "?')", true); ScriptManager.RegisterStartupScript(this, GetType(), "Sc", "confirmation('" + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "');", true); //ScriptManager.RegisterStartupScript(this, this.GetType(), "Showstatus", "javascript:confirmation('" + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "')", true); //DialogResult result = MessageBox.Show("Are you sure you want to send reminder to the guest for the payment at " + DataSecurityManager.Decrypt(Session["Email"].ToString()) + "", "Yes or No", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); //if (result == DialogResult.Yes) //{ string L = dt.Rows[0]["LastName"].ToString(); if (L == " ") { dt.Rows[0]["LastName"] = "XYZ"; } sendMail(DataSecurityManager.Decrypt(dt.Rows[0]["Email"].ToString()), DataSecurityManager.Decrypt(dt.Rows[0]["Name"].ToString()), DataSecurityManager.Decrypt(dt.Rows[0]["LastName"].ToString()), iBookingID, amt, Convert.ToDouble(dt.Rows[0]["PaidAmt"].ToString()), dt.Rows[0]["StartDate"].ToString(), dt.Rows[0]["enddate"].ToString(), dt.Rows[0]["BookingCode"].ToString(), Convert.ToDateTime(dt.Rows[0]["BookingDate"].ToString()), dt.Rows[0]["Packagename"].ToString(), dt.Rows[0]["AccomName"].ToString(), dt.Rows[0]["RegionName"].ToString(), DataSecurityManager.Decrypt(dt.Rows[0]["Title"].ToString()), DataSecurityManager.Decrypt(dt.Rows[0]["Password"].ToString())); // } RefreshGrid(); } else { RefreshGrid(); } //} //else if (result == DialogResult.No) //{ // RefreshGrid(); //} break; default: break; } } } catch (Exception exp) { GF.LogError("ViewBookings.dgBookings_ItemCommand", exp.Message); return; } }