本文整理汇总了C#中BAL.ClsBAL.AdjustAgentBalance方法的典型用法代码示例。如果您正苦于以下问题:C# ClsBAL.AdjustAgentBalance方法的具体用法?C# ClsBAL.AdjustAgentBalance怎么用?C# ClsBAL.AdjustAgentBalance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BAL.ClsBAL
的用法示例。
在下文中一共展示了ClsBAL.AdjustAgentBalance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
string bookingRef = "";
string emailId = "";
string lastName = "";
string webService = "";
string startDate = "";
string endDate = "";
HotelBAL obj = new HotelBAL();
obj.ReferenceNo = txtBookingRefNo.Text.ToString().Trim().ToString();
DataSet ds = obj.GetHotelProvisional();
if (ds == null)
{ lblMsg.Text = "Invalid reference number."; return; }
if (ds.Tables.Count == 0)
{ lblMsg.Text = "Invalid reference number."; return; }
if (ds.Tables[0].Rows.Count == 0)
{ lblMsg.Text = "Invalid reference number."; return; }
DataRow dr = ds.Tables[0].Rows[0];
emailId = dr["EmailId"].ToString();
lastName = dr["LastName"].ToString();
bookingRef = dr["BookingRefNo"].ToString();
webService = dr["WebService"].ToString();
startDate = ConvertDate(dr["CheckIn"].ToString());
endDate = ConvertDate1(dr["CheckOut"].ToString());
string status = dr["Status"].ToString();
double hotelTotalFare = Convert.ToDouble(dr["HotelTotalFare"].ToString());
if (status == "Cancelled") { lblMsg.Text = "Already this ticket has been cancelled."; return; }
DataSet dsHotelCancellation = objArzooHotelAPILayer.HotelCancellation(emailId, lastName, bookingRef, webService, startDate, endDate);
if (!dsHotelCancellation.Tables.Contains("HotelCancellation"))
{ lblMsg.Text = "Failed to cancel the ticket."; return; }
DataTable dtCancellation = dsHotelCancellation.Tables["HotelCancellation"];
if (dtCancellation.Rows.Count > 0)
{
DataRow item = dtCancellation.Rows[0];
string cancellationId = item["cancellationId"].ToString();
string refundTotalAmount = item["refundTotalAmount"].ToString();
string cancellationAmount = item["cancellationAmount"].ToString();
string success = item["success"].ToString();
string error = item["error"].ToString();
if (success != "" && cancellationId != "")
{
lblMsg.Text = "Status: " + "Ticket has been cancelled successfully.";
string provisionalId = dr["ProvisionalId"].ToString();
string bookingId = dr["BookingId"].ToString();
double cancellationCharges = hotelTotalFare - Convert.ToDouble(refundTotalAmount);
InsertCancellaion(provisionalId, bookingId, Convert.ToDouble(refundTotalAmount),
cancellationCharges, Convert.ToInt32(Session["UserID"].ToString()), cancellationId);
objBAL = new ClsBAL();
objBAL.AdjustAgentBalance(txtBookingRefNo.Text.Trim().ToString(),
Convert.ToDouble(refundTotalAmount), Convert.ToDouble(cancellationCharges),
Convert.ToInt32(Session["UserID"].ToString()));
DataSet dsBalance = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"].ToString()));
string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
Label lbl = (Label)this.Master.FindControl("lblBalance");
lbl.Text = balance;
Session["Balance"] = balance;
txtBookingRefNo.Text = "";
}
else if (error != "") { lblMsg.Text = error.ToString(); }
else { lblMsg.Text = "Failed to cancel the ticket."; }
}
}
catch (Exception ex)
{
lblMsg.Text = ex.Message;
}
}
示例2: btnGet_Click
protected void btnGet_Click(object sender, EventArgs e)
{
try
{
DataSet dsGetTransId = new DataSet();
dsGetTransId = objFlightBal.GetTransID(txtBookingReferenceNo.Text);
transId = dsGetTransId.Tables[0].Rows[0]["transid"].ToString();
if (transId != "")
{
String xmlCancelReqStatus = "<EticketCanStatusReq><Clientid>" + FlightsConstants.USERID + "</Clientid><Clientpassword>" + FlightsConstants.PASSWORD + "</Clientpassword><Clienttype>ArzooFWS1.0</Clienttype><transid>" + transId + "</transid><partnerRefId></partnerRefId><CancellationId></CancellationId></EticketCanStatusReq>";
DataSet dsCancelStatusResponse = objFlights.GetCancelTicketStatus(xmlCancelReqStatus);
//DataSet dsCancelStatusResponse = new DataSet();
//dsCancelStatusResponse.ReadXml("F:\\Projects\\Love Journey\\Cancel_Domestic_Static_Response.xml");
if (dsCancelStatusResponse != null)
{
objFlightBal.Status = dsCancelStatusResponse.Tables["Cancellation"].Rows[0]["CancellationStatus"].ToString();
objFlightBal.TransId = dsCancelStatusResponse.Tables["EticketCanStatusRes"].Rows[0]["transid"].ToString();
objFlightBal.ReferenceNo = txtBookingReferenceNo.Text;
objFlightBal.CancellationProcessDateTime = dsCancelStatusResponse.Tables["Cancellation"].Rows[0]["CancellationProcessDateTime"].ToString();
objFlightBal.CancellationCharges = dsCancelStatusResponse.Tables["Cancellation"].Rows[0]["CancellationCharges"].ToString();
objFlightBal.RefundStatus = dsCancelStatusResponse.Tables["Cancellation"].Rows[0]["RefundStatus"].ToString();
objFlightBal.FinalRefundAmount = dsCancelStatusResponse.Tables["Cancellation"].Rows[0]["FinalRefundAmount"].ToString();
objFlightBal.RefundDateTime = dsCancelStatusResponse.Tables["Cancellation"].Rows[0]["RefundDateTime"].ToString();
bool res = objFlightBal.UpdateDomesticFlightCancelStatus(objFlightBal);
ClsBAL objBAL = new ClsBAL();
objBAL.AdjustAgentBalance(txtBookingReferenceNo.Text.Trim().ToString(),
Convert.ToDouble(objFlightBal.FinalRefundAmount), Convert.ToDouble(objFlightBal.CancellationCharges),
Convert.ToInt32(Session["UserID"].ToString()));
DataSet dsBalance = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"].ToString()));
string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
Label lbl = (Label)this.Master.FindControl("lblBalance");
lbl.Text = balance;
Session["Balance"] = balance;
if (res)
{
lblStatus.Text = "Updated the status";
lblStatus.ForeColor = System.Drawing.Color.Green;
lblStatus.Visible = true;
}
}
}
else
{
lblStatus.Text = "Invalid Request";
}
}
catch (Exception ex)
{
}
}
示例3: CancelBitlaTickets
protected void CancelBitlaTickets(string CancelType, string SeatNos)
{
try
{
if (ViewState["dsticketdetails"] != null)
{
DataTable dt = (DataTable)ViewState["dsticketdetails"];
int BookingId = Convert.ToInt32(dt.Rows[0]["BookingId"].ToString());
int tentativeId = Convert.ToInt32(dt.Rows[0]["TentativeId"].ToString());
string EmailId = dt.Rows[0]["EmailId"].ToString();
string Name = dt.Rows[0]["FullName"].ToString();
string ticketNumberBitla = dt.Rows[0]["PNRNumber"].ToString();
string seatNumbersBitla = dt.Rows[0]["SeatNos"].ToString();
string cancelllationId = dt.Rows[0]["CancellationId"].ToString();
string CancelledSaets = dt.Rows[0]["CancelledSeats"].ToString();
if (CancelType == "Total Cancellation")
{
objBitlaAPILayer.TicketNumber = ticketNumberBitla;
objBitlaAPILayer.SeatNumbers = SeatNos;
DataSet dsBitla = objBitlaAPILayer.IsTicketCancellable();
#region Cancellation
if (dsBitla != null)
{
if (dsBitla.Tables[0].Rows.Count > 0 && dsBitla.Tables[0].Columns.Count > 2)
{
string refundAmount = dsBitla.Tables[0].Rows[0]["refund_amount"].ToString();
string cancellationCharges = dsBitla.Tables[0].Rows[0]["cancellation_charges"].ToString();
if (dsBitla.Tables[0].Rows[0]["is_cancellable"].ToString().ToUpper().ToString() == "TRUE")
{
objBitlaAPILayer.TicketNumber = ticketNumberBitla;
DataSet dsBitla1 = objBitlaAPILayer.CancelTicket();
if (dsBitla1 != null)
{
if (dsBitla1.Tables.Count > 0)
{
if (dsBitla1.Tables[0].Columns.Count > 1 && dsBitla1.Tables[0].Rows.Count > 0)
{
AddCancellation(BookingId, tentativeId, SeatNos, EmailId, refundAmount, Convert.ToString(Convert.ToDouble(refundAmount) + Convert.ToDouble(cancellationCharges)), "Bitla", hour);
Mail(dt.Rows[0]["EmailId"].ToString(), dt.Rows[0]["PGMBRefNo"].ToString());
objBAL = new ClsBAL();
objBAL.AdjustAgentBalance(txtMBRefNo.Text.Trim().ToString(),
Convert.ToDouble(refundAmount), Convert.ToDouble(cancellationCharges),
Convert.ToInt32(Session["UserID"]));
DataSet dsBalance = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"]));
string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
Label lbl = (Label)this.Master.FindControl("lblBalance");
lbl.Text = balance;
Session["Balance"] = balance;
txtEmailID.Text = txtMBRefNo.Text = "";
}
else
{
lblMsg.Text = "Ticket cancelled failed. Try Again";
}
}
else
{
lblMsg.Text = "Ticket cancelled failed. Try Again";
}
}
else
{
lblMsg.Text = "Ticket cancelled failed. Try Again";
}
}
else { lblMsg.Text = "Already cancelled "; }
}
else
{
lblMsg.Text = "Already cancelled ";
}
}
#endregion
}
else if (CancelType == "Partial Cancellation")
{
objBitlaAPILayer.TicketNumber = ticketNumberBitla;
objBitlaAPILayer.SeatNumbers = SeatNos;
DataSet dsBitla = objBitlaAPILayer.IsTicketCancellable();
#region PartialCancellation
if (dsBitla != null)
{
if (dsBitla.Tables[0].Rows.Count > 0 && dsBitla.Tables[0].Columns.Count > 2)
{
string refundAmount = dsBitla.Tables[0].Rows[0]["refund_amount"].ToString();
string cancellationCharges = dsBitla.Tables[0].Rows[0]["cancellation_charges"].ToString();
if (dsBitla.Tables[0].Rows[0]["is_cancellable"].ToString() == "true")
{
objBitlaAPILayer.TicketNumber = ticketNumberBitla;
DataSet dsBitla1 = objBitlaAPILayer.CancelPartialTicket();
if (dsBitla1 != null)
{
//.........这里部分代码省略.........
示例4: CancelKesineniTickets
protected void CancelKesineniTickets(string CancelType, string SeatNos)
{
try
{
if (ViewState["dsticketdetails"] != null)
{
DataTable dt = (DataTable)ViewState["dsticketdetails"];
int BookingId = Convert.ToInt32(dt.Rows[0]["BookingId"].ToString());
int tentativeId = Convert.ToInt32(dt.Rows[0]["TentativeId"].ToString());
string EmailId = dt.Rows[0]["EmailId"].ToString();
string cancelllationId = dt.Rows[0]["CancellationId"].ToString();
string CancelledSaets = dt.Rows[0]["CancelledSeats"].ToString();
string pnrNumberKesineni = dt.Rows[0]["PNRNumber"].ToString().Trim().ToString();
string firstNameKesineni = dt.Rows[0]["FullName"].ToString();
string lastNameKesineni = dt.Rows[0]["FullName"].ToString();
DateTime DOJ = Convert.ToDateTime(dt.Rows[0]["DateOfJourney"].ToString());
string dateOfJourneyKesineni = DOJ.ToString("MM/dd/yyyy");
string seatNumberListKesineni = dt.Rows[0]["SeatNos"].ToString();
if (CancelType == "Total Cancellation")
{
DataSet dsKesineni = objKesineniAPILayer.CancelTickets(pnrNumberKesineni, firstNameKesineni, lastNameKesineni,
dateOfJourneyKesineni, SeatNos);
#region total Cancellation
if (dsKesineni != null)
{
if (dsKesineni.Tables[0].Rows.Count > 0 && dsKesineni.Tables[0].Columns.Count > 2)
{
double grandTotalRefund = Convert.ToDouble(dsKesineni.Tables[0].Rows[0]["GrandTotalRefunded"].ToString());
double cancellationCharges = Convert.ToDouble(dsKesineni.Tables[0].Rows[0]["CancellationCharges"].ToString());
DataSet dsKesineni1 = objKesineniAPILayer.ConfirmCancelTickets(pnrNumberKesineni, firstNameKesineni,
lastNameKesineni, dateOfJourneyKesineni, SeatNos);
if (dsKesineni1 != null)
{
if (dsKesineni1.Tables.Count > 0)
{
if (dsKesineni1.Tables[0].Columns.Count > 1 && dsKesineni1.Tables[0].Rows.Count > 0)
{
AddCancellation(BookingId, tentativeId, SeatNos, EmailId, Convert.ToString(grandTotalRefund), Convert.ToString(Convert.ToDouble(grandTotalRefund) + Convert.ToDouble(cancellationCharges)), "", 0);
objBAL = new ClsBAL();
objBAL.AdjustAgentBalance(txtMBRefNo.Text.Trim().ToString(),
Convert.ToDouble(grandTotalRefund), Convert.ToDouble(cancellationCharges),
Convert.ToInt32(Session["UserID"]));
DataSet dsBalance = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"]));
string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
Label lbl = (Label)this.Master.FindControl("lblBalance");
lbl.Text = balance;
Session["Balance"] = balance;
txtEmailID.Text = txtMBRefNo.Text = "";
}
else
{
lblMsg.Text = "Ticket cancelled failed. Try Again";
lblMsg.ForeColor = System.Drawing.Color.Red;
}
}
else
{
lblMsg.Text = "Ticket cancelled failed. Try Again";
lblMsg.ForeColor = System.Drawing.Color.Red;
}
}
else
{
lblMsg.Text = "Ticket cancelled failed. Try Again";
lblMsg.ForeColor = System.Drawing.Color.Red;
}
}
}
#endregion
}
else if (CancelType == "Partial Cancellation")
{
DataSet dsKesineni = objKesineniAPILayer.CancelTickets(pnrNumberKesineni, firstNameKesineni, lastNameKesineni,
dateOfJourneyKesineni, SeatNos);
#region PartialCancellation
if (dsKesineni != null)
{
if (dsKesineni.Tables[0].Rows.Count > 0 && dsKesineni.Tables[0].Columns.Count > 2)
{
double grandTotalRefundp = Convert.ToDouble(dsKesineni.Tables[0].Rows[0]["GrandTotalRefunded"].ToString());
double cancellationChargesp = Convert.ToDouble(dsKesineni.Tables[0].Rows[0]["CancellationCharges"].ToString());
DataSet dsKesineni1 = objKesineniAPILayer.ConfirmCancelTickets(pnrNumberKesineni, firstNameKesineni,
lastNameKesineni, dateOfJourneyKesineni, SeatNos);
if (dsKesineni1 != null)
{
if (dsKesineni1.Tables.Count > 0)
{
if (dsKesineni1.Tables[0].Columns.Count > 1 && dsKesineni1.Tables[0].Rows.Count > 0)
{
if (cancelllationId != "" && CancelledSaets != "")
{
//.........这里部分代码省略.........
示例5: btnSignIn_Click
protected void btnSignIn_Click(object sender, EventArgs e)
{
try
{
if (Session["UserID"] != null)
{
DataSet dsticketdetails = CheckTicketID();
if (CheckStatus)
{
if (dsticketdetails != null)
{
int BookingId = Convert.ToInt32(dsticketdetails.Tables[0].Rows[0]["BookingId"].ToString());
int tentativeId = Convert.ToInt32(dsticketdetails.Tables[0].Rows[0]["TentativeId"].ToString());
string EmailId = dsticketdetails.Tables[0].Rows[0]["EmailId"].ToString();
string Name = dsticketdetails.Tables[0].Rows[0]["FullName"].ToString();
string seatnumbers = dsticketdetails.Tables[0].Rows[0]["SeatNos"].ToString();
string totalfareabhi = dsticketdetails.Tables[0].Rows[0]["TotalFare"].ToString();
string ticketNumberBitla = dsticketdetails.Tables[0].Rows[0]["PNRNumber"].ToString();
string BoardingPointName = dsticketdetails.Tables[0].Rows[0]["BoardingPointName"].ToString();
string DateofJourney = dsticketdetails.Tables[0].Rows[0]["DateOfJourney"].ToString();
string[] dd = DateofJourney.Split(' ');
string[] bd = BoardingPointName.Split('-');
string dateofjourney = dd[0];
string datenow = dd[0] + "" + bd[1];
string APIName = dsticketdetails.Tables[0].Rows[0]["APIName"].ToString();
lblCode.Text = GenerateRandomCode();
TimeSpan s = DateTime.Parse(datenow) - DateTime.Now;
if (s.Days > 0)
{
dayhours = Convert.ToInt32(s.Days) * 24;
}
if (s.Minutes > 30)
{
hour = dayhours + s.Hours + 1;
}
if (s.Minutes <= 30)
{
hour = dayhours + s.Hours;
}
if (hour > 0)
{
Session["NameMail"] = Name;
Session["EmailIdMail"] = EmailId;
#region Kesineni
if (dsticketdetails.Tables[0].Rows[0]["APIName"].ToString() == "Kesineni")
{
ViewState["APIName"] = "Kesineni";
rbtnlstCancelType.Visible = gvPartialCancellation.Visible = btnConfrmCancel.Visible = false;
gvPartialCancellation.DataSource = dsticketdetails.Tables[1];
gvPartialCancellation.DataBind();
ViewState["dsticketdetails"] = dsticketdetails.Tables[0];
btnConfrmCancel_Click(sender, e);
}
#endregion
#region AbhiBus
else if (dsticketdetails.Tables[0].Rows[0]["APIName"].ToString() == "SVR" || dsticketdetails.Tables[0].Rows[0]["APIName"].ToString() == "KAVERI" || dsticketdetails.Tables[0].Rows[0]["APIName"].ToString() == "RAJESH" || dsticketdetails.Tables[0].Rows[0]["APIName"].ToString() == "SAIANJANA" || dsticketdetails.Tables[0].Rows[0]["APIName"].ToString() == "KALLADA")
{
string ticketNumberAbhiBus = dsticketdetails.Tables[0].Rows[0]["PNRNumber"].ToString();
//cancelTicket
ClientAPIList objClientAPIList = new ClientAPIList();
objClientAPIList = GetAPIProvidersList(ConsumerKey, ConsumerSecret);
ClientAPIDetails objClientAPIDetails = objClientAPIList.SingleOrDefault(element => element.ProviderName == dsticketdetails.Tables[0].Rows[0]["APIName"].ToString()); //objClientAPIList.ElementAt(resultSet - 1)
LJ.CLB.Buses.AbhibusAPI obj = new LJ.CLB.Buses.AbhibusAPI();
DataTable dtAbhiBus = obj.cancelTicket(objClientAPIDetails.APIURL, objClientAPIDetails.ConsumerKey, ticketNumberAbhiBus);
if (dtAbhiBus != null)
{
if (dtAbhiBus.Rows.Count > 0)
{
if (dtAbhiBus.Rows[0]["status"].ToString().ToUpper().Trim().ToString() == "SUCCESS")
{
string totalRefundAmount = dtAbhiBus.Rows[0]["total_refund_amount"].ToString();
string canpercentage = dtAbhiBus.Rows[0]["cancellation_parcentage"].ToString();
string[] canindec = canpercentage.Split('%');
double cancelcharges = Convert.ToDouble(totalfareabhi) * (Convert.ToDouble(canindec[0].ToString()) / 100);
AddCancellation(BookingId, tentativeId, seatnumbers, EmailId,
Convert.ToString(Convert.ToDouble(totalfareabhi) - cancelcharges), Convert.ToString(totalfareabhi), APIName, hour);
Mail(dsticketdetails.Tables[0].Rows[0]["EmailId"].ToString(), dsticketdetails.Tables[0].Rows[0]["PGMBRefNo"].ToString());
objBAL = new ClsBAL();
objBAL.AdjustAgentBalance(txtMBRefNo.Text.Trim().ToString(),
Convert.ToDouble(Convert.ToDouble(totalfareabhi) - cancelcharges), Convert.ToDouble(cancelcharges),
Convert.ToInt32(Session["UserID"]));
DataSet dsBalance = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"]));
string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
Label lbl = (Label)this.Master.FindControl("lblBalance");
lbl.Text = balance;
Session["Balance"] = balance;
txtEmailID.Text = txtMBRefNo.Text = "";
}
else
{
lblMsg.Text = "Ticket cancelled failed. Try Again";
//.........这里部分代码省略.........