本文整理汇总了C#中BAL.ClsBAL.GetCommissionSlab方法的典型用法代码示例。如果您正苦于以下问题:C# ClsBAL.GetCommissionSlab方法的具体用法?C# ClsBAL.GetCommissionSlab怎么用?C# ClsBAL.GetCommissionSlab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BAL.ClsBAL
的用法示例。
在下文中一共展示了ClsBAL.GetCommissionSlab方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getagent
public string getagent()
{
if (HttpContext.Current.Session["UserID"] != null)
{
ClsBAL objBAL = new ClsBAL();
DataSet dsCommSlab = objBAL.GetCommissionSlab("Agent", "Bus", "");
if (dsCommSlab != null)
{
if (dsCommSlab.Tables[0].Rows.Count > 0)
{
HttpContext.Current.Session["fare"] = Convert.ToString(dsCommSlab.Tables[0].Rows[0]["Commission"]);
}
}
}
else
{
HttpContext.Current.Session["fare"] = null;
}
return JsonConvert.SerializeObject(HttpContext.Current.Session["fare"]);
}
示例2: btnIntBook_Click
protected void btnIntBook_Click(object sender, EventArgs e)
{
if (Session["UserID"] == null) { Response.Redirect("~/Default.aspx", false); return; }
ClsBAL objBAL = new ClsBAL();
DataSet dsBookingResponse = new DataSet();
//if (Session["Role"].ToString() == "Agent")
//{
DataSet dsBalance = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"].ToString()));
DataSet dsCommSlab = objBAL.GetCommissionSlab(Session["Role"].ToString(), "InterNationalFlights",lblairline.Text); // Change it
string commisionPercentage = string.Empty;
if (dsCommSlab.Tables[0].Rows.Count > 0)
commisionPercentage = dsCommSlab.Tables[0].Rows[0]["Commission"].ToString();// Change it
else
commisionPercentage = "0";
string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
// string commisionPercentage = dsBalance.Tables[0].Rows[0]["CommisionPercentage"].ToString();
string agentId = dsBalance.Tables[0].Rows[0]["AgentId"].ToString();
string actualFare = Session["TotalFare"].ToString();
string deductAmount = Convert.ToString(Convert.ToDouble(actualFare.ToString()) -
((Convert.ToDouble(actualFare.ToString()) * Convert.ToDouble(commisionPercentage)) / 100));
string commisionFare = Convert.ToString(Convert.ToDouble(actualFare.ToString()) - Convert.ToDouble(deductAmount));
Session["AgentId_Agent"] = agentId;
Session["ActualFare_Agent"] = actualFare;
Session["CommisionFare_Agent"] = commisionFare;
Session["CommisionPercentage_Agent"] = commisionPercentage;
Session["DeductAmount_Agent"] = deductAmount;
if (Convert.ToDouble(balance) >= Convert.ToDouble(deductAmount))
{
dsBookingResponse = GetIntBookingRequest();
}
else { lblMsg.Text = "Please contact administrator."; return; }
//}
//else if (Session["Role"].ToString() == "User")
//{
//}
#region Save Response
FlightBAL objFlightBal = new FlightBAL();
if (dsBookingResponse.Tables.Count > 0)
{
if (dsBookingResponse.Tables["BookingResponse"].Rows.Count > 0)
{
objFlightBal.ReferenceNo = Common.GetFlightsReferenceNo("LJIF");
objFlightBal.TransId = dsBookingResponse.Tables["BookingResponse"].Rows[0]["transid"].ToString();
objFlightBal.Status = dsBookingResponse.Tables["BookingResponse"].Rows[0]["status"].ToString();
objFlightBal.AdultPax = Convert.ToInt32(dsBookingResponse.Tables["BookingResponse"].Rows[0]["noadults"].ToString());
objFlightBal.InfantPax = Convert.ToInt32(dsBookingResponse.Tables["BookingResponse"].Rows[0]["noinfant"].ToString());
objFlightBal.ChildPax = Convert.ToInt32(dsBookingResponse.Tables["BookingResponse"].Rows[0]["nochild"].ToString());
objFlightBal.Origin_Destination_Id = dsBookingResponse.Tables["OriginDestinationOption"].Rows[0]["id"].ToString();
objFlightBal.Origin_Destination_Key = dsBookingResponse.Tables["OriginDestinationOption"].Rows[0]["key"].ToString();
objFlightBal.ActualBasefare = Convert.ToDecimal(dsBookingResponse.Tables["FareDetails"].Rows[0]["ActualBasefare"].ToString());
objFlightBal.Tax = Convert.ToDecimal(dsBookingResponse.Tables["FareDetails"].Rows[0]["Tax"].ToString());
objFlightBal.STax = Convert.ToDecimal(dsBookingResponse.Tables["FareDetails"].Rows[0]["STax"].ToString());
objFlightBal.TCharge = Convert.ToDecimal(dsBookingResponse.Tables["FareDetails"].Rows[0]["TCharge"].ToString());
objFlightBal.Scharge = Convert.ToDecimal(dsBookingResponse.Tables["FareDetails"].Rows[0]["Scharge"].ToString());
objFlightBal.TDiscount = Convert.ToDecimal(dsBookingResponse.Tables["FareDetails"].Rows[0]["TDiscount"].ToString());
objFlightBal.TMarkUp = Convert.ToDecimal(dsBookingResponse.Tables["FareDetails"].Rows[0]["TMarkUp"].ToString());
objFlightBal.TPartnerCommission = Convert.ToDecimal(dsBookingResponse.Tables["FareDetails"].Rows[0]["TPartnerCommission"].ToString());
objFlightBal.TSDiscount = Convert.ToDecimal(dsBookingResponse.Tables["FareDetails"].Rows[0]["TSDiscount"].ToString());
objFlightBal.CreatedBy = Convert.ToInt32(Session["UserID"]);
objFlightBal.TripMode = "One";
DataTable dtflightBookingId = objFlightBal.AddDInternationalFlightBooking(objFlightBal);
string flightBookingId = dtflightBookingId.Rows[0]["FlightBookingID"].ToString();
//Do the Insert of Flgiht Segment
objFlightBal.FlightBookingID = flightBookingId.ToString();
if (dsBookingResponse.Tables["FlightSegment"].Rows.Count > 0)
{
for (int j = 0; j < dsBookingResponse.Tables["FlightSegment"].Rows.Count; j++)
{
objFlightBal.AirEquipType = dsBookingResponse.Tables["FlightSegment"].Rows[j]["AirEquipType"].ToString();
objFlightBal.ArrivalAirportCode = dsBookingResponse.Tables["FlightSegment"].Rows[j]["ArrivalAirportCode"].ToString();
objFlightBal.ArrivalAirportName = dsBookingResponse.Tables["FlightSegment"].Rows[j]["ArrivalAirportName"].ToString();
objFlightBal.ArrivalDateTime = dsBookingResponse.Tables["FlightSegment"].Rows[j]["ArrivalDateTime"].ToString();
objFlightBal.DepartureAirportCode = dsBookingResponse.Tables["FlightSegment"].Rows[j]["DepartureAirportCode"].ToString();
objFlightBal.DepartureAirportName = dsBookingResponse.Tables["FlightSegment"].Rows[j]["DepartureAirportName"].ToString();
objFlightBal.DepartureDateTime = dsBookingResponse.Tables["FlightSegment"].Rows[j]["DepartureDateTime"].ToString();
objFlightBal.FlightNumber = dsBookingResponse.Tables["FlightSegment"].Rows[j]["FlightNumber"].ToString();
objFlightBal.MarketingAirlineCode = dsBookingResponse.Tables["FlightSegment"].Rows[j]["MarketingAirlineCode"].ToString();
objFlightBal.OperatingAirlineCode = dsBookingResponse.Tables["FlightSegment"].Rows[j]["OperatingAirlineCode"].ToString();
objFlightBal.OperatingAirlineName = dsBookingResponse.Tables["FlightSegment"].Rows[j]["OperatingAirlineName"].ToString();
objFlightBal.OperatingAirlineFlightNumber = dsBookingResponse.Tables["FlightSegment"].Rows[j]["OperatingAirlineFlightNumber"].ToString();
objFlightBal.NumStops = dsBookingResponse.Tables["FlightSegment"].Rows[j]["NumStops"].ToString();
objFlightBal.LinkSellAgrmnt = dsBookingResponse.Tables["FlightSegment"].Rows[j]["LinkSellAgrmnt"].ToString();
objFlightBal.Conx = dsBookingResponse.Tables["FlightSegment"].Rows[j]["Conx"].ToString();
objFlightBal.AirpChg = dsBookingResponse.Tables["FlightSegment"].Rows[j]["AirpChg"].ToString();
objFlightBal.InsideAvailOption = dsBookingResponse.Tables["FlightSegment"].Rows[j]["InsideAvailOption"].ToString();
objFlightBal.GenTrafRestriction = dsBookingResponse.Tables["FlightSegment"].Rows[j]["GenTrafRestriction"].ToString();
objFlightBal.DaysOperates = dsBookingResponse.Tables["FlightSegment"].Rows[j]["DaysOperates"].ToString();
//.........这里部分代码省略.........
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
objArzooHotelAPILayer = ArzooHotelFactoryManager.GetArzooHotelAPILayerObject();
objArzooHotelAPILayer.UserName = ArzooHotelConstants.USERNAME;
objArzooHotelAPILayer.UserId = ArzooHotelConstants.USERID;
objArzooHotelAPILayer.UserType = ArzooHotelConstants.USERTYPE;
objArzooHotelAPILayer.Password = ArzooHotelConstants.PASSWORD;
objArzooHotelAPILayer.PartnerId = ArzooHotelConstants.PARTNERID;
lblMsg.Text = "";
this.Page.Title = "LoveJourney - Hotel - Ticket";
if (!IsPostBack)
{
if (Session["HotelRefNo"] != null)
{
string strRefNo = Session["HotelRefNo"].ToString();
HotelBAL obj = new HotelBAL();
obj.ReferenceNo = strRefNo;
DataSet ds = obj.GetHotelProvisional();
if (ds != null)
{
string hotelId = ""; string webService = ""; string ratePlanCode = ""; string roomTypeCode = "";
string cityName = ""; string allocavailResult = "";
string allocidResult = ""; string fromDate = ""; string toDate = ""; string roomType = "";
string wsKey = ""; string roomBasis = ""; string title = "";
string firstName = ""; string middleName = ""; string lastName = ""; int noOfRooms = 0;
int[] noOfAdultsInARoom = null; int[] noOfChildsInARoom = null;
int[] firstChildAge = null; int[] secondChildAge = null;
string roomStayCandidate = "";
DataRow dr = ds.Tables[0].Rows[0];
hotelId = dr["HotelId"].ToString();
webService = dr["WebService"].ToString();
ratePlanCode = dr["RatePlanType"].ToString();
roomTypeCode = dr["RoomTypeCode"].ToString();
cityName = dr["HotelCity"].ToString();
allocavailResult = dr["FromAllocation"].ToString();
allocidResult = dr["AllocationId"].ToString();
roomType = dr["RoomType"].ToString();
firstName = dr["FirstName"].ToString();
middleName = dr["MiddleName"].ToString();
lastName = dr["LastName"].ToString();
wsKey = dr["WsKey"].ToString();
roomBasis = dr["RoomBasis"].ToString();
title = dr["Title"].ToString();
noOfRooms = Convert.ToInt32(dr["NoOfRooms"].ToString());
roomStayCandidate = dr["RoomStayCandidate"].ToString();
string[] strValues = roomStayCandidate.Split(':');
fromDate = ConvertDate(strValues[1].ToString());
fromDate = fromDate.Replace('-', '/');
toDate = ConvertDate(strValues[2].ToString());
toDate = toDate.Replace('-', '/');
noOfRooms = Convert.ToInt32(strValues[3].ToString());
noOfAdultsInARoom = new int[noOfRooms];
noOfChildsInARoom = new int[noOfRooms];
firstChildAge = new int[noOfRooms];
secondChildAge = new int[noOfRooms];
int j = 0;
for (int i = 0; i < noOfRooms; i++)
{
if (i == 0)
{
j = 0;
}
else
{
j = 4 * i;
}
noOfAdultsInARoom[i] = Convert.ToInt32(strValues[4 + j].ToString());
noOfChildsInARoom[i] = Convert.ToInt32(strValues[5 + j].ToString());
firstChildAge[i] = Convert.ToInt32(strValues[6 + j].ToString());
secondChildAge[i] = Convert.ToInt32(strValues[7 + j].ToString());
}
objBAL = new ClsBAL();
DataSet dsBalance = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"].ToString()));
DataSet dsCommSlabRet = objBAL.GetCommissionSlab(Session["Role"].ToString(), "Hotels","");
string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
// string commisionPercentage = dsBalance.Tables[0].Rows[0]["CommisionPercentage"].ToString();
string commisionPercentage = dsCommSlabRet.Tables[0].Rows[0]["Commission"].ToString();
string agentId = dsBalance.Tables[0].Rows[0]["AgentId"].ToString();
string actualFare = dr["HotelTotalFare"].ToString().ToString();
string deductAmount = Convert.ToString(Convert.ToDouble(actualFare.ToString()) -
((Convert.ToDouble(actualFare.ToString()) * Convert.ToDouble(commisionPercentage)) / 100));
string commisionFare = Convert.ToString(Convert.ToDouble(actualFare.ToString()) - Convert.ToDouble(deductAmount));
Session["AgentId_Agent"] = agentId;
Session["ActualFare_Agent"] = actualFare;
//.........这里部分代码省略.........
示例4: gvHotelRooms_RowDataBound
protected void gvHotelRooms_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
GridView gv = sender as GridView;
if (e.Row.RowType == DataControlRowType.DataRow)
{
string extGuestTotal = ""; string roomTotal = ""; string servicetaxTotal = ""; string discount = ""; string commission = "";
extGuestTotal = Convert.ToString(gv.DataKeys[e.Row.RowIndex].Values["extGuestTotal"].ToString());
roomTotal = Convert.ToString(gv.DataKeys[e.Row.RowIndex].Values["roomTotal"].ToString());
//Rajini ...Added for calculating the total amount based on no of days
double RoomTtl = Convert.ToDouble(roomTotal.ToString()) * Convert.ToDouble(ViewState["NoOfdays"].ToString());
//Rajiniend
RoomTtl = RoomTtl + ((RoomTtl * 10) / 100);
servicetaxTotal = Convert.ToString(gv.DataKeys[e.Row.RowIndex].Values["servicetaxTotal"].ToString());
discount = Convert.ToString(gv.DataKeys[e.Row.RowIndex].Values["discount"].ToString());
commission = Convert.ToString(gv.DataKeys[e.Row.RowIndex].Values["commission"].ToString());
// Changed roomTotal to RoomTtl by rajini
LinkButton lbtnFare = (LinkButton)e.Row.FindControl("lbtnFare");
lbtnFare.ToolTip = " RoomRate: " + RoomTtl + " \n Extra Guest Charge: " + extGuestTotal
+ " \n Service Tax: " + servicetaxTotal; //+ " \n Discount: " + discount + " \n Commission: " + commission;
double total = 0;
total = (Convert.ToDouble(RoomTtl) + Convert.ToDouble(extGuestTotal) + Convert.ToDouble(servicetaxTotal)); //- (Convert.ToDouble(discount) + Convert.ToDouble(commission));
lbtnFare.Text = total.ToString();
lbtnFare.CommandName = lbtnFare.Text.ToString();/////ArzooTotalFare
lbtnFare.CommandArgument = lbtnFare.ToolTip.ToString();/////ArzooFareDetails
lbtnFare.ValidationGroup = "0.00";/////AgentMarkUpFare
LinkButton lbtnNetFare = (LinkButton)e.Row.FindControl("lbtnNetFare");
string actualFare = lbtnFare.Text.ToString().ToString();
string deductAmount = Convert.ToString(Convert.ToDouble(actualFare.ToString()));
if (Session["UserID"] != null)
{
if (Session["Role"].ToString() == "Agent")
{
if (ViewState["commisionPercentage"] == null)
{
ClsBAL objBAL = new ClsBAL();
DataSet dsCommSlabRet = objBAL.GetCommissionSlab(Session["Role"].ToString(), "Hotels", "");
ViewState["commisionPercentage"] = dsCommSlabRet.Tables[0].Rows[0]["Commission"].ToString();
}
deductAmount = Convert.ToString(Convert.ToDouble(actualFare.ToString()) -
((Convert.ToDouble(actualFare.ToString()) * Convert.ToDouble(ViewState["commisionPercentage"].ToString())) / 100));
}
}
string commisionFare = Convert.ToString(Convert.ToDouble(actualFare.ToString()) - Convert.ToDouble(deductAmount));
lbtnNetFare.Text = Convert.ToDecimal(deductAmount.ToString()).ToString("0.00", System.Globalization.CultureInfo.InvariantCulture).ToString();
lbtnNetFare.ToolTip = " ActualFare: " + total.ToString() + " \n CommissionFare: "
+ Convert.ToDecimal(commisionFare).ToString("0.00", System.Globalization.CultureInfo.InvariantCulture);// +" \n NetFare: " + lbtnNetFare.Text.ToString();
lbtnNetFare.Visible = false;
if (Session["UserID"] != null)
{
if (Session["Role"].ToString() == "Agent")
{
if (ViewState["MarkUp"] == null)
{
Class1 objBal = new Class1();
DataSet objDataSet = new DataSet();
objBal.ScreenInd = Master123.gettopmarkup;
objBal.Agentid = Convert.ToInt32(Session["UserID"].ToString());
objBal.Type = "Hotels";
objDataSet = (DataSet)objBal.fnGetData();
string markUpAmount = "0";
ViewState["MarkUp"] = markUpAmount;
if (objDataSet != null)
{
if (objDataSet.Tables.Count > 0)
{
markUpAmount = objDataSet.Tables[0].Rows[0]["MarkUpAmount"].ToString();
ViewState["MarkUp"] = markUpAmount;
if (true)
{
lbtnFare.ToolTip = " RoomRate: " + (RoomTtl + Convert.ToDouble(markUpAmount)) + " \n Extra Guest Charge: "
+ extGuestTotal + " \n Service Tax: " + servicetaxTotal;/////ArzooTotalFare_Agent
total = (Convert.ToDouble(RoomTtl) + Convert.ToDouble(extGuestTotal) + Convert.ToDouble(servicetaxTotal) + Convert.ToDouble(markUpAmount));
}
// else if (objDataSet.Tables[0].Rows[0]["AddSubtract"].ToString() == "Subtract")
// {
// lbtnFare.ToolTip = " RoomRate: " + (RoomTtl - Convert.ToDouble(markUpAmount)) + " \n Extra Guest Charge: "
//+ extGuestTotal + " \n Service Tax: " + servicetaxTotal;/////ArzooTotalFare_Agent
// total = (Convert.ToDouble(RoomTtl) + Convert.ToDouble(extGuestTotal) + Convert.ToDouble(servicetaxTotal) - Convert.ToDouble(markUpAmount));
// }
lbtnFare.Text = total.ToString();
lbtnFare.CommandName = lbtnFare.Text.ToString();/////ArzooTotalFare
lbtnFare.CommandArgument = lbtnFare.ToolTip.ToString();/////ArzooFareDetails
lbtnFare.ValidationGroup = markUpAmount;/////AgentMarkUpFare
}
}
//.........这里部分代码省略.........
示例5: gdvIntFlights_RowDataBound
protected void gdvIntFlights_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
if (Session["dsIntFlights"] != null)
{
if (e.Row.RowType == DataControlRowType.Header)
{
dsIntFlights = (DataSet)Session["dsIntFlights"];
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label FlightSegments_ID = (Label)e.Row.FindControl("lblFlightSegments_ID");
Label lblConx = (Label)e.Row.FindControl("lblConx");
if (lblConx.Text != "Y")
{
Label airlinename = (Label)e.Row.FindControl("lblAirlineNameMrk");
DataTable dtFlightsSegment = dsIntFlights.Tables["FlightSegment"];
if (dtFlightsSegment.Rows.Count > 0)
{
DataRow[] rowFilghtSegment = dtFlightsSegment.Select("FlightSegments_ID = '" + FlightSegments_ID.Text + "'");
DataTable dtinnergrid = dtFlightsSegment.Clone();
foreach (DataRow item in rowFilghtSegment)
{
dtinnergrid.ImportRow(item);
}
GridView gdvconnectingflights = (GridView)e.Row.FindControl("gdvconnectingflights");
gdvconnectingflights.DataSource = dtinnergrid;
gdvconnectingflights.DataBind();
//FlightSegmentsID = rowFilghtSegment[0]["FlightSegments_Id"].ToString();
}
DataTable dtFareDetails1 = dsIntFlights.Tables["FareDetails"];
DataRow[] dtFareDetails = dtFareDetails1.Select("FareDetails_Id=" + FlightSegments_ID.Text);
Label lblBaseFare = (Label)e.Row.FindControl("lblBaseFare");
Label lblTax = (Label)e.Row.FindControl("lblTax");
Label lblSTax = (Label)e.Row.FindControl("lblSTax");
Label lblSCharge = (Label)e.Row.FindControl("lblSCharge");
Label lblTDiscount = (Label)e.Row.FindControl("lblTDiscount");
Label lblTotal = (Label)e.Row.FindControl("lblTotal");
Label lblFare = (Label)e.Row.FindControl("lblFare");
Label lblTCharge = (Label)e.Row.FindControl("lblTCharge");
foreach (DataRow rows in dtFareDetails)
{
string ActualBaseFare = rows[0].ToString();
string Tax = rows[1].ToString();
string STax = rows[2].ToString();
string TCharge = rows[3].ToString();
string SCharge = rows[4].ToString();
string TDiscount = rows[5].ToString();
string TMarkup = rows[6].ToString();
lblBaseFare.Text = ActualBaseFare.ToString();
lblTax.Text = Tax.ToString();
lblSTax.Text = STax.ToString();
lblSCharge.Text = SCharge.ToString();
lblTDiscount.Text = TDiscount.ToString();
lblTCharge.Text = (Convert.ToDouble(TCharge.ToString()) + Convert.ToDouble(TMarkup.ToString())).ToString();
decimal totalFare = Convert.ToDecimal(ActualBaseFare) + Convert.ToDecimal(Tax) + Convert.ToDecimal(STax) + Convert.ToDecimal(TCharge) + Convert.ToDecimal(TMarkup);// + Convert.ToDecimal(SCharge) + Convert.ToDecimal(TDiscount);
// Label lblFare = (Label)e.Row.FindControl("lblFare");
// lblFare.Text = totalFare.ToString("####0.0");
lblFare.Text = lblTotal.Text = totalFare.ToString("####0.0");
#region Calculating SNF and HNF internatoional flights
if (Session["UserID"] != null)
{
if (Session["Role"].ToString() == "Agent")
{
ClsBAL objBAL1 = new ClsBAL();
DataSet dsCommSlab = objBAL1.GetCommissionSlab(Session["Role"].ToString(), "InterNationalFlights", airlinename.Text);
string commisionPercentage = string.Empty;
if (dsCommSlab != null)
{
if (dsCommSlab.Tables[0].Rows.Count > 0)
{
commisionPercentage = dsCommSlab.Tables[0].Rows[0]["Commission"].ToString();
}
else
{
commisionPercentage = "0";
}
}
else
{
commisionPercentage = "0";
}
Label lblHNFFare = (Label)e.Row.FindControl("lblHNFFare");
Label lblOnewayAgentcomm=(Label)e.Row.FindControl("lblOnewayAgentcomm");
double CommissionFare = (Convert.ToDouble(totalFare) * Convert.ToDouble(commisionPercentage)) / Convert.ToDouble(100);
lblOnewayAgentcomm.Text="Com:" +CommissionFare.ToString("####0");
double DeductAmount = Convert.ToDouble(totalFare) - CommissionFare;
lblHNFFare.Text = DeductAmount.ToString();
#region Adding mark up price of agent
//.........这里部分代码省略.........
示例6: gvCarresult_RowDataBound
protected void gvCarresult_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (Session["UserID"] != null)
{
if (Session["Role"].ToString() == "Agent")
{
ClsBAL objBAL = new ClsBAL();
DataSet dsCommSlab = objBAL.GetCommissionSlab(Session["Role"].ToString(), "Car", "");
string commisionPercentage = string.Empty;
if (dsCommSlab != null)
{
if (dsCommSlab.Tables[0].Rows.Count > 0)
{
commisionPercentage = dsCommSlab.Tables[0].Rows[0]["Commission"].ToString();
}
else
{
commisionPercentage = "0";
}
}
else
{
commisionPercentage = "0";
}
Label lblHNFFare = (Label)e.Row.FindControl("lblHNFFare");
Label lblBasicPrice = (Label)e.Row.FindControl("lblBasicPrice");
total = Convert.ToDouble(lblBasicPrice.Text);
double CommissionFare = ((total * Convert.ToDouble(commisionPercentage)) / 100);
double DeductAmount = total - CommissionFare;
lblHNFFare.Text = Convert.ToDouble(DeductAmount).ToString();
double newcomm = total - Convert.ToDouble(DeductAmount);
int newcomm1 = Convert.ToInt32(newcomm);
Label lblagentcomm1 = (Label)e.Row.FindControl("lblagentcomm1");
lblagentcomm1.Text = "com:" + newcomm1.ToString();
#region Markupfarefor Individual agents
Class1 objBal = new Class1();
DataSet objDataSet = new DataSet();
objBal.ScreenInd = Master123.gettopmarkup;
objBal.Agentid = Convert.ToInt32(Session["UserID"].ToString());
objBal.Type = "Cabs";
objDataSet = (DataSet)objBal.fnGetData();
string markUpAmount = "0";
ViewState["MarkUp"] = markUpAmount;
if (objDataSet != null)
{
if (objDataSet.Tables.Count > 0)
{
markUpAmount = objDataSet.Tables[0].Rows[0]["MarkUpAmount"].ToString();
ViewState["MarkUp"] = markUpAmount;
}
}
double markupfare = Convert.ToDouble(ViewState["MarkUp"]);
total += markupfare;
lblBasicPrice.Text = total.ToString();
#endregion
}
}
}
else
{
e.Row.Visible = false;
}
}
示例7: btnProceedToPayment_Click
//.........这里部分代码省略.........
blockseats.EmailId = txtEmailId.Text;
blockseats.ProviderName = BookingDetails[19].ToString();
blockseats.BookingId = bookingid;
string blockresult = client.blockTicket(blockseats);
DataSet ds = convertJsonStringToDataSet(blockresult);
if (ds != null)
{
if (ds.Tables[0].Rows.Count > 0)
{
if (ds.Tables[0].Columns.Contains("Status"))
{
if (ds.Tables[0].Rows[0]["Status"].ToString().ToUpper() == "SUCCESS")
{
if (ds.Tables[0].Columns.Contains("BookingID"))
{
blockseats.BookingId = ds.Tables[0].Rows[0]["BookingID"].ToString();
lblMsg.Text = Convert.ToString(ds.Tables[0].Rows[0]["Status"]);
}
}
else
{
lblMsg.Text = ds.Tables[0].Rows[0]["message"].ToString();
return;
}
}
}
}
if (Session["UserID"] != null)
{
if (Session["Role"].ToString() == "Agent")
{
ClsBAL objBAL = new ClsBAL();
DataSet dsBalance = objBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"]));
DataSet dsCommSlab = objBAL.GetCommissionSlab(Session["Role"].ToString(), "Bus", provider); // Change it
if (dsCommSlab != null)
{
if (dsCommSlab.Tables[0].Rows.Count > 0)
{
string commisionPercentage = dsCommSlab.Tables[0].Rows[0]["Commission"].ToString();// Change it
string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
//string commisionPercentage = dsBalance.Tables[0].Rows[0]["CommisionPercentage"].ToString();
string agentId = dsBalance.Tables[0].Rows[0]["AgentId"].ToString();
string actualFare;
string deductAmount;
string commisionFare;
if (ViewState["MarkUp"] != null)
{
double Am = Convert.ToDouble(lblTotalAmountPayable.Text.ToString()) - Convert.ToDouble(ViewState["MarkUp"].ToString());
actualFare = Am.ToString();
deductAmount = Convert.ToString(Convert.ToDouble(actualFare.ToString()) - ((Convert.ToDouble(actualFare.ToString()) * Convert.ToDouble(commisionPercentage)) / 100));
commisionFare = Convert.ToString(Convert.ToDouble(actualFare.ToString()) - Convert.ToDouble(deductAmount));
}
else
{
actualFare = lblTotalAmountPayable.Text.ToString();
deductAmount = Convert.ToString(Convert.ToDouble(lblTotalAmountPayable.Text.ToString()) - ((Convert.ToDouble(lblTotalAmountPayable.Text.ToString()) * Convert.ToDouble(commisionPercentage)) / 100));
commisionFare = Convert.ToString(Convert.ToDouble(lblTotalAmountPayable.Text.ToString()) - Convert.ToDouble(deductAmount));
}
Session["AgentId_Agent"] = agentId;
Session["ActualFare_Agent"] = actualFare;
Session["CommisionFare_Agent"] = commisionFare;
Session["CommisionPercentage_Agent"] = commisionPercentage;
Session["DeductAmount_Agent"] = deductAmount;
示例8: btnGo_Click
//.........这里部分代码省略.........
Response.Redirect("~/Pay.aspx?val=car", false);
}
}
}
if(Session["UserId"]==null)
{
if (str == "SUCCESS")
{
Response.Redirect("~/Pay.aspx?val=car", false);
}
else
{
lblText.Text = "Booking is failed.Please try later";
}
}
else if (Session["UserId"] != null && Session["Role"].ToString()=="Admin")
{
if (Session["Role"].ToString() == "Admin")
{
Response.Redirect("~/CarTicket.aspx", false);
}
}
else
{
if (Session["Role"] != null)
{
if (Session["Role"].ToString() == "Agent")
{
ClsBAL objBal = new ClsBAL();
DataSet dsBalance = objBal.GetAgentByUserId(Convert.ToInt32(Session["UserID"].ToString()));
DataSet dsCommSlab = objBal.GetCommissionSlab(Session["Role"].ToString(), "Car", ""); // Change it
string commisionPercentage = string.Empty;
if (dsCommSlab != null)
{
if (dsCommSlab.Tables[0].Rows.Count > 0)
{
commisionPercentage = dsCommSlab.Tables[0].Rows[0]["Commission"].ToString();// Change it
}
else
{
commisionPercentage = "0";
}
}
else
{
commisionPercentage = "0";
}
string balance = dsBalance.Tables[0].Rows[0]["Balance"].ToString();
string agentId = dsBalance.Tables[0].Rows[0]["AgentId"].ToString();
string TotalFare = BasicPrice.Text;
string actualFare = TotalFare;
string deductAmount = Convert.ToString(Convert.ToDouble(actualFare.ToString()) -
((Convert.ToDouble(actualFare.ToString()) * Convert.ToDouble(commisionPercentage)) / 100));
string commisionFare = Convert.ToString(Convert.ToDouble(actualFare.ToString()) - Convert.ToDouble(deductAmount));
Session["AgentId_Agent"] = agentId;
Session["ActualFare_Agent"] = actualFare;
Session["CommisionFare_Agent"] = commisionFare;
Session["CommisionPercentage_Agent"] = commisionPercentage;
Session["DeductAmount_Agent"] = deductAmount;