protected void Button1_Click(object sender, EventArgs e) { try { string ServerIP = Request.ServerVariables["REMOTE_ADDR"]; string journydate = JournyOut.InnerText; DateTime CancelReq = DateTime.Now; string journydate_Inb = JournyInb.InnerText; string LastName = string.Empty; if (Request.QueryString["Ref"] != "") { refid = Request.QueryString["Ref"].ToString(); } for (int i = 0; i < paxOut.Items.Count; i++) { if (paxOut.Items[i].Selected) { string UpdateQuery = "update PassengreDetails set lastname='" + paxOut.Items[i].Text.Split('/')[1].Split('(')[0] + "',status_out='Requested',Cancel_Requested='" + CancelReq + "' where reservationid='" + refid + "' and sid='" + paxOut.Items[i].Value + "'"; CommonDb.RunQuery(UpdateQuery); } } if (paxIn.Items.Count > 0) { for (int j = 0; j < paxIn.Items.Count; j++) { if (paxIn.Items[j].Selected) { string UpdateQuery = "update PassengreDetails set lastname='" + paxIn.Items[j].Text.Split('/')[1].Split('(')[0] + "',status_Inb='Requested',Cancel_Requested='" + CancelReq + "' where reservationid='" + refid + "' and sid='" + paxIn.Items[j].Value + "'"; CommonDb.RunQuery(UpdateQuery); } } } string Cancle_mode = string.Empty; if (radio1.Checked) { Cancle_mode = "Normal Cancellation"; } else if (radio2.Checked) { Cancle_mode = "Full Refund"; } DateTime Update_Date = DateTime.Now; //Update reservation table with remarks and update date time and server Ip string Update_Resn = "update reservationtable set update_id='" + Session["userid"] + "',Cancel_Mode='" + Cancle_mode + "',UpdateDate='" + Update_Date + "',Remarks='" + Remarks.Text + "',Server_Ip='" + ServerIP + "' where reservationid='" + refid + "'"; CommonDb.RunQuery(Update_Resn); //Update completed string aab = FlightDetails; Response.Redirect("CancelledReservationList.aspx"); string popupScript = "<script language='javascript'>" + "window.close();" + "if (window.opener && !window.opener.closed)" + "{" + "window.opener.location.reload();" + "}" + "</script>"; ScriptManager.RegisterStartupScript(Page, this.GetType(), "DatePickerScript", popupScript, true); } catch { } }
protected void Submit_Click(object sender, EventArgs e) { try { string UpdQuery_Inb = string.Empty; string Insert_CancRes = string.Empty; int totalpax = 0; totalpax = PaxOut.Count; for (int i = 0; i < PaxOut.Count; i++) { string UpdQuery = "update PassengreDetails set status_out='Cancelled' where sid='" + PaxOut[i].Split('`')[1] + "'"; CommonDb.RunQuery(UpdQuery); } if (PaxInb.Count >= 1) { totalpax = totalpax + PaxInb.Count; for (int j = 0; j < PaxInb.Count; j++) { UpdQuery_Inb = "update PassengreDetails set status_Inb='Cancelled' where sid='" + PaxInb[j].Split('`')[1] + "' "; CommonDb.RunQuery(UpdQuery_Inb); } } DateTime Canclled_Date = DateTime.Now; Insert_CancRes = "insert into CancelReservation(Reservationid,agentid,AgentCode,CancelDatetime,Airline_Pnr,Gds_Pnr,Cancellation_Charge,Refunded_Charge,Paxcout,ExecutiveName)"; Insert_CancRes += " values('" + refid + "','" + Session["userid"] + "','" + Session["usertype"] + "','" + Canclled_Date + "','" + PNR_Details.Split(',')[0] + "','" + PNR_Details.Split(',')[1] + "','" + Cnc_cnx.Text + "','" + cnc_Refund.Text + "','" + totalpax + "','" + Executive.Text + "')"; CommonDb.RunQuery(Insert_CancRes); //update balance decimal refund = 0; if (cnc_Refund.Text != "") { refund = Convert.ToDecimal(cnc_Refund); } CF.CommonFunction.FlightUpdateBalances(refid, "Cancel_Booking", "Online", refund, 0, 0, 0, Session["userid"].ToString(), Session["userid"].ToString(), "0", "", PNR_Details.Split('`')[1], "", Session["usertype"].ToString(), Session["usertype"].ToString(), "C", "1", "Cancellation", "", 0); } catch { } }
protected void submit_Click(object sender, EventArgs e) { try { string sSQL12 = "Insert Into OfflineCreditLog (Uid,AgentCode,Description,CreditNeeded,PhoneMobile,LastDepositDate,LastDepositAmount,CreditAvailable,LastUpdateDate,RefAgency,ValidationCode,Remarks,DepositUpdateflag) values(" + "'" + txtagentID.Value + "'" + "," + "'" + Session["Agentcode"].ToString() + "'" + "," + "'" + Session["AgencyName"].ToString() + "'" + "," + "'" + txtcramount.Value + "'" + "," + "'" + txtmobile.Value + "'" + "," + "'" + txtdepdate.Value + "'" + "," + "'" + txtlstdepdate.Value + "'" + "," + "'" + txtpending.Value + "'" + "," + "'" + DateTime.Now + "'" + "," + "'" + Session["RefAgency"].ToString() + "'" + "," + "'" + Session["usertype"].ToString() + "'" + "," + "'" + txtRemarks.Value + "'" + "," + "0" + ")"; Boolean res = CommonDb.RunQuery(sSQL12); } catch (Exception ex) { ex.ToString(); } string FromMail = ConfigurationManager.AppSettings.Get("DepositEmail"); String ConnectionServer = ConfigurationManager.AppSettings.Get("ConnectionServer"); String sConn = "Server=" + ConnectionServer + ";" + ((ConfigurationManager.AppSettings.Get("ConnectionString"))); SqlConnection MyConnection = new SqlConnection(sConn); MyConnection.Open(); string sql = ""; string distemailid = string.Empty; sql = "Select * from tblcitycountry where description = '" + Session["RefAgency"].ToString() + "'"; SqlCommand command = new SqlCommand(sql, MyConnection); SqlDataReader adoDR = command.ExecuteReader(); if (adoDR.HasRows) { adoDR.Read(); distemailid = adoDR["Emailid"].ToString(); } string CcMail = Session["Email"].ToString(); string sBody = ""; sBody = "<table width='500px' align='center' style='BORDER-RIGHT: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid'>"; sBody = sBody + "<tr>"; sBody = sBody + "<td align='center' colspan='2'><font size='4' color='#000000' style='font-family:arial'><u>Credit Request</u></font>"; sBody = sBody + "</td>"; sBody = sBody + "</tr>"; sBody = sBody + "<tr>"; sBody = sBody + "<td></td>"; sBody = sBody + "</tr>"; sBody = sBody + "<tr>"; sBody = sBody + "<td align='right' width='250px'><font size='2' color='#000000' style='font-family:arial; font-weight:bold'>Agent ID : </font></td>"; sBody = sBody + "<td align='left' width='250px'><font size='2' color='red' style='font-family:arial'> " + txtagentID.Value + "</font></td>"; sBody = sBody + "</tr>"; sBody = sBody + "<tr>"; sBody = sBody + "<td align='right' width='250px'><font size='2' color='#000000' style='font-family:arial; font-weight:bold'>Credit Amount Needed : </font></td>"; sBody = sBody + "<td align='left' width='250px'><font size='2' color='black' style='font-family:arial'> ₹ " + txtcramount.Value + "</font></td>"; sBody = sBody + "</tr>"; sBody = sBody + "<tr>"; sBody = sBody + "<td align='right' width='250px'><font size='2' color='#000000' style='font-family:arial; font-weight:bold'>Mobile Number : </font></td>"; sBody = sBody + "<td align='left' width='250px'><font size='2' color='black' style='font-family:arial'> " + txtmobile.Value + "</font></td>"; sBody = sBody + "</tr>"; sBody = sBody + "<tr>"; sBody = sBody + "<td align='right' width='250px'><font size='2' color='#000000' style='font-family:arial; font-weight:bold'>Last Deposit Date : </font></td>"; sBody = sBody + "<td align='left' width='250px'><font size='2' color='black' style='font-family:arial'> " + txtdepdate.Value + "</font></td>"; sBody = sBody + "</tr>"; sBody = sBody + "<tr>"; sBody = sBody + "<td align='right' width='250px'><font size='2' color='#000000' style='font-family:arial; font-weight:bold'>Last Deposit Amount : </font></td>"; sBody = sBody + "<td align='left' width='250px'><font size='2' color='black' style='font-family:arial'> ₹ " + txtlstdepdate.Value + "</font></td>"; sBody = sBody + "</tr>"; sBody = sBody + "<tr>"; sBody = sBody + "<td align='right' width='250px'><font size='2' color='#000000' style='font-family:arial; font-weight:bold'>Credit Already Pending : </font></td>"; sBody = sBody + "<td align='left' width='250px'><font size='2' color='black' style='font-family:arial'> ₹ " + txtpending.Value + "</font></td>"; sBody = sBody + "</tr>"; sBody = sBody + "</table>"; string accmail = "*****@*****.**"; MailMessage mm = new MailMessage(ConfigurationManager.AppSettings["UserName"], "" + accmail + ""); mm.CC.Add(CcMail); mm.Body = string.Format(sBody); mm.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = ConfigurationManager.AppSettings["Host"]; smtp.EnableSsl = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableSsl"]); ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return(true); }; NetworkCredential NetworkCred = new NetworkCredential(); NetworkCred.UserName = ConfigurationManager.AppSettings["UserName"]; NetworkCred.Password = ConfigurationManager.AppSettings["Password"]; smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = int.Parse(ConfigurationManager.AppSettings["Port"]); smtp.Send(mm); Response.Redirect("CreditRequest.aspx"); }