/// <summary> /// Date Created: 01/Jul/2014 /// Created By: Josephine Gad /// (description) Bind Airport /// </summary> private void BindAirport(Int16 iLoadType) { List <AirportDTO> listAirport = new List <AirportDTO>(); if (iLoadType == 0) { if (Session["HotelAirportBrand_Airport"] != null) { listAirport = (List <AirportDTO>)Session["HotelAirportBrand_Airport"]; } } else { string sRegion = GlobalCode.Field2Int(uoDropDownListRegion.SelectedValue).ToString(); listAirport = AirBLL.GetAirportByRegion(sRegion, uoTextBoxAirport.Text.Trim()); } uoDropDownListAirport.Items.Clear(); ListItem item = new ListItem("--Select Airport--", "0"); uoDropDownListAirport.Items.Add(item); uoDropDownListAirport.DataSource = listAirport; uoDropDownListAirport.DataTextField = "AirportNameString"; uoDropDownListAirport.DataValueField = "AirportIDString"; uoDropDownListAirport.DataBind(); string sAirport = GlobalCode.Field2String(Session["Airport"]); if (uoDropDownListAirport.Items.FindByValue(sAirport) != null) { uoDropDownListAirport.SelectedValue = sAirport; } }
/// <summary> /// Date Created: 04/Mar/2014 /// Created By: Josephine Gad /// (description) Bind Airport By Region /// ----------------------------------- /// </summary> private void BindAirport() { //DataTable dt = null; try { //dt = AirBLL.GetAirportByCountry("0", uoDropDownListRegion.SelectedValue, "", "0"); List <AirportDTO> list = new List <AirportDTO>(); list = AirBLL.GetAirportByRegion(uoDropDownListRegion.SelectedValue, ""); uoDropDownListAirport.Items.Clear(); uoDropDownListAirport.Items.Insert(0, new ListItem("--SELECT AIRPORT--", "0")); if (list.Count > 0) { uoDropDownListAirport.DataSource = list; uoDropDownListAirport.DataValueField = "AirportIDString"; uoDropDownListAirport.DataTextField = "AirportNameString"; } uoDropDownListAirport.DataBind(); } catch (Exception ex) { throw ex; } }
/// <summary> /// Date Created: 19/01/2012 /// Created By: Gelo Oquialda /// (description) Bind Airport /// </summary> private void BindAirport() { DataTable dt = null; try { dt = AirBLL.GetAirportByCountry(uoDropDownListCountry.SelectedValue, uoDropDownListRegion.SelectedValue, uoTextBoxSearchAirport.Text, "0"); uoDropDownListAirport.Items.Clear(); uoDropDownListAirport.DataSource = dt; uoDropDownListAirport.DataTextField = "colAirportNameVarchar"; uoDropDownListAirport.DataValueField = "colAirportIDInt"; uoDropDownListAirport.DataBind(); uoDropDownListAirport.Items.Insert(0, new ListItem("--SELECT AIRPORT--", "0")); if (uoDropDownListAirport.Items.FindByValue(uoHiddenFieldAirport.Value) != null) { uoDropDownListAirport.SelectedValue = uoHiddenFieldAirport.Value; } } catch (Exception ex) { throw ex; } finally { if (dt != null) { dt.Dispose(); } } }
/// <summary> /// Date Created: 27/01/2012 /// Created By: Gabriel Oquialda /// (description) Loads airport code with airport name /// </summary> private void airportCodeNameLoad() { IDataReader dr = null; try { Int32 AirportID = Convert.ToInt32(uoHiddenFieldAirportID.Value); dr = AirBLL.GetAirportCodeName(AirportID); if (dr.Read()) { this.uoTextBoxAirport.Text = dr["Airport"].ToString(); } } catch (Exception ex) { throw ex; } finally { if (dr != null) { dr.Close(); dr.Dispose(); } } }
protected void uoButtonSave_Click(object sender, EventArgs e) { try { string strLogDescription; string strFunction; if (uoHiddenFieldAirportID.Value != null || uoHiddenFieldAirportID.Value != "") { strLogDescription = "Airport hotel assignment added."; strFunction = "uoButtonSave_Click"; Int32 AirportHotelID = AirBLL.InsertAirportHotel(Convert.ToInt32(uoHiddenFieldAirportID.Value), Convert.ToInt32(uoDropDownListHotel.SelectedValue), GlobalCode.Field2String(Session["UserName"]), GlobalCode.Field2TinyInt(uoHiddenFieldRoomType.Value), strLogDescription, strFunction, Path.GetFileName(Request.Path)); //DateTime currentDate = CommonFunctions.GetCurrentDateTime(); //BLL.AuditTrailBLL.InsertLogAuditTrail(AirportHotelID, "", strLogDescription, strFunction, Path.GetFileName(Request.Path), // CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); OpenParentPage(); } } catch (Exception ex) { AlertMessage(ex.Message); } }
protected void uoButtonSave_Click(object sender, EventArgs e) { try { string strLogDescription; string strFunction; bool IsChargedToCrew = uoCheckBoxChargedToCrew.Checked; //if (uoDropDownListAirStatus.SelectedValue != "Cancelled" && uoDropDownListAirStatus.SelectedValue != "Rebooked") //{ // IsChargedToCrew = false; //} AirBLL.UpdateAirBooking(GlobalCode.Field2Int(Session["strTravelLocatorID"]).ToString(), GlobalCode.Field2Int(Session["strSFSeqNo"]).ToString(), uoDropDownListAirStatus.SelectedValue, IsChargedToCrew, uoTextBoxRemarks.Text, GlobalCode.Field2String(Session["UserName"])); //Insert log audit trail (Gabriel Oquialda - 18/11/2011) strLogDescription = "Air booking updated."; strFunction = "uoButtonSave_Click"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(GlobalCode.Field2Int(Session["strTravelLocatorID"]), GlobalCode.Field2Int(Session["strSFSeqNo"]).ToString(), strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); OpenParentPage(); } catch (Exception ex) { AlertMessage(ex.Message); } }
private void AirGetAirline() { DataTable AirlineDataTable = null; try { AirlineDataTable = AirBLL.GetAirline(); uoDropDownListAirline.Items.Clear(); uoDropDownListAirline.Items.Add(new ListItem("--Select Airline--", "")); if (AirlineDataTable.Rows.Count > 0) { uoDropDownListAirline.DataSource = AirlineDataTable; uoDropDownListAirline.DataTextField = "Airline"; uoDropDownListAirline.DataValueField = "colAirlineCodeVarchar"; } uoDropDownListAirline.DataBind(); } catch (Exception ex) { throw ex; } finally { if (AirlineDataTable != null) { AirlineDataTable.Dispose(); } } }
private void AirGetTravelDetailsOther() { IDataReader dr = null; try { uoDivSabre.Visible = false; uoDivOther.Visible = true; uoTextBoxSeafarer2.Text = AirGetSeafarerName(); AirGetAirline(); if (uoHiddenFieldAirID.Value != "0") { dr = AirBLL.GetSFAirTravelDetailsOtherById(uoHiddenFieldAirID.Value); if (dr.Read()) { uoTextBoxDepartureDatetime2.Text = dr["colDepartureDateTime"].ToString(); //uoTextBoxDepartureDatetime2.Text = DateTime.Parse(uoTextBoxDepartureDatetime2.Text).ToString("dd-MMM-yyyy HHmm"); uoTextBoxArrivalDatetime2.Text = dr["colArrivalDateTime"].ToString(); //uoTextBoxArrivalDatetime2.Text = DateTime.Parse(uoTextBoxArrivalDatetime2.Text).ToString("dd-MMM-yyyy HHmm"); uoDropDownListAirline.SelectedValue = dr["colMarketingAirlineCodeVarchar"].ToString(); uoTextBoxFlightNo2.Text = dr["colFlightNoVarchar"].ToString(); uoTextBoxTicketNo2.Text = dr["colTicketNoVarchar"].ToString(); uoTextBoxRemarks2.Text = dr["colRemarksVarchar"].ToString(); uoTextBoxDepartureLoc2.Text = dr["colDepartureAirportLocationCodeVarchar"].ToString(); uoTextBoxArrivalLoc2.Text = dr["colArrivalAirportLocationCodeVarchar"].ToString(); if (dr["colAirStatusVarchar"] != null) { if (dr["colAirStatusVarchar"].ToString() != "") { uoDropDownListAirStatus2.SelectedValue = dr["colAirStatusVarchar"].ToString(); if (uoDropDownListAirStatus2.SelectedValue == "Cancelled" || uoDropDownListAirStatus2.SelectedValue == "Rebooked") { uoCheckBoxChargedToCrew2.Visible = true; if (dr["colIsBilledToCrewBit"] != null) { uoCheckBoxChargedToCrew2.Checked = (bool)dr["colIsBilledToCrewBit"]; } } } } } } } catch (Exception ex) { throw ex; } finally { if (dr != null) { dr.Dispose(); } } }
/// <summary> /// Date Created: 04/Jul/2014 /// Created By: Josephine Gad /// (description) Bind Airport /// </summary> private void BindAirport() { List <AirportDTO> listAirport = new List <AirportDTO>(); List <AirportDTO> listAirportAssigned = new List <AirportDTO>(); listAirport = AirBLL.GetAirportByRegion("0", uoTextBoxAirport.Text.Trim()); listAirportAssigned = GetAirportAssigned(); listAirport.RemoveAll(a => listAirportAssigned.Exists(b => a.AirportIDString == b.AirportIDString)); listAirport = listAirport.OrderBy(a => a.AirportNameString).ToList(); Session["HotelAirportBrandPop_AirportNotAssigned"] = listAirport; uoListViewAirportNotAssigned.DataSource = listAirport; uoListViewAirportNotAssigned.DataBind(); }
/// <summary> /// Date Created: 27/12/2011 /// Created By: Josephine Gad /// (description) Bind Country /// </summary> //private void BindCountry() //{ // DataTable dt = null; // try // { // dt = CountryBLL.CountryListByRegion(uoDropDownListRegion.SelectedValue, ""); // uoDropDownListCountry.Items.Clear(); // uoDropDownListCountry.DataSource = dt; // uoDropDownListCountry.DataTextField = "colCountryNameVarchar"; // uoDropDownListCountry.DataValueField = "colCountryIDInt"; // uoDropDownListCountry.DataBind(); // uoDropDownListCountry.Items.Insert(0, new ListItem("--SELECT COUNTRY--", "0")); // } // catch (Exception ex) // { // throw ex; // } // finally // { // if (dt != null) // { // dt.Dispose(); // } // } //} /// <summary> /// Date Created: 19/01/2012 /// Created By: Gelo Oquialda /// (description) Bind Airport /// ----------------------------------- /// Date Modified: 07/Feb/2014 /// Modified By: Josephine Gad /// (description) Change DataSource from dt to loop to add airport code /// </summary> private void BindAirport() { DataTable dt = null; try { dt = AirBLL.GetAirportByCountry("0", uoDropDownListRegion.SelectedValue, uoTextBoxSearchAirport.Text, "0"); uoDropDownListAirport.Items.Clear(); //uoDropDownListAirport.DataSource = dt; //uoDropDownListAirport.DataTextField = "colAirportNameVarchar"; //uoDropDownListAirport.DataValueField = "colAirportIDInt"; //uoDropDownListAirport.DataBind(); ListItem item; string sValue; string sText; uoDropDownListAirport.Items.Insert(0, new ListItem("--SELECT AIRPORT--", "0")); int iTotal = dt.Rows.Count; for (int i = 0; i < iTotal; i++) { sText = GlobalCode.Field2String(dt.Rows[i]["colAirportCodeVarchar"]).Trim() + "-" + GlobalCode.Field2String(dt.Rows[i]["colAirportNameVarchar"]).Trim(); sValue = GlobalCode.Field2String(dt.Rows[i]["colAirportIDInt"]); item = new ListItem(sText, sValue); uoDropDownListAirport.Items.Add(item); } if (uoDropDownListAirport.Items.FindByValue(uoHiddenFieldAirport.Value) != null) { uoDropDownListAirport.SelectedValue = uoHiddenFieldAirport.Value; } } catch (Exception ex) { throw ex; } finally { if (dt != null) { dt.Dispose(); } } }
/// <summary> /// Date Created: 08/07/2011 /// Created By: Josephine Gad /// (description) Get flight info of seafarer per leg /// ------------------------------------------------- /// Date Modified: 09/08/2011 /// Modified By: Josephine Gad /// (description) Close DataTable /// ------------------------------------------------- /// <summary> private void AirGetTravelDetails() { IDataReader dr = null; try { if (Request.QueryString["Add"] == "1") { AirGetTravelDetailsOther(); } else { if (GlobalCode.Field2Int(Session["strTravelLocatorID"]).ToString() != "0") { uoDivSabre.Visible = true; uoDivOther.Visible = false; dr = AirBLL.GetSFAirTravelDetailsById((Session["strTravelLocatorID"]).ToString(), Session["strSFSeqNo"].ToString()); if (dr.Read()) { uoTextBoxSeafarer.Text = dr["SeafarerName"].ToString(); uoTextBoxDepartureDatetime.Text = dr["colDepartureDateTime"].ToString(); uoTextBoxDepartureDatetime.Text = DateTime.Parse(uoTextBoxDepartureDatetime.Text).ToString("dd-MMM-yyyy HHmm"); uoTextBoxArrivalDatetime.Text = dr["colArrivalDateTime"].ToString(); uoTextBoxArrivalDatetime.Text = DateTime.Parse(uoTextBoxArrivalDatetime.Text).ToString("dd-MMM-yyyy HHmm"); uoTextBoxAirline.Text = dr["colMarketingAirlineCodeVarchar"].ToString(); uoTextBoxFlightNo.Text = dr["colFlightNoVarchar"].ToString(); uoTextBoxTicketNo.Text = dr["colTicketNoVarchar"].ToString(); //uoCheckBoxChargedToCrew.Visible = false; uoTextBoxRemarks.Text = dr["colRemarksVarchar"].ToString(); uoTextBoxDepartureLoc.Text = dr["colDepartureAirportLocationCodeVarchar"].ToString(); uoTextBoxArrivalLoc.Text = dr["colArrivalAirportLocationCodeVarchar"].ToString(); if (dr["colAirStatusVarchar"] != null) { if (dr["colAirStatusVarchar"].ToString() != "") { uoDropDownListAirStatus.SelectedValue = dr["colAirStatusVarchar"].ToString(); //if (uoDropDownListAirStatus.SelectedValue == "Cancelled" || uoDropDownListAirStatus.SelectedValue == "Rebooked") //{ //uoCheckBoxChargedToCrew.Visible = true; if (dr["colIsBilledToCrewBit"] != null) { //uoCheckBoxChargedToCrew.Checked = (bool)dr["colIsBilledToCrewBit"]; if (dr.IsDBNull(dr.GetOrdinal("colIsBilledToCrewBit")) == false) { uoCheckBoxChargedToCrew.Checked = dr.GetBoolean(dr.GetOrdinal("colIsBilledToCrewBit")); } { uoCheckBoxChargedToCrew.Checked = false; } } //} } } } } else { AirGetTravelDetailsOther(); } } } catch (Exception ex) { throw ex; } finally { if (dr != null) { dr.Dispose(); } } }
protected void uoButtonSave2_Click(object sender, EventArgs e) { try { string strLogDescription; string strFunction; bool IsChargedToCrew = uoCheckBoxChargedToCrew2.Checked; if (uoDropDownListAirStatus2.SelectedValue != "Cancelled" && uoDropDownListAirStatus2.SelectedValue != "Rebooked") { IsChargedToCrew = false; } if (Request.QueryString["Add"] == "1") { AirBLL.InsertAirBookingOther(GlobalCode.Field2String(Session["TravelRequestID"]), uoTextBoxFlightNo2.Text, uoTextBoxArrivalDatetime2.Text, uoTextBoxDepartureDatetime2.Text, uoTextBoxDepartureLoc2.Text, uoTextBoxArrivalLoc2.Text, uoDropDownListAirline.SelectedValue, uoTextBoxTicketNo2.Text, uoDropDownListAirStatus2.SelectedValue, GlobalCode.Field2String(Session["UserName"]), Session["strSFStatus"].ToString(), uoTextBoxRemarks2.Text, uoCheckBoxChargedToCrew2.Checked); } else { AirBLL.UpdateAirBookingOther(uoHiddenFieldAirID.Value, uoTextBoxFlightNo2.Text, uoTextBoxArrivalDatetime2.Text, uoTextBoxDepartureDatetime2.Text, uoTextBoxDepartureLoc2.Text, uoTextBoxArrivalLoc2.Text, uoDropDownListAirline.SelectedValue, uoTextBoxTicketNo2.Text, uoDropDownListAirStatus2.SelectedValue, GlobalCode.Field2String(Session["UserName"]), Session["strSFStatus"].ToString(), uoTextBoxRemarks2.Text, uoCheckBoxChargedToCrew2.Checked); } if (Request.QueryString["Add"] == "1") { //Insert log audit trail (Gabriel Oquialda - 18/11/2011) strLogDescription = "Air booking added."; strFunction = "uoButtonSave2_Click"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); //BLL.AuditTrailBLL.InsertLogAuditTrail(strLogDescription, strFunction, Path.GetFileName(Request.Path), // CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); } else { //Insert log audit trail (Gabriel Oquialda - 18/11/2011) strLogDescription = "Air booking updated."; strFunction = "uoButtonSave2_Click"; DateTime dateNow = CommonFunctions.GetCurrentDateTime(); //BLL.AuditTrailBLL.InsertLogAuditTrail(strLogDescription, strFunction, Path.GetFileName(Request.Path), // CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, Session["UserName"].ToString()); } OpenParentPage(); } catch (Exception ex) { AlertMessage(ex.Message); } }