/// <summary> /// Date Created: 04/03/2013 /// Created By: Marco Abejar /// (description) Get Room Amount /// --------------------------------------------------------------------------- /// </summary> private void GetHotelRoomAmount() { List <HotelRoomBlocksDTO> listHotelRoomBlocks = null; try { string strRoomType = (uoDropdownRoomOccupancy.SelectedValue == "Single") ? "1" : "2"; listHotelRoomBlocks = HotelBLL.GetHotelRoomOverrideByBranch(uoDropDownListHotel.SelectedValue, strRoomType, uoHiddenFieldDate.Value); if (listHotelRoomBlocks.Count > 0) { if (uoHiddenFieldRoomAmount.Value == "0") { Decimal fAmount = GlobalCode.Field2Decimal(listHotelRoomBlocks[0].OverrideRate);//GlobalCode.Field2Decimal(dr["EmergencyRate"].ToString()); uoTextBoxAmount.Text = fAmount.ToString("0.00"); } } } catch (Exception ex) { throw ex; } finally { if (listHotelRoomBlocks != null) { listHotelRoomBlocks = null; } } }
/// <summary> /// Date Created: 10/02/2012 /// Created By: Josephine Gad /// (description) Get hotel room blocks from emergency room blocks /// --------------------------------------------------- /// Date Modified: 16/02/2012 /// Modified By: Josephine Gad /// (description) Replace IDataReader with List /// --------------------------------------------------- /// </summary> private void GetHotelRoomEmergency() { List <HotelRoomBlocksEmergencyDTO> list = null; try { list = HotelBLL.GetHotelRoomEmergencyByBranch(uoHiddenFieldBranchID.Value, uoDropDownListRoomType.SelectedValue, uoHiddenFieldDate.Value); if (list.Count > 0) { uoLabelBranchName.Text = list[0].BranchName;//dr["BranchName"].ToString(); if (uoHiddenFieldDate.Value != "") { DateTime dDate = CommonFunctions.ConvertDateByFormat(uoHiddenFieldDate.Value); uoLabelDate.Text = dDate.ToString("dd-MMM-yyyy (dddd)"); } //uoTextBoxEmergencyRoomCount.Text = list[0].RoomBlocks; uoLabelEmergencyRoomBlocks.Text = list[0].RoomBlocks; Decimal fAmount = GlobalCode.Field2Decimal(list[0].Rate);//GlobalCode.Field2Decimal(dr["EmergencyRate"].ToString()); uoTextBoxEmergencyAmount.Text = fAmount.ToString("0.00"); //if (dr["EmergencyCurrentcyID"] == null) //{ // uoDropDownListCurrency.SelectedValue = dr["OverrideCurrencyID"].ToString(); //} //else //{ // uoDropDownListCurrency.SelectedValue = dr["EmergencyCurrentcyID"].ToString(); //} uoDropDownListCurrency.SelectedValue = list[0].Currency; //dr["EmergencyCurrentcyID"].ToString(); uoCheckEmergencyBoxTaxInclusive.Checked = list[0].IsTaxInclusive; //(bool)dr["EmergencyTaxInclusive"]; uoTextBoxEmergencyTax.Text = list[0].Tax; //dr["EmergencyTaxPercent"].ToString(); //Decimal fTax = GlobalCode.Field2Decimal(list[0].Tax); //uoTextBoxEmergencyTax.Text = fTax.ToString("0.0"); //dr["EmergencyTaxPercent"].ToString(); if (!uoCheckEmergencyBoxTaxInclusive.Checked) { uoTextBoxEmergencyTax.Enabled = false; uoTextBoxEmergencyTax.Text = "0.0"; } else { uoTextBoxEmergencyTax.Enabled = true; } } } catch (Exception ex) { throw ex; } finally { if (list != null) { list = null; } } }
protected void LoadDetails() { IDataReader dr = null; try { dr = dbBLL.getOverrideDetails(uoHiddenFieldBranchId.Value, GlobalCode.Field2String(Request.QueryString["hrId"]), uoDropdownListRoom.SelectedValue); if (dr.Read()) { Hotel = dr["colVendorBranchNameVarchar"].ToString(); uoHiddenFieldCountryId.Value = dr["colCountryIDInt"].ToString(); if (Request.QueryString["hrId"] != "0") { DateTime dt = GlobalCode.Field2DateTime(dr["colEffectiveDate"]); EffectiveDate = String.Format("{0:mm/dd/yyyy}", dr["colEffectiveDate"]) + " (" + dt.Day + ")"; uoHiddenFieldEffectiveDate.Value = String.Format("{0:mm/dd/yyyy}", dr["colEffectiveDate"]); RoomType = dr["colRoomNameVarchar"].ToString(); uoTextBoxRate.Text = dr["colRatePerDayMoney"].ToString().Remove(dr["colRatePerDayMoney"].ToString().Length - 2); uoTextBoxRateTax.Text = (GlobalCode.Field2Decimal(dr["colRoomRateTaxPercentage"].ToString()) * 100).ToString(); uoCheckBoxTaxBit.Checked = GlobalCode.Field2Bool(dr["colRoomRateTaxInclusive"].ToString()); uoTextBoxNumberOfRooms.Text = dr["colRoomBlocksPerDayInt"].ToString(); } else { //TREditrType.Visible = false; } } } catch (Exception ex) { throw ex; } finally { if (dr != null) { dr.Dispose(); } } }
/// <summary> /// Date Modified: 13/09/2011 /// Modified By: Josephine Gad /// (description) Use vendor id or contract id to view contract details /// </summary> /// <param name="cId">Contract Id</param> private void GetVendorHotelContract() { DataTable dt = null; try { if (uoHiddenFieldContractID.Value == "") { uoHiddenFieldContractID.Value = "0"; } dt = BLL.ContractBLL.GetVendorHotelContractByContractID(uoHiddenFieldContractID.Value, uoHiddenFieldVendorID.Value); // select contract by contract ID //} //else //{ //dt = BLL.ContractBLL.GetVendorHotelBranchContractActiveByBranchID(uoHiddenFieldVendorID.Value); //} if (dt.Rows.Count > 0) { ucLabelContractStatus.Text = dt.Rows[0]["colContractStatusVarchar"].ToString(); uoTextBoxVendorCode.Text = dt.Rows[0]["colVendorCodeVarchar"].ToString(); uoTextBoxVendorName.Text = dt.Rows[0]["colVendorBranchNameVarchar"].ToString(); uotextboxContractTitle.Text = dt.Rows[0]["colContractNameVarchar"].ToString(); uotextboxRemarks.Text = dt.Rows[0]["colRemarksVarchar"].ToString(); uotextboxRCCLRep.Text = dt.Rows[0]["colRCCLPersonnel"].ToString(); uotextboxVendorRep.Text = dt.Rows[0]["colVendorPersonnel"].ToString(); uoTextBoxTelNo.Text = dt.Rows[0]["colContactNoVarchar"].ToString(); uoTextBoxEmailTo.Text = dt.Rows[0]["colEmailVarchar"].ToString(); uoTextBoxEmailCc.Text = dt.Rows[0]["colEmailCcVarchar"].ToString(); uoCheckBoxShuttle.Checked = Convert.ToBoolean(dt.Rows[0]["colWithShuttleBit"].ToString()); uoCheckBoxBreakfast.Checked = Convert.ToBoolean(dt.Rows[0]["colBreakfastBit"].ToString()); uoCheckBoxLunch.Checked = Convert.ToBoolean(dt.Rows[0]["colLunchBit"].ToString()); uoCheckBoxDinner.Checked = Convert.ToBoolean(dt.Rows[0]["colDinnertBit"].ToString()); uoCheckBoxLunchDinner.Checked = Convert.ToBoolean(dt.Rows[0]["colLunchOrDinnerBit"].ToString()); uoTextBoxFaxNumber.Text = dt.Rows[0]["colFaxNoVarchar"].ToString(); uoTextBoxWebsite.Text = dt.Rows[0]["colWebsiteVarchar"].ToString(); string dtStart = (dt.Rows[0]["colContractDateStartedDate"].ToString().Length > 0) ? dt.Rows[0]["colContractDateStartedDate"].ToString() : ""; string dtEnd = (dt.Rows[0]["colContractDateEndDate"].ToString().Length > 0) ? dt.Rows[0]["colContractDateEndDate"].ToString() : ""; uotextboxStartDate.Text = dtStart; uotextboxEndDate.Text = dtEnd; uoTextBoxMeal.Text = dt.Rows[0]["colMealRateMoney"].ToString(); uoTextBoxMealTax.Text = dt.Rows[0]["colMealRateTaxDecimal"].ToString(); uoCheckBoxMealTaxInclusive.Checked = Convert.ToBoolean(dt.Rows[0]["colMealRateTaxInclusiveBit"].ToString()); uotextboxVendorRepEmailAdd.Text = dt.Rows[0]["colVendorRepEmailAddVarchar"].ToString(); uotextboxRCCLRepEmailAdd.Text = dt.Rows[0]["colRCCLRepEmailAddVarchar"].ToString(); uotextboxVendorRepContactNo.Text = dt.Rows[0]["colVendorRepContactNoVarchar"].ToString(); uotextboxRCCLRepContactNo.Text = dt.Rows[0]["colRCCLRepContactNoVarchar"].ToString(); uoTextBoxCurrency.Text = dt.Rows[0]["Currency"].ToString(); uoTextBoxHotelTimeZone.Text = dt.Rows[0]["colHotelTimeZoneIDVarchar"].ToString(); uoGridViewDays.DataSource = dt; uoGridViewDays.DataBind(); if (GlobalCode.Field2Int(dt.Rows[0]["colCancellationTermsInt"]) > 0) { uoTextBoxCancellationHours.Text = GlobalCode.Field2Int(dt.Rows[0]["colCancellationTermsInt"]).ToString(); } else { uoTextBoxCancellationHours.Text = ""; } if (GlobalCode.Field2String(dt.Rows[0]["colCutOffTime"]) != "") { uoTextBoxCutoffTime.Text = string.Format("{0:HH:mm}", GlobalCode.Field2DateTime(dt.Rows[0]["colCutOffTime"])); } else { uoTextBoxCutoffTime.Text = ""; } uoTextBoxDefaultDBLRate.Text = GlobalCode.Field2Decimal(dt.Rows[0]["colRoomAmountDblFloat"]).ToString("N2"); uoTextBoxDefaultSGLRate.Text = GlobalCode.Field2Decimal(dt.Rows[0]["colRoomAmountSglFloat"]).ToString("N2"); } } catch (Exception ex) { throw ex; } finally { if (dt != null) { dt.Dispose(); } } }
/// ---------------------------------------------- /// Modified By: Marco Abejar /// Date Modified: 26/03/2013 /// Description: Get seafarer's info /// ---------------------------------------------- /// Modified By: Josephine Gad /// Date Modified: 30/May/2013 /// Description: Add Shuttle, LunchDinner, and Tax /// ---------------------------------------------- /// </summary> private void GetSFInfo() { IDataReader dtSFInfo = null; try { dtSFInfo = GetSfInfoDataTable(); if (dtSFInfo.Read()) { ClearDropdown(); uoHiddenFieldHotelRequestID.Value = dtSFInfo["RequestId"].ToString(); uoHiddenFieldSFStatus.Value = dtSFInfo["STATUS"].ToString(); uoTextBoxE1ID.Text = dtSFInfo["colSeafarerIdInt"].ToString(); uoTextBoxRequestNo.Text = dtSFInfo["RequestNo"].ToString(); uoTextBoxLastname.Text = dtSFInfo["Lastname"].ToString(); uoTextBoxFirstname.Text = dtSFInfo["Firstname"].ToString(); string st = dtSFInfo["Gender"].ToString(); if (dtSFInfo["Gender"].ToString().Length > 0) { uoDropDownListGender.Items.FindByValue(dtSFInfo["Gender"].ToString()).Selected = true; } if (dtSFInfo["Vessel"].ToString().Length > 0) { uoDropDownListVessel.SelectedIndex = -1; uoDropDownListVessel.Items.FindByValue(dtSFInfo["Vessel"].ToString()).Selected = true; } if (dtSFInfo["Rank"].ToString().Length > 0) { uoDropDownListRank.Items.FindByValue(dtSFInfo["Rank"].ToString()).Selected = true; GetCostCenter(); } uoTextBoxCostCenter.Text = dtSFInfo["CostCenter"].ToString(); uoTextBoxCheckinDate.Text = dtSFInfo["Checkin"].ToString(); uoTextBoxCheckoutDate.Text = dtSFInfo["Checkout"].ToString(); uoCheckboxBreakfast.Checked = Convert.ToBoolean(dtSFInfo["Breakfast"].ToString()); uoCheckboxLunch.Checked = Convert.ToBoolean(dtSFInfo["Lunch"].ToString()); uoCheckboxDinner.Checked = Convert.ToBoolean(dtSFInfo["Dinner"].ToString()); uoCheckBoxLunchDinner.Checked = GlobalCode.Field2Bool(dtSFInfo["LUNCHDINNER"]); uoCheckBoxIsWithShuttle.Checked = GlobalCode.Field2Bool(dtSFInfo["SHUTTLE"]); uoTextNites.Text = dtSFInfo["Nites"].ToString(); uoHiddenFieldNoOfNites.Value = uoTextNites.Text; uoTextBoxRemarks.Text = dtSFInfo["Comment"].ToString(); if (dtSFInfo["CheckInTime"] != null && dtSFInfo["CheckInTime"].ToString() != "") { DateTime CheckInTime = DateTime.Parse(dtSFInfo["CheckInTime"].ToString()); string CInTime = String.Format("{0:HH:mm}", CheckInTime); uoTxtBoxTimeIn.Text = CInTime; } if (dtSFInfo["CheckOutTime"] != null && dtSFInfo["CheckOutTime"].ToString() != "") { DateTime CheckOutTime = DateTime.Parse(dtSFInfo["CheckOutTime"].ToString()); string COutTime = String.Format("{0:HH:mm}", CheckOutTime); uoTxtBoxTimeOut.Text = COutTime; } if (dtSFInfo["RoomAmount"] != null && dtSFInfo["RoomAmount"].ToString() != "") { Decimal fAmount = GlobalCode.Field2Decimal(dtSFInfo["RoomAmount"]); uoTextBoxAmount.Text = fAmount.ToString("0.00"); } uoHiddenFieldRoomAmount.Value = dtSFInfo["RoomAmount"].ToString(); uoTextBoxTaxPercent.Text = GlobalCode.Field2Double(dtSFInfo["colRoomRateTaxPercentage"]).ToString(); uoCheckContractBoxTaxInclusive.Checked = GlobalCode.Field2Bool(dtSFInfo["colRoomRateTaxInclusive"].ToString()); if (dtSFInfo["Currency"].ToString().Length > 0) { uoDropDownListCurrency.SelectedIndex = -1; uoDropDownListCurrency.Items.FindByValue(dtSFInfo["Currency"].ToString()).Selected = true; } BindRegionList(); if (dtSFInfo["Region"].ToString().Length > 0) { uoDropDownListRegion.SelectedIndex = -1; uoDropDownListRegion.Items.FindByValue(dtSFInfo["Region"].ToString()).Selected = true; } BindPortList(); if (dtSFInfo["Port"].ToString().Length > 0 && dtSFInfo["Region"].ToString().Length > 0) { if (uoDropDownListPort.Items.FindByValue(dtSFInfo["Port"].ToString()) != null) { uoDropDownListPort.SelectedValue = dtSFInfo["Port"].ToString(); } } GetAirport(); if (dtSFInfo["AIRPORT"].ToString().Length > 0 && dtSFInfo["Region"].ToString().Length > 0) { if (uoDropDownListAirport.Items.FindByValue(dtSFInfo["AIRPORT"].ToString()) != null) { uoDropDownListAirport.SelectedValue = dtSFInfo["AIRPORT"].ToString(); } } GetHotelFilter(); if (dtSFInfo["Hotel"].ToString() != "0") { //uoDropDownListHotel.SelectedIndex = -1; //GetHotelFilter(); if (uoDropDownListHotel.Items.FindByValue(dtSFInfo["Hotel"].ToString()) != null) { uoDropDownListHotel.SelectedValue = dtSFInfo["Hotel"].ToString(); } uoLabelMessage.Visible = false; } else { uoLabelMessage.Visible = true; } if (dtSFInfo["RoomType"].ToString().Length > 0) { //BindRoom(); uoDropdownRoomOccupancy.Items.FindByValue(dtSFInfo["RoomType"].ToString()).Selected = true; } uoHiddenFieldContractID.Value = GlobalCode.Field2String(dtSFInfo["colContractIdInt"]); } } catch (Exception ex) { AlertMessage(ex.Message); } finally { if (dtSFInfo != null) { dtSFInfo.Close(); dtSFInfo.Dispose(); } } }
/// <summary> /// =============================================================== /// Modified By: Josephine Gad /// Date Created: 17/Mar/2013 /// Description: Change List to Void /// Assign Session values here /// =============================================================== /// </summary> public static void GetNonTurnPortNotInTM(DateTime Date, string UserId, string PortCode, string OrderBy) { Database db = ConnectionSetting.GetConnection(); // DatabaseFactory.CreateDatabase(); DbCommand dbCommand = null; DataSet ds = null; DataTable dtNew = null; DataTable dtConfirmed = null; DataTable dtCancelled = null; DataTable dtEmail = null; try { List <NonTurnPortsList> NonTurnPortsList = new List <NonTurnPortsList>(); HttpContext.Current.Session["PortNotExistExceptionList"] = NonTurnPortsList; dbCommand = db.GetStoredProcCommand("uspGetNonTurnPortsNoInTM"); db.AddInParameter(dbCommand, "@pDate", DbType.Date, Date); db.AddInParameter(dbCommand, "@pUserId", DbType.String, UserId); db.AddInParameter(dbCommand, "@pPortCode", DbType.String, PortCode); db.AddInParameter(dbCommand, "@pOrderby", DbType.String, OrderBy); ds = db.ExecuteDataSet(dbCommand); dtNew = ds.Tables[0]; NonTurnPortsList = (from a in dtNew.AsEnumerable() select new NonTurnPortsList { IDBigInt = GlobalCode.Field2Long(a["IDBigInt"]), TravelReqID = GlobalCode.Field2Long(a["TravelReqID"]), E1TravelReqID = GlobalCode.Field2Int(a["E1TravelReqID"]), RoomTypeId = GlobalCode.Field2Int(a["RoomTypeId"]), PortId = GlobalCode.Field2Int(a["PortId"]), SFStatus = GlobalCode.Field2String(a["SFStatus"]), HotelCity = GlobalCode.Field2String(a["HotelCity"]), Checkin = GlobalCode.Field2String(a["Checkin"]), CheckOut = GlobalCode.Field2String(a["CheckOut"]), HotelNite = GlobalCode.Field2String(a["HotelNite"]), LastName = GlobalCode.Field2String(a["colLastNameVarchar"]), FirstName = GlobalCode.Field2String(a["colFirstNameVarchar"]), Employee = GlobalCode.Field2Long(a["Employee"]), Gender = GlobalCode.Field2String(a["Gender"]), SingleDouble = GlobalCode.Field2String(a["SingleDouble"]), Couple = GlobalCode.Field2String(a["Couple"]), Title = GlobalCode.Field2String(a["Title"]), Ship = GlobalCode.Field2String(a["Ship"]), Costcenter = GlobalCode.Field2String(a["Costcenter"]), Nationality = GlobalCode.Field2String(a["Natioality"]), HotelRequest = GlobalCode.Field2String(a["HotelRequest"]), RecLoc = GlobalCode.Field2String(a["RecLoc"]), RecLocID = GlobalCode.Field2Long(a["RecLocID"]), AirSequence = GlobalCode.Field2Int(a["AirSequence"]), deptCity = GlobalCode.Field2String(a["DeptCity"]), ArvlCity = GlobalCode.Field2String(a["ArvlCity"]), Arvldate = GlobalCode.Field2String(a["ArrvlDate"]), ArvlTime = GlobalCode.Field2String(a["ArrvlTime"]), Carrier = GlobalCode.Field2String(a["Carrier"]), FlightNo = GlobalCode.Field2String(a["FlightNo"]), Voucher = GlobalCode.Field2String(a["Voucher"]), PassportNo = GlobalCode.Field2String(a["PassportNo"]), PassportExp = GlobalCode.Field2String(a["PassportExp"]), PassportIssued = GlobalCode.Field2String(a["PassportIssued"]), HotelBranch = GlobalCode.Field2String(a["HotelBranch"]), Booking = GlobalCode.Field2String(a["Booking"]), Bookingremark = GlobalCode.Field2String(a["Bookingremark"]), IsVisible = GlobalCode.Field2Bool(a["IsVisible"]), stripes = GlobalCode.Field2Decimal(a["colStripesDecimal"]), GroupNo = GlobalCode.Field2TinyInt(a["GroupNo"]), PortName = GlobalCode.Field2String(a["PortName"]), }).ToList(); HttpContext.Current.Session["PortNotExistExceptionList"] = NonTurnPortsList; } catch (Exception ex) { throw ex; } finally { if (dbCommand != null) { dbCommand.Dispose(); } if (dtNew != null) { dtNew.Dispose(); } if (dtConfirmed != null) { dtConfirmed.Dispose(); } if (dtCancelled != null) { dtCancelled.Dispose(); } if (dtEmail != null) { dtEmail.Dispose(); } } }
/// <summary> /// Date Created: 10/02/2012 /// Created By: Josephine Gad /// (description) Save Emergency room blocks /// --------------------------------------------------------------- /// Date Modified: 03/03/2012 /// Modified By: Gabriel Oquialda /// (description) Added validation for emergency room block(s) versus the total no. of emergency booking(s) /// </summary> private void SaveHotelRoomEmergency() { IDataReader drEmergencyTotalBookings = null; Int32 EmergencyTotalBookings = 0; Decimal EmergencyTotal = 0; try { Int32 EmergencyRoomCount = GlobalCode.Field2Int(uoTextBoxEmergencyRoomCount.Text); String Date = string.Format("{0:dd-MMM-yyyy}", uoHiddenFieldDate.Value); Int32 BranchID = GlobalCode.Field2Int(uoHiddenFieldBranchID.Value); Int32 RoomTypeID = GlobalCode.Field2Int(uoHiddenFieldRoomTypeID.Value); drEmergencyTotalBookings = HotelBLL.GetEmergencyTotalBookings(Date, BranchID, RoomTypeID); if (drEmergencyTotalBookings.Read()) { EmergencyTotalBookings = GlobalCode.Field2Int(drEmergencyTotalBookings["colEmergencyTotalBookingInt"].ToString()); } if (RoomTypeID == 1) { EmergencyTotal = EmergencyTotalBookings; } else if (RoomTypeID == 2) { EmergencyTotal = GlobalCode.Field2Decimal(EmergencyTotalBookings) / 2; } if (EmergencyRoomCount < EmergencyTotal) { AlertMessage("Emergency room block(s) must not be less than the total no. of emergency booking(s)!"); } else { DataTable dtEmergency = null; string strLogDescription; string strFunction; DateTime dDate = CommonFunctions.ConvertDateByFormat(uoHiddenFieldDate.Value); dtEmergency = HotelBLL.SaveHotelRoomEmergencyByBranch(uoHiddenFieldBranchID.Value, dDate, uoTextBoxEmergencyAmount.Text, uoDropDownListCurrency.SelectedValue, uoTextBoxEmergencyTax.Text, uoCheckEmergencyBoxTaxInclusive.Checked, uoDropDownListRoomType.SelectedValue, uoTextBoxEmergencyRoomCount.Text, uoHiddenFieldUser.Value); if (Convert.ToInt32(dtEmergency.Rows[0]["dtReturnType"]) == 0) { //Insert log audit trail (Gabriel Oquialda - 22/02/2012) strLogDescription = "Hotel room emergency added."; strFunction = "SaveHotelRoomEmergency"; DateTime currentDate = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(dtEmergency.Rows[0]["dtHotelRoomID"]), "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); } else if (Convert.ToInt32(dtEmergency.Rows[0]["dtReturnType"]) == 1) { //Insert log audit trail (Gabriel Oquialda - 22/02/2012) strLogDescription = "Hotel room emergency updated."; strFunction = "SaveHotelRoomEmergency"; DateTime currentDate = CommonFunctions.GetCurrentDateTime(); BLL.AuditTrailBLL.InsertLogAuditTrail(Convert.ToInt32(dtEmergency.Rows[0]["dtHotelRoomID"]), "", strLogDescription, strFunction, Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate), DateTime.Now, GlobalCode.Field2String(Session["UserName"])); } OpenParentPage(); } } catch (Exception ex) { throw ex; } finally { if (drEmergencyTotalBookings != null) { drEmergencyTotalBookings.Close(); drEmergencyTotalBookings.Dispose(); } } }
/// <summary> /// Date Created: 25/11/2011 /// Created By: Josephine Gad /// (description) Get hotel room blocks from contract and override /// --------------------------------------------------------------- /// Date Modified: 28/11/2011 /// Modified By: Charlene Remotigue /// (description) optimization (use datareader instead of datatable /// --------------------------------------------------------------- /// Date Modified: 16/02/2012 /// Modified By: Josephine Gad /// (description) replace datareader with List /// </summary> private void GetHotelRoomOverride() { List <HotelRoomBlocksDTO> listHotelRoomBlocks = null; try { listHotelRoomBlocks = HotelBLL.GetHotelRoomOverrideByBranch(uoHiddenFieldBranchID.Value, uoDropDownListRoomType.SelectedValue, uoHiddenFieldDate.Value); if (listHotelRoomBlocks.Count > 0) { uoLabelBranchName.Text = listHotelRoomBlocks[0].BranchName; //dr["BranchName"].ToString(); //uoLabelRoomTypeName.Text = dr["RoomName"].ToString(); if (uoHiddenFieldDate.Value != "") { DateTime dDate = CommonFunctions.ConvertDateByFormat(uoHiddenFieldDate.Value); uoLabelDate.Text = dDate.ToString("dd-MMM-yyyy (dddd)"); } uoLabelContractRoomCount.Text = listHotelRoomBlocks[0].ContractRoomBlocks; //dr["ContractRoomBlocks"].ToString(); uoLabelContractCurrency.Text = listHotelRoomBlocks[0].ContractCurrency; //["ContractCurrency"].ToString(); uoLabelContractAmount.Text = listHotelRoomBlocks[0].ContractRate; //dr["ContractRate"].ToString(); uoCheckContractBoxTaxInclusive.Checked = listHotelRoomBlocks[0].ContractIsTaxInclusive; //(bool)dr["ContractIsTaxInclusive"]; uoLabelContractTax.Text = listHotelRoomBlocks[0].ContractTaxPercent; //dr["ContractTaxPercent"].ToString(); uoTextBoxOverrideRoomCount.Text = listHotelRoomBlocks[0].OverrideRoomBlocks; //dr["OverrideRoomBlocks"].ToString(); Decimal fAmount = GlobalCode.Field2Decimal(listHotelRoomBlocks[0].OverrideRate); uoTextBoxOverrideAmount.Text = fAmount.ToString("0.00"); //if (dr["OverrideCurrentcyID"] == null) //{ // uoDropDownListCurrency.SelectedValue = dr["ContractCurrencyID"].ToString(); //} //else //{ // uoDropDownListCurrency.SelectedValue = dr["OverrideCurrentcyID"].ToString(); //} uoDropDownListCurrency.SelectedValue = listHotelRoomBlocks[0].OverrideCurrentcyID; //dr["ContractCurrencyID"].ToString(); uoCheckOverrideBoxTaxInclusive.Checked = listHotelRoomBlocks[0].OverrideIsTaxInclusive; //(bool)dr["OverrideIsTaxInclusive"]; uoTextBoxOverrideTax.Text = listHotelRoomBlocks[0].OverrideTaxPercent; //dr["OverrideTaxPercent"].ToString(); //Decimal fTax = GlobalCode.Field2Decimal(listHotelRoomBlocks[0].OverrideTaxPercent); //uoTextBoxOverrideTax.Text = fTax.ToString("0.0"); //dr["OverrideTaxPercent"].ToString(); if (!uoCheckOverrideBoxTaxInclusive.Checked) { uoTextBoxOverrideTax.Enabled = false; uoTextBoxOverrideTax.Text = "0.0"; } else { uoTextBoxOverrideTax.Enabled = true; } } } catch (Exception ex) { throw ex; } finally { if (listHotelRoomBlocks != null) { listHotelRoomBlocks = null; } } }
/// <summary> /// Author: Josephine Gad /// Date Created: 09/02/2012 /// Descrption: send hotel dashboard queries (list and count) to list /// </summary> /// <param name="iRegionID"></param> /// <param name="iCountryID"></param> /// <param name="iCityID"></param> /// <param name="sUserName"></param> /// <param name="sRole"></param> /// <param name="iBranchID"></param> /// <param name="dFrom"></param> /// <param name="dTo"></param> /// <param name="sBranchName"></param> /// <param name="StartRow"></param> /// <param name="MaxRow"></param> /// <returns></returns> public List <HotelDashboardDTOGenericClass> LoadAllHotelDashboardTables(Int16 iLoadType, Int32 iRegionID, Int32 iCountryID, Int32 iCityID, Int32 iPortID, string sUserName, string sRole, Int32 iBranchID, DateTime dFrom, DateTime dTo, string sBranchName, int StartRow, int MaxRow) { List <HotelDashboardDTOGenericClass> HotelDashboardTables = new List <HotelDashboardDTOGenericClass>(); Database db = ConnectionSetting.GetConnection(); // DatabaseFactory.CreateDatabase(); DbCommand dbCommand = null; Int32 maxRows = 0; //Int32 ExceptionCount = 0; Int32 OverflowCount = 0; //Int32 NoTravelRequestCount = 0; Int32 ArrDeptSameOnOffDateCount = 0; DataTable dt = null; DataTable dtOverflow = null; DataSet ds = null; DataTable dtExceptionNoTravelRequest = null; try { dbCommand = db.GetStoredProcCommand("uspGetHotelDashboardRoomTypeFromSummary"); db.AddInParameter(dbCommand, "@pRegionID", DbType.Int32, iRegionID); db.AddInParameter(dbCommand, "@pCountryID", DbType.Int32, iCountryID); db.AddInParameter(dbCommand, "@pCityID", DbType.Int32, iCityID); db.AddInParameter(dbCommand, "@pPortID", DbType.Int32, iPortID); db.AddInParameter(dbCommand, "@pUserName", DbType.String, sUserName); db.AddInParameter(dbCommand, "@pRole", DbType.String, sRole); db.AddInParameter(dbCommand, "@pBranchID", DbType.Int32, iBranchID); db.AddInParameter(dbCommand, "@pFrom", DbType.DateTime, dFrom); db.AddInParameter(dbCommand, "@pTo", DbType.DateTime, dTo); db.AddInParameter(dbCommand, "@pBranchName", DbType.String, sBranchName); db.AddInParameter(dbCommand, "@pStartRow", DbType.Int32, StartRow); db.AddInParameter(dbCommand, "@pMaxRow", DbType.Int32, MaxRow); db.AddInParameter(dbCommand, "@pLoadType", DbType.Int16, iLoadType); ds = db.ExecuteDataSet(dbCommand); dt = ds.Tables[1]; maxRows = Int32.Parse(ds.Tables[0].Rows[0][0].ToString()); //if(iLoadType == 0) //{ //ExceptionCount = Int32.Parse(ds.Tables[2].Rows[0][0].ToString()); //OverflowCount = Int32.Parse(ds.Tables[2].Rows[0][0].ToString()); //NoTravelRequestCount = Int32.Parse(ds.Tables[5].Rows[0][0].ToString()); //dtOverflow = ds.Tables[3]; //HotelDashboardClass.PendingBooking = (from c in dtOverflow.AsEnumerable() // select new OverflowBooking // { // CoupleId = c.Field<int?>("colCoupleIdInt"), // Gender = c.Field<string>("colGenderVarchar"), // Nationality = c.Field<string>("colNationalityVarchar"), // CostCenter = c.Field<string>("coLCostCenterVarchar"), // CheckInDate = GlobalCode.Field2DateTime(c["colCheckInDateTime"]), // CheckOutDate = GlobalCode.Field2DateTime(c["colCheckOutDatetime"]), // TravelReqId = GlobalCode.Field2Int(c["colTravelRequestIdInt"]), // SFStatus = c.Field<string>("colStatusVarchar"), // Name = c.Field<string>("colNameVarchar"), // SeafarerId = GlobalCode.Field2Int(c["colSeafarerIdInt"]), // VesselName = c.Field<string>("colVesselNameVarchar"), // RoomName = c.Field<string>("colRoomNameVarchar"), // RankName = c.Field<string>("colRankNameVarchar"), // CityId = GlobalCode.Field2Int(c["colCityIdInt"]), // CountryId = GlobalCode.Field2Int(c["colCountryIdInt"]), // HotelCity = c.Field<string>("colHotelCityVarchar"), // HotelNites = GlobalCode.Field2Int(c["colHotelNitesInt"]), // FromCity = c.Field<string>("colFromCityVarchar"), // ToCity = c.Field<string>("colToCityVarchar"), // RecordLocator = c.Field<string>("colRecordLocatorVarchar"), // Carrier = c.Field<string>("colCarrierVarchar"), // DepartureDate = GlobalCode.Field2DateTime(c["colDepartureDateTime"]), // ArrivalDate = GlobalCode.Field2DateTime(c["colArrivalDatetime"]), // FlightNo = c.Field<string>("colFlightNoVarchar"), // OnOffDate = GlobalCode.Field2DateTime(c["colOnOffDate"]), // Voucher = c["colVoucherMoney"].ToString(), // ReasonCode = c.Field<string>("colReasonCodeVarchar"), // Stripe = c.Field<decimal?>("colStripesDecimal"), // VendorId = GlobalCode.Field2Int(c["colVendorIdInt"]), // BranchId = GlobalCode.Field2Int(c["colBranchIdInt"]), // RoomTypeId = GlobalCode.Field2Int(c["colRoomTypeIdInt"]), // PortId = GlobalCode.Field2Int(c["colPortIdInt"]), // VesselId = GlobalCode.Field2Int(c["colVesselIdInt"]), // EnabledBit = GlobalCode.Field2Bool(c["isEnabled"]), // }).ToList(); //HotelDashboardClass.PendingBookingCount = OverflowCount; //dtExceptionNoTravelRequest = ds.Tables[4]; //HotelDashboardDTO.HotelExceptionNoTravelRequestList = (from d in dtExceptionNoTravelRequest.AsEnumerable() // select new HotelExceptionNoTravelRequestList // { // colDate = GlobalCode.Field2DateTime(d["colDate"]), // ExceptionCount = GlobalCode.Field2Int(d["ExceptionCount"]), // NoTravelCount = GlobalCode.Field2Int(d["NoTravelCount"]), // ArrDeptSameOnOffDateCount = GlobalCode.Field2Int(d["ArrDepSameDateCount"]) // }).ToList(); //} HotelDashboardTables.Add(new HotelDashboardDTOGenericClass() { HotelDashboardList = (from a in dt.AsEnumerable() select new HotelDashboardList { RowNo = GlobalCode.Field2Int(a["RowNo"]), BranchID = GlobalCode.Field2Int(a["BranchID"]), BrandID = GlobalCode.Field2Int(a["BrandID"]), RoomTypeID = GlobalCode.Field2TinyInt(a["RoomTypeID"]), HotelBranchName = a["HotelBranchName"].ToString(), colDate = GlobalCode.Field2DateTime(a["colDate"]), colDateName = a["colDateName"].ToString(), RoomType = a["RoomType"].ToString(), ReservedCrew = GlobalCode.Field2Int(a["ReservedCrew"]), OverflowCrew = GlobalCode.Field2Int(a["OverflowCrew"]), //TotalCrew = GlobalCode.Field2Int(a["TotalCrew"]), //ReservedRoom = GlobalCode.Field2Decimal(a["ReservedRoom"]), //TotalRoomBlocks = GlobalCode.Field2Int(a["TotalRoomBlocks"]), AvailableRoomBlocks = GlobalCode.Field2Decimal(a["AvailableRoomBlocks"]), //EmergencyRoomBlocks = GlobalCode.Field2Int(a["EmergencyRoomBlocks"]), //AvailableEmergencyRoomBlocks = GlobalCode.Field2Decimal(a["AvailableEmergencyRoomBlocks"]), IsWithEvent = GlobalCode.Field2Bool(a["IsWithEvent"]), IsWithContract = GlobalCode.Field2Bool(a["IsWithContract"]) }).ToList(), HotelDashboardListCount = maxRows, //HotelExceptionNoTravelRequestList = (from d in dtExceptionNoTravelRequest.AsEnumerable() // select new HotelExceptionNoTravelRequestList // { // colDate = GlobalCode.Field2DateTime(d["colDate"]), // ExceptionCount = GlobalCode.Field2Int(d["ExceptionCount"]), // NoTravelCount = GlobalCode.Field2Int(d["NoTravelCount"]), // ArrDeptSameOnOffDateCount = GlobalCode.Field2Int(d["ArrDepSameDateCount"]) // }).ToList(), //HotelOverflowCount = OverflowCount, //HotelExceptionCount = ExceptionCount, //NoTravelRequestCount = NoTravelRequestCount }); if (iLoadType == 0) { dtExceptionNoTravelRequest = ds.Tables[2]; HotelDashboardTables.Add(new HotelDashboardDTOGenericClass() { HotelExceptionNoTravelRequestList = (from d in dtExceptionNoTravelRequest.AsEnumerable() select new HotelExceptionNoTravelRequestList { colDate = GlobalCode.Field2DateTime(d["colDate"]), ExceptionCount = GlobalCode.Field2Int(d["ExceptionCount"]), NoTravelCount = GlobalCode.Field2Int(d["NoTravelCount"]), ArrDeptSameOnOffDateCount = GlobalCode.Field2Int(d["ArrDepSameDateCount"]) }).ToList(), }); } return(HotelDashboardTables); } catch (Exception ex) { throw ex; } finally { if (dbCommand != null) { dbCommand.Dispose(); } if (ds != null) { ds.Dispose(); } if (dt != null) { dt.Dispose(); } if (dtOverflow != null) { dtOverflow.Dispose(); } } }
/// <summary> /// Author: Josephine Gad /// Date Created: 09/02/2012 /// Descrption: send hotel dashboard queries (list and count) to list /// ----------------------------------------------------------------------- /// Modfied by: Charlene Remotigue /// Date Modified: 07/03/2012 /// Description: added the ff parameters: /// SingleAvailableContractRooms /// DoubleAvailableContractRooms /// SingleAvailableOverrideRooms /// DoubleAvailableOverrideRooms /// isAccredited /// ------------------------------------------------------------------------------------- /// Modfied by: Gabriel Oquialda /// Date Modified: 13/03/2012 /// Description: This is a modified 'LoadAllHotelDashboardTables' copy for new screens /// ------------------------------------------------------------------------------------- /// Modfied by: Josephine Gad /// Date Modified: 30/03/2012 /// Description: Add count for TR with Arrival/Departure same with On/Off Date /// ------------------------------------------------------------------------------------- /// Modfied by: Josephine Gad /// Date Modified: 22/05/2012 /// Description: Add Region List /// </summary> /// <param name="iRegionID"></param> /// <param name="iCountryID"></param> /// <param name="iCityID"></param> /// <param name="sUserName"></param> /// <param name="sRole"></param> /// <param name="iBranchID"></param> /// <param name="dFrom"></param> /// <param name="dTo"></param> /// <param name="sBranchName"></param> /// <param name="StartRow"></param> /// <param name="MaxRow"></param> /// <returns></returns> public List <HotelDashboardDTOGenericClass> LoadAllHotelDashboardTables2(Int16 iLoadType, Int32 iRegionID, Int32 iCountryID, Int32 iCityID, Int32 iPortID, string sUserName, string sRole, Int32 iBranchID, DateTime dFrom, DateTime dTo, string sBranchName, int StartRow, int MaxRow) { List <HotelDashboardDTOGenericClass> HotelDashboardTables = new List <HotelDashboardDTOGenericClass>(); Database db = ConnectionSetting.GetConnection(); // DatabaseFactory.CreateDatabase(); DbCommand dbCommand = null; Int32 maxRows = 0; Int32 ExceptionCount = 0; Int32 OverflowCount = 0; Int32 NoTravelRequestCount = 0; Int32 ArrDeptSameOnOffDateCount = 0; Int32 NoHotelContract = 0; Int32 RestrictedNationalityCount = 0; DataTable dtRegion = null; DataTable dt = null; DataSet ds = null; try { dbCommand = db.GetStoredProcCommand("uspGetHotelDashboardRoomTypeFromSummary_PROTOTYPE2"); db.AddInParameter(dbCommand, "@pRegionID", DbType.Int32, iRegionID); db.AddInParameter(dbCommand, "@pCountryID", DbType.Int32, iCountryID); db.AddInParameter(dbCommand, "@pCityID", DbType.Int32, iCityID); db.AddInParameter(dbCommand, "@pPortID", DbType.Int32, iPortID); db.AddInParameter(dbCommand, "@pUserName", DbType.String, sUserName); db.AddInParameter(dbCommand, "@pRole", DbType.String, sRole); db.AddInParameter(dbCommand, "@pBranchID", DbType.Int32, iBranchID); db.AddInParameter(dbCommand, "@pFrom", DbType.DateTime, dFrom); db.AddInParameter(dbCommand, "@pTo", DbType.DateTime, dTo); db.AddInParameter(dbCommand, "@pBranchName", DbType.String, sBranchName); db.AddInParameter(dbCommand, "@pStartRow", DbType.Int32, StartRow); db.AddInParameter(dbCommand, "@pMaxRow", DbType.Int32, MaxRow); db.AddInParameter(dbCommand, "@pLoadType", DbType.Int16, iLoadType); dbCommand.CommandTimeout = 0; ds = db.ExecuteDataSet(dbCommand); dt = ds.Tables[1]; maxRows = Int32.Parse(ds.Tables[0].Rows[0][0].ToString()); if (iLoadType == 0 || iLoadType == 1) { ExceptionCount = Int32.Parse(ds.Tables[2].Rows[0][0].ToString()); OverflowCount = Int32.Parse(ds.Tables[3].Rows[0][0].ToString()); NoTravelRequestCount = Int32.Parse(ds.Tables[4].Rows[0][0].ToString()); ArrDeptSameOnOffDateCount = Int32.Parse(ds.Tables[5].Rows[0][0].ToString()); RestrictedNationalityCount = Int32.Parse(ds.Tables[6].Rows[0][0].ToString()); NoHotelContract = Int32.Parse(ds.Tables[7].Rows[0][0].ToString()); } HotelDashboardTables.Add(new HotelDashboardDTOGenericClass() { HotelDashboardList = (from a in dt.AsEnumerable() select new HotelDashboardList { RowNo = GlobalCode.Field2Int(a["RowNo"]), CountryId = GlobalCode.Field2Int(a["colCountryIdInt"]), CityIdInt = GlobalCode.Field2Int(a["colCityIdInt"]), BranchID = GlobalCode.Field2Int(a["BranchID"]), BrandID = GlobalCode.Field2Int(a["BrandID"]), //RoomTypeID = GlobalCode.Field2TinyInt(a["RoomTypeID"]), HotelBranchName = a["HotelBranchName"].ToString(), colDate = GlobalCode.Field2DateTime(a["colDate"]), colDateName = a["colDateName"].ToString(), //RoomType = a["RoomType"].ToString(), //ReservedCrew = GlobalCode.Field2Int(a["ReservedCrew"]), //OverflowCrew = GlobalCode.Field2Int(a["OverflowCrew"]), //TotalCrew = GlobalCode.Field2Int(a["TotalCrew"]), ReservedRoom = GlobalCode.Field2Decimal(a["ReservedRoom"]), //TotalRoomBlocks = GlobalCode.Field2Int(a["TotalRoomBlocks"]), //AvailableRoomBlocks = GlobalCode.Field2Decimal(a["AvailableRoomBlocks"]), //EmergencyRoomBlocks = GlobalCode.Field2Int(a["EmergencyRoomBlocks"]), //AvailableEmergencyRoomBlocks = GlobalCode.Field2Decimal(a["AvailableEmergencyRoomBlocks"]), TotalSingleAvailableRoom = GlobalCode.Field2Decimal(a["TotalSingleAvailableRooms"]), TotalSingleRoomBlock = GlobalCode.Field2Decimal(a["TotalSingleBookings"]), TotalDoubleRoomBlock = GlobalCode.Field2Decimal(a["TotalDoubleBookings"]), TotalDoubleAvailableRoom = GlobalCode.Field2Decimal(a["TotalDoubleAvailableRooms"]), IsWithEvent = GlobalCode.Field2Bool(a["IsWithEvent"]), //IsAccredited = GlobalCode.Field2Bool(a["IsAccredited"]), IsWithContract = GlobalCode.Field2Bool(a["IsWithContract"]), //TotalSingleRoomBlock = GlobalCode.Field2Int(a["TotalSingleRoomBlock"]), //TotalDoubleRoomBlock = GlobalCode.Field2Int(a["TotalDoubleRoomBlock"]), //TotalSingleAvailableRoom = GlobalCode.Field2Int(a["TotalSingleAvailableRoom"]), //TotalDoubleAvailableRoom = GlobalCode.Field2Decimal(a["TotalDoubleAvailableRoom"]), //SingleAvailableContractRooms = GlobalCode.Field2Int(a["SingleAvailableContractRooms"]), //DoubleAvailableContractRooms = GlobalCode.Field2Decimal(a["DoubleAvailableContractRooms"]), //SingleAvailableOverrideRooms = GlobalCode.Field2Int(a["SingleAvailableOverrideRooms"]), //DoubleAvailableOverrideRooms = GlobalCode.Field2Decimal(a["DoubleAvailableOverrideRooms"]), ContractId = GlobalCode.Field2Int(a["ContractId"]), }).ToList(), HotelDashboardListCount = maxRows, HotelExceptionCount = ExceptionCount, HotelOverflowCount = OverflowCount, NoTravelRequestCount = NoTravelRequestCount, ArrDeptSameOnOffDateCount = ArrDeptSameOnOffDateCount, NoContractCount = NoHotelContract, RestrictedNationalityCount = RestrictedNationalityCount, }); if (iLoadType == 0) { dtRegion = ds.Tables[9]; HotelDashboardTables.Add(new HotelDashboardDTOGenericClass() { RegionList = (from a in dtRegion.AsEnumerable() select new RegionList { RegionId = GlobalCode.Field2Int(a["colRegionIDInt"]), RegionName = a["colRegionNameVarchar"].ToString() } ).ToList() }); TMSettings.E1CHLastProcessedDate = GlobalCode.Field2DateTime(ds.Tables[10].Rows[0][0].ToString()); } return(HotelDashboardTables); } catch (Exception ex) { throw ex; } finally { if (dbCommand != null) { dbCommand.Dispose(); } if (ds != null) { ds.Dispose(); } if (dt != null) { dt.Dispose(); } if (dtRegion != null) { dtRegion.Dispose(); } } }
/// <summary> /// Author: Josephine Gad /// Date 29/Jan/2015 /// Description: Get Forecast from Micro /// </summary> /// <returns></returns> public List <HotelForecastForApprovalList> GetForecastManifestList(string sBranchName, string sDateFrom, string sDateTo, string sVesselCode, int sPortID, string sUser, string sRole, bool bIsHotelVendorView, Int16 LoadType, bool bShowAll, int StartRow, int MaxRow) { List <HotelForecastForApprovalList> list = new List <HotelForecastForApprovalList>(); List <HotelForecastCurrency> listCurrencySelected = new List <HotelForecastCurrency>(); List <Currency> listCurrency = new List <Currency>(); Database db = ConnectionSetting.GetConnection(); // DatabaseFactory.CreateDatabase(); DbCommand dbCommand = null; Int32 maxRows = 0; DataTable dt = null; DataTable dtNoOfDays = null; DataTable dtCurrencySelected = null; DataTable dtCurrency = null; DataTable dtHotelBranch = null; DataSet ds = null; try { dbCommand = db.GetStoredProcCommand("uspHotelForecastGet"); db.AddInParameter(dbCommand, "@pLoadType", DbType.Int16, LoadType); db.AddInParameter(dbCommand, "@pUserId", DbType.String, sUser); db.AddInParameter(dbCommand, "@pBranchName", DbType.String, sBranchName); db.AddInParameter(dbCommand, "@pDateFrom", DbType.DateTime, GlobalCode.Field2DateTime(sDateFrom)); db.AddInParameter(dbCommand, "@pDateTo", DbType.DateTime, GlobalCode.Field2DateTime(sDateTo)); db.AddInParameter(dbCommand, "@pVesselCode", DbType.String, ""); db.AddInParameter(dbCommand, "@pAirportCode", DbType.String, ""); db.AddInParameter(dbCommand, "@pHotelVendorView", DbType.Boolean, bIsHotelVendorView); db.AddInParameter(dbCommand, "@pShowAll", DbType.Boolean, bShowAll); //db.AddInParameter(dbCommand, "@pStartRow", DbType.String, StartRow); //db.AddInParameter(dbCommand, "@pMaxRow", DbType.String, MaxRow); //db.AddInParameter(dbCommand, "@pLoadType", DbType.String, LoadType); ds = db.ExecuteDataSet(dbCommand); dt = ds.Tables[1]; maxRows = Int32.Parse(ds.Tables[0].Rows[0][0].ToString()); list = (from a in dt.AsEnumerable() select new HotelForecastForApprovalList { colBranchIDInt = GlobalCode.Field2Long(a["colBranchIDInt"]), colDate = GlobalCode.Field2DateTime(a["colDate"]), // Confirmed_DBL = GlobalCode.Field2Int(a["Confirmed_DBL"]), // Overflow_DBL = GlobalCode.Field2Int(a["Overflow_DBL"]), // Confirmed_SGL = GlobalCode.Field2Int(a["Confirmed_SGL"]), // Overflow_SGL = GlobalCode.Field2Int(a["Overflow_SGL"]), Forecast_DBL = GlobalCode.Field2Int(a["colForecastDBL"]), Forecast_SGL = GlobalCode.Field2Int(a["colForecastSGL"]), Forecast_DBL_Adj = GlobalCode.Field2Int(a["colForecastDBLAdj"]), Forecast_SGL_Adj = GlobalCode.Field2Int(a["colForecastSGLAdj"]), RoomBlock_DBL = GlobalCode.Field2Int(a["colRoomBlockDBL"]), RoomBlock_SGL = GlobalCode.Field2Int(a["colRoomBlockSGL"]), RoomBlock_DBL_Total = GlobalCode.Field2Int(a["colRoomBlockDBLTotal"]), RoomBlock_SGL_Total = GlobalCode.Field2Int(a["colRoomBlockSGLTotal"]), TMBooked_DBL = GlobalCode.Field2Float(a["colTMBookedDBL"]), TMBooked_SGL = GlobalCode.Field2Float(a["colTMBookedSGL"]), ToBeAdded_DBL = GlobalCode.Field2Int(a["colToAddDBL"]), ToBeAdded_SGL = GlobalCode.Field2Int(a["colToAddSGL"]), IsEnable = GlobalCode.Field2Bool(a["colIsEnableBit"]), Forecast_DBL_Old = GlobalCode.Field2Int(a["colForecastDBLOld"]), Forecast_SGL_Old = GlobalCode.Field2Int(a["colForecastSGLOld"]), ToBeAdded_DBL_Suggested = GlobalCode.Field2Int(a["colToAddDBLSuggested"]), ToBeAdded_SGL_Suggested = GlobalCode.Field2Int(a["colToAddSGLSuggested"]), Remarks = a.Field <string>("colRemarksVarchar"), ApprovedDBL = GlobalCode.Field2Int(a["colApprovedDBL"]), ApprovedSGL = GlobalCode.Field2Int(a["colApprovedSGL"]), ActionDone = a.Field <string>("colActionVarchar"), IsLinkToRequestVisibleDBL = GlobalCode.Field2Bool(a["IsLinkToRequestVisibleDBL"]), IsLinkToRequestVisibleSGL = GlobalCode.Field2Bool(a["IsLinkToRequestVisibleSGL"]), IsNeededHotelVisibleDBL = GlobalCode.Field2Bool(a["IsNeededHotelVisibleDBL"]), IsNeededHotelVisibleSGL = GlobalCode.Field2Bool(a["IsNeededHotelVisibleSGL"]), RoomToDropDBL = GlobalCode.Field2Int(a["colRoomToDropDBL"]), RoomToDropSGL = GlobalCode.Field2Int(a["colRoomToDropSGL"]), RoomToDropColorDBL = a.Field <string>("RoomToDropColorDBL"), RoomToDropColorSGL = a.Field <string>("RoomToDropColorSGL"), RatePerDayMoneySGL = GlobalCode.Field2Float(a["colRatePerDayMoneySGL"]), RatePerDayMoneyDBL = GlobalCode.Field2Float(a["colRatePerDayMoneyDBL"]), CurrencyID = GlobalCode.Field2Int(a["colCurrencyIDInt"]), RoomRateTaxPercentage = GlobalCode.Field2Float(a["colRoomRateTaxPercentage"]), RoomRateIsTaxInclusive = GlobalCode.Field2Bool(a["colRoomRateIsTaxInclusive"]), IsRoomToDropVisibleToVendorBDL = GlobalCode.Field2Bool(a["IsRoomToDropVisibleToVendorBDL"]), IsRoomToDropVisibleToVendorSGL = GlobalCode.Field2Bool(a["IsRoomToDropVisibleToVendorSGL"]), IsRCCLApprovalVisible = GlobalCode.Field2Bool(a["IsRCCLApprovalVisible"]), MessageToVendor = GlobalCode.Field2String(a["MessageToVendor"]), CurrencyName = GlobalCode.Field2String(a["CurrencyName"]), }).ToList(); HttpContext.Current.Session["HotelForecastMicroApproval_Count"] = GlobalCode.Field2Int(maxRows); dtCurrencySelected = ds.Tables[2]; listCurrencySelected = (from a in dtCurrencySelected.AsEnumerable() select new HotelForecastCurrency { CurrencyID = GlobalCode.Field2Int(a["CurrencyID"]), CurrencyName = a.Field <string>("CurrencyName"), RateMoney = GlobalCode.Field2Decimal(a["RateMoney"]), IsTaxInclusive = GlobalCode.Field2Bool(a["IsTaxInclusive"]), Tax = GlobalCode.Field2Decimal(a["TaxPercentage"]), RoomTypeID = GlobalCode.Field2TinyInt(a["colRoomTypeIDInt"]), }).ToList(); HttpContext.Current.Session["HotelForecastMicroApproval_CurrencySelected"] = listCurrencySelected; dtHotelBranch = ds.Tables[3]; List <ContractHotel> listBranch = new List <ContractHotel>(); listBranch = (from a in dtHotelBranch.AsEnumerable() select new ContractHotel { contractID = GlobalCode.Field2Long(a["colContractIdInt"]), contractStatus = GlobalCode.Field2String(a["colContractStatusVarchar"]), contractStartDate = a.Field <DateTime?>("colContractDateStartedDate"), contractEndDate = a.Field <DateTime?>("colContractDateEndDate"), }).ToList(); HttpContext.Current.Session["HotelForecastMicroApproval_ContractHotel"] = listBranch; if (LoadType == 0) { dtNoOfDays = ds.Tables[4]; TMSettings.NoOfDaysForecast = GlobalCode.Field2TinyInt(dtNoOfDays.Rows[0]["colNoOfDays_Forecast"]); TMSettings.NoOfDaysForecastVendor = GlobalCode.Field2TinyInt(dtNoOfDays.Rows[0]["colNoOfDays_Forecast_Vendor"]); //dtCurrency = ds.Tables[5]; //listCurrency = (from a in dtCurrency.AsEnumerable() // select new Currency // { // CurrencyID = GlobalCode.Field2Int(a["colCurrencyIDInt"]), // CurrencyName = a.Field<string>("colCurrencyNameVarchar"), // }).ToList(); //HttpContext.Current.Session["HotelForecastMicroApproval_Currency"] = listCurrency; } return(list); } catch (Exception ex) { throw ex; } finally { if (dbCommand != null) { dbCommand.Dispose(); } if (ds != null) { ds.Dispose(); } if (dt != null) { dt.Dispose(); } if (dtCurrency != null) { dtCurrency.Dispose(); } if (dtCurrencySelected != null) { dtCurrencySelected.Dispose(); } if (dtNoOfDays != null) { dtNoOfDays.Dispose(); } if (dtHotelBranch != null) { dtHotelBranch.Dispose(); } if (list != null) { list = null; } } }
/// <summary> /// Author: Muhallidin G Wali /// Date Created: 01/oct/2014 /// Description: Get Excption Data to load in the page /// --------------------------------------------------------------- /// </summary> /// <returns></returns> public List <ExceptionPageData> GetExceptionPageData(short LoadType, string UserId , DateTime Date, int RegionID, int PortID, int CountryID, string UserRole ) { DataSet ds = new DataSet(); List <ExceptionPageData> ExceptionPageData = new List <ExceptionPageData>(); DbCommand com = null; try { Database db = ConnectionSetting.GetConnection(); // DatabaseFactory.CreateDatabase(); com = db.GetStoredProcCommand("upsGetExceptionPageData"); db.AddInParameter(com, "@pLoadType", DbType.Int16, LoadType); db.AddInParameter(com, "@pUserId", DbType.String, UserId); db.AddInParameter(com, "@pDate", DbType.DateTime, Date); db.AddInParameter(com, "@pRegionIDInt", DbType.Int32, RegionID); db.AddInParameter(com, "@pPortIDInt", DbType.Int32, PortID); db.AddInParameter(com, "@pCountryIdInt", DbType.Int32, CountryID); db.AddInParameter(com, "@pUserRolevarchar", DbType.String, UserRole); ds = db.ExecuteDataSet(com); ExceptionPageData.Add(new ExceptionPageData { RegionList = (from a in ds.Tables[0].AsEnumerable() select new RegionList { RegionId = GlobalCode.Field2Int(a["colRegionIDInt"]), RegionName = GlobalCode.Field2String(a["colRegionNameVarchar"]) }).ToList(), PortList = (from a in ds.Tables[1].AsEnumerable() select new PortList { PortId = GlobalCode.Field2Int(a["PORTID"]), PortName = GlobalCode.Field2String(a["PORT"]) }).ToList(), Hotels = (from a in ds.Tables[2].AsEnumerable() select new Hotels { VendorId = GlobalCode.Field2Int(a["VendorId"]), BranchId = GlobalCode.Field2Int(a["BranchId"]), BranchName = GlobalCode.Field2String(a["BranchName"]), CountryId = GlobalCode.Field2Int(a["CountryId"]), CityId = GlobalCode.Field2Int(a["CityId"]), isAccredited = GlobalCode.Field2Bool(a["isAccredited"]), withEvent = GlobalCode.Field2Bool(a["withEvent"]), withContract = GlobalCode.Field2Bool(a["withContract"]), ContractId = GlobalCode.Field2Int(a["ContractId"]), colDate = GlobalCode.Field2DateTime(a["colDate"]) }).ToList(), ExceptionBooking = (from a in ds.Tables[3].AsEnumerable() select new ExceptionBooking { ExceptionIdBigInt = GlobalCode.Field2Int(a["ExceptionIdBigInt"]), IdBigint = GlobalCode.Field2Int(a["IDBigint"]), SeqNo = GlobalCode.Field2Int(a["SeqNo"]), TravelReqId = GlobalCode.Field2Int(a["TravelReqId"]), E1TravelReqId = GlobalCode.Field2Int(a["E1TravelReqId"]), SeafarerId = GlobalCode.Field2Int(a["SeafarerId"]), SeafarerName = GlobalCode.Field2String(a["SeafarerName"]), PortId = GlobalCode.Field2Int(a["PortId"]), PortName = GlobalCode.Field2String(a["PortName"]), VesselName = GlobalCode.Field2String(a["VesselName"]), SFStatus = GlobalCode.Field2String(a["SFStatus"]), OnOffDate = GlobalCode.Field2DateTime(a["OnOffDate"]), ArrivalDepartureDatetime = GlobalCode.Field2DateTime(a["ArrivalDepartureDatetime"]), Carrier = GlobalCode.Field2String(a["Carrier"]), FlightNo = GlobalCode.Field2String(a["FlightNo"]), FromCity = GlobalCode.Field2String(a["FromCity"]), ToCity = GlobalCode.Field2String(a["ToCity"]), RankName = GlobalCode.Field2String(a["RankName"]), Stripes = GlobalCode.Field2Decimal(a["Stripes"]), RecordLocator = GlobalCode.Field2String(a["RecordLocator"]), Gender = GlobalCode.Field2String(a["Gender"]), Nationality = GlobalCode.Field2String(a["Nationality"]), RoomTypeId = GlobalCode.Field2Int(a["RoomTypeId"]), RoomType = GlobalCode.Field2String(a["RoomType"]), ReasonCode = GlobalCode.Field2String(a["ReasonCode"]), ExceptionRemarks = GlobalCode.Field2String(a["ExceptionRemarks"]), Invalid = GlobalCode.Field2Bool(a["Invalid"]), BookingRemarks = GlobalCode.Field2String(a["BookingRemarks"]), HotelCity = GlobalCode.Field2String(a["HotelCity"]), IsByPort = GlobalCode.Field2String(a["IsPort"]), //Comments = GlobalCode.Field2String(a["VendorId"]), //RemovedBy = GlobalCode.Field2String(a["VendorId"]), //Birthday = GlobalCode.Field2DateTime(a["VendorId"]), }).ToList() }); return(ExceptionPageData); } catch (Exception ex) { throw ex; } finally { if (com != null) { com.Dispose(); } if (ds != null) { ds.Dispose(); } } }
public List <HotelTransactionMedical> InsertHotelTransactionMedical(List <HotelTransactionMedical> Medical) { Database SFDatebase = ConnectionSetting.GetConnection(); // DatabaseFactory.CreateDatabase() DbCommand SFDbCommand = null; try { List <HotelTransactionMedical> HotelTransactionMedical = new List <HotelTransactionMedical>(); GlobalCode gc = new GlobalCode(); DataTable dt = new DataTable(); DataSet ds = new DataSet(); dt = gc.getDataTable(Medical); dt.Columns.Remove("ColorCode"); dt.Columns.Remove("ForeColor"); dt.Columns.Remove("IsMedical"); dt.Columns.Remove("CancellationTermsInt"); dt.Columns.Remove("HotelTimeZoneID"); dt.Columns.Remove("CutOffTime"); dt.Columns.Remove("IsConfirmed"); dt.Columns.Remove("Address"); dt.Columns.Remove("ContactNo"); dt.Columns.Remove("VendorName"); dt.Columns.Remove("RoomType"); string strTimeZone = TimeZone.CurrentTimeZone.StandardName.ToString(); SFDbCommand = SFDatebase.GetStoredProcCommand("uspHotelTransactionMedicalIns"); //SFDatebase.AddInParameter(SFDbCommand, "@pUserID", DbType.Int16, UserID ); SqlParameter param = new SqlParameter("@pHotelTransactionMedical", dt); param.Direction = ParameterDirection.Input; param.SqlDbType = SqlDbType.Structured; SFDbCommand.Parameters.Add(param); ds = SFDatebase.ExecuteDataSet(SFDbCommand); HotelTransactionMedical = (from n in ds.Tables[0].AsEnumerable() select new HotelTransactionMedical { TransHotelID = GlobalCode.Field2Long(n["colTransHotelIDBigInt"]), SeafarerID = GlobalCode.Field2Long(n["colSeafarerIDBigInt"]), FullName = GlobalCode.Field2String(n["colFullNameVarchar"]), TravelReqID = GlobalCode.Field2Long(n["colTravelReqIDInt"]), IdBigint = GlobalCode.Field2Long(n["colIdBigint"]), RecordLocator = GlobalCode.Field2String(n["colRecordLocatorVarchar"]), SeqNo = GlobalCode.Field2Int(n["colSeqNoInt"]), PortAgentVendorID = GlobalCode.Field2Long(n["colPortAgentVendorIDInt"]), RoomTypeID = GlobalCode.Field2Int(n["colRoomTypeIDInt"]), RoomType = GlobalCode.Field2String(n["RoomType"]), ReserveUnderName = GlobalCode.Field2String(n["colReserveUnderNameVarchar"]), TimeSpanStartDate = GlobalCode.Field2DateTime(n["colTimeSpanStartDate"]), TimeSpanStartTime = GlobalCode.Field2DateTime(n["colTimeSpanStartTime"]), TimeSpanEndDate = GlobalCode.Field2DateTime(n["colTimeSpanEndDate"]), TimeSpanEndTime = GlobalCode.Field2DateTime(n["colTimeSpanEndTime"]), TimeSpanDuration = GlobalCode.Field2Int(n["colTimeSpanDurationInt"]), ConfirmationNo = GlobalCode.Field2String(n["colConfirmationNoVarchar"]), HotelStatus = GlobalCode.Field2String(n["colHotelStatusVarchar"]), DateCreatedDatetime = GlobalCode.Field2DateTime(n["colDateCreatedDatetime"]), CreatedBy = GlobalCode.Field2String(n["colCreatedByVarchar"]), IsActive = GlobalCode.Field2Bool(n["colIsActiveBit"]), VoucherAmount = GlobalCode.Field2Long(n["colVoucherAmountMoney"]), ContractID = GlobalCode.Field2Long(n["colContractIDInt"]), ApprovedBy = GlobalCode.Field2String(n["colApprovedByVarchar"]), ApprovedDate = GlobalCode.Field2DateTime(n["colApprovedDate"]), ContractFrom = GlobalCode.Field2String(n["colContractFromVarchar"]), RemarksForAudit = GlobalCode.Field2String(n["colRemarksForAuditVarchar"]), HotelCity = GlobalCode.Field2String(n["colHotelCityVarchar"]), RoomCount = GlobalCode.Field2Float(n["colRoomCountFloat"]), HotelName = GlobalCode.Field2String(n["colHotelNameVarchar"]), ConfirmRateMoney = GlobalCode.Field2Decimal(n["colConfirmRateMoney"]), ContractedRateMoney = GlobalCode.Field2Decimal(n["colContractedRateMoney"]), EmailTo = GlobalCode.Field2String(n["colEmailToVarchar"]), Comment = GlobalCode.Field2String(n["colCommentVarchar"]), CurrencyID = GlobalCode.Field2Int(n["colCurrencyInt"]), ConfirmBy = GlobalCode.Field2String(n["colConfirmByVarchar"]), StatusID = GlobalCode.Field2TinyInt(n["colStatusIDTinyint"]), ColorCode = GlobalCode.Field2String(n["ColorCode"]), ForeColor = GlobalCode.Field2String(n["ForeColor"]), IsMedical = GlobalCode.Field2Bool(n["IsMedical"]), CancellationTermsInt = GlobalCode.Field2String(n["CancellationTermsInt"]), HotelTimeZoneID = GlobalCode.Field2String(n["HotelTimeZoneID"]), CutOffTime = GlobalCode.Field2String(n["CutOffTime"]), IsConfirmed = GlobalCode.Field2String(n["IsConfirmed"]), Address = GlobalCode.Field2String(n["Address"]), ContactNo = GlobalCode.Field2String(n["ContactNo"]), Breakfast = GlobalCode.Field2Bool(n["colBreakfastBit"]), IsBilledToCrew = GlobalCode.Field2Bool(n["colIsBilledToCrewBit"]), Lunch = GlobalCode.Field2Bool(n["colLunchBit"]), Dinner = GlobalCode.Field2Bool(n["colDinnerBit"]), LunchOrDinner = GlobalCode.Field2Bool(n["colLunchOrDinnerBit"]), WithShuttle = GlobalCode.Field2Bool(n["colWithShuttleBit"]), VendorName = GlobalCode.Field2String(n["VendorName"]), IsPortAgent = GlobalCode.Field2Bool(n["IsPortAgent"]), }).ToList(); return(HotelTransactionMedical); } catch (Exception ex) { throw ex; } finally { if (SFDbCommand != null) { SFDbCommand.Dispose(); } } }
private List <CrewMemberInformation> ProcessSeafarerInfo(DataSet ds, string UserID) { List <CrewMemberInformation> SeafarerInfo = new List <CrewMemberInformation>(); try { if (ds != null) { if (ds.Tables.Count > 0) { return((from a in ds.Tables[0].AsEnumerable() select new CrewMemberInformation { SeafarerID = GlobalCode.Field2Long(a["colSeafarerIdInt"]), FirstName = GlobalCode.Field2String(a["colFirstNameVarchar"]), LastName = GlobalCode.Field2String(a["colLastNameVarchar"]), Name = GlobalCode.Field2String(a["FullName"]), Gender = GlobalCode.Field2String(a["colGenderDiscription"]), NationalityID = GlobalCode.Field2Int(a["colNatioalityIdInt"]), NationalityCode = GlobalCode.Field2String(a["colNationalityCodeVarchar"]), Nationality = GlobalCode.Field2String(a["colNationalityDescriptionVarchar"]), CrewSchedule = (from n in ds.Tables[1].AsEnumerable() select new CrewSchedule { TravelRequestID = n.Field <long?>("TravelRequestID"), IDBigint = n.Field <long?>("colIDBigInt"), SeqNo = n.Field <int?>("SeqNo"), RecordLocator = n.Field <string>("colRecordLocatorVarchar"), VesselID = n.Field <int?>("colVesselIdInt"), Vessel = n.Field <string>("colVesselLongCodeVarchar"), VesselCode = n.Field <string>("colVesselCodeVarchar"), Status = n.Field <string>("colStatusVarchar"), SignOnOffDate = n.Field <DateTime?>("RequestDate"), PortID = n.Field <int?>("colPortIdInt"), Port = n.Field <string>("colPortNameVarchar"), PortCode = n.Field <string>("colPortCodeVarchar"), ReasonCode = n.Field <string>("colReasonCodeVarchar"), CostcenterID = n.Field <int?>("colCostCenterIDInt"), Costcenter = n.Field <string>("colCostCenterNameVarchar"), RankID = n.Field <int?>("colRankIDInt"), Rank = n.Field <string>("colRankNameVarchar"), RankCode = n.Field <string>("colRankCodeVarchar"), BrandID = n.Field <int?>("colBrandIdInt"), Brand = n.Field <string>("colBrandNameVarchar"), LOEStatus = GlobalCode.Field2String(n["LOEStatus"]), LOEDate = n.Field <DateTime?>("LOEDate"), LOEImmigrationOfficer = GlobalCode.Field2String(n["LOEImmigrationOfficer"]), LOEImmigrationPlace = GlobalCode.Field2String(n["LOEImmigrationPlace"]), LOEReason = GlobalCode.Field2String(n["Reason"]), }).ToList(), Remark = (from n in ds.Tables[2].AsEnumerable() select new CrewAssisRemark { TravelRequestID = n.Field <long?>("TravelRequestID"), RemarkID = n.Field <long?>("RemarkID"), Remark = n.Field <string>("Remark"), RemarkBy = n.Field <string>("RemarkBy"), RemarkDate = n.Field <DateTime?>("RemarkDate"), Visible = n.Field <string>("Visible"), //n.Field<string>("CreatedBy") == UserID ? "True" : "False", ReqResourceID = GlobalCode.Field2TinyInt(n["colRemarkSourceID"]), Resource = n.Field <string>("colRemarkSource"), IDBigInt = n.Field <long?>("IDBigInt"), RecordLocator = n.Field <string>("RecordLocator") }).ToList(), HotelTransactionMedical = (from n in ds.Tables[3].AsEnumerable() select new HotelTransactionMedical { TransHotelID = GlobalCode.Field2Long(n["colTransHotelIDBigInt"]), SeafarerID = GlobalCode.Field2Long(n["colSeafarerIDBigInt"]), FullName = GlobalCode.Field2String(n["colFullNameVarchar"]), TravelReqID = GlobalCode.Field2Long(n["colTravelReqIDInt"]), IdBigint = GlobalCode.Field2Long(n["colIdBigint"]), RecordLocator = GlobalCode.Field2String(n["colRecordLocatorVarchar"]), SeqNo = GlobalCode.Field2Int(n["colSeqNoInt"]), PortAgentVendorID = GlobalCode.Field2Long(n["colPortAgentVendorIDInt"]), RoomTypeID = GlobalCode.Field2Int(n["colRoomTypeIDInt"]), RoomType = GlobalCode.Field2String(n["RoomType"]), ReserveUnderName = GlobalCode.Field2String(n["colReserveUnderNameVarchar"]), TimeSpanStartDate = GlobalCode.Field2DateTime(n["colTimeSpanStartDate"]), TimeSpanStartTime = GlobalCode.Field2DateTime(n["colTimeSpanStartTime"]), TimeSpanEndDate = GlobalCode.Field2DateTime(n["colTimeSpanEndDate"]), TimeSpanEndTime = GlobalCode.Field2DateTime(n["colTimeSpanEndTime"]), TimeSpanDuration = GlobalCode.Field2Int(n["colTimeSpanDurationInt"]), ConfirmationNo = GlobalCode.Field2String(n["colConfirmationNoVarchar"]), HotelStatus = GlobalCode.Field2String(n["colHotelStatusVarchar"]), DateCreatedDatetime = GlobalCode.Field2DateTime(n["colDateCreatedDatetime"]), CreatedBy = GlobalCode.Field2String(n["colCreatedByVarchar"]), IsActive = GlobalCode.Field2Bool(n["colIsActiveBit"]), VoucherAmount = GlobalCode.Field2Long(n["colVoucherAmountMoney"]), ContractID = GlobalCode.Field2Long(n["colContractIDInt"]), ApprovedBy = GlobalCode.Field2String(n["colApprovedByVarchar"]), ApprovedDate = GlobalCode.Field2DateTime(n["colApprovedDate"]), ContractFrom = GlobalCode.Field2String(n["colContractFromVarchar"]), RemarksForAudit = GlobalCode.Field2String(n["colRemarksForAuditVarchar"]), HotelCity = GlobalCode.Field2String(n["colHotelCityVarchar"]), RoomCount = GlobalCode.Field2Float(n["colRoomCountFloat"]), HotelName = GlobalCode.Field2String(n["colHotelNameVarchar"]), ConfirmRateMoney = GlobalCode.Field2Decimal(n["colConfirmRateMoney"]), ContractedRateMoney = GlobalCode.Field2Decimal(n["colContractedRateMoney"]), EmailTo = GlobalCode.Field2String(n["colEmailToVarchar"]), Comment = GlobalCode.Field2String(n["colCommentVarchar"]), CurrencyID = GlobalCode.Field2Int(n["colCurrencyInt"]), ConfirmBy = GlobalCode.Field2String(n["colConfirmByVarchar"]), StatusID = GlobalCode.Field2TinyInt(n["colStatusIDTinyint"]), ColorCode = GlobalCode.Field2String(n["ColorCode"]), ForeColor = GlobalCode.Field2String(n["ForeColor"]), IsMedical = GlobalCode.Field2Bool(n["IsMedical"]), CancellationTermsInt = GlobalCode.Field2String(n["CancellationTermsInt"]), HotelTimeZoneID = GlobalCode.Field2String(n["HotelTimeZoneID"]), CutOffTime = GlobalCode.Field2String(n["CutOffTime"]), IsConfirmed = GlobalCode.Field2String(n["IsConfirmed"]), Address = GlobalCode.Field2String(n["Address"]), ContactNo = GlobalCode.Field2String(n["ContactNo"]), Breakfast = GlobalCode.Field2Bool(n["colBreakfastBit"]), IsBilledToCrew = GlobalCode.Field2Bool(n["colIsBilledToCrewBit"]), Lunch = GlobalCode.Field2Bool(n["colLunchBit"]), Dinner = GlobalCode.Field2Bool(n["colDinnerBit"]), LunchOrDinner = GlobalCode.Field2Bool(n["colLunchOrDinnerBit"]), WithShuttle = GlobalCode.Field2Bool(n["colWithShuttleBit"]), VendorName = GlobalCode.Field2String(n["VendorName"]), IsPortAgent = GlobalCode.Field2Bool(n["IsPortAgent"]), }).ToList(), VehicleTransactionMedical = (from n in ds.Tables[4].AsEnumerable() select new VehicleTransactionMedical { TransVehicleID = GlobalCode.Field2Long(n["colTransVehicleIDBigint"]), SeafarerID = GlobalCode.Field2Long(n["colSeafarerIDBigint"]), IdBigint = GlobalCode.Field2Long(n["colIdBigint"]), TravelReqID = GlobalCode.Field2Long(n["colTravelReqIDInt"]), RecordLocator = GlobalCode.Field2String(n["colRecordLocatorVarchar"]), TranspoVendorID = GlobalCode.Field2Long(n["colTranspoVendorIDInt"]), VehiclePlateNo = GlobalCode.Field2String(n["colVehiclePlateNoVarchar"]), PickUpDate = GlobalCode.Field2DateTime(n["colPickUpDate"]), PickUpTime = GlobalCode.Field2DateTime(n["colPickUpTime"]), DropOffDate = GlobalCode.Field2DateTime(n["colDropOffDate"]), DropOffTime = GlobalCode.Field2DateTime(n["colDropOffTime"]), ConfirmationNo = GlobalCode.Field2String(n["colConfirmationNoVarchar"]), VehicleStatus = GlobalCode.Field2String(n["colVehicleStatusVarchar"]), VehicleTypeId = GlobalCode.Field2Int(n["colVehicleTypeIdInt"]), SFStatus = GlobalCode.Field2String(n["colSFStatus"]), RouteIDFrom = GlobalCode.Field2Int(n["colRouteIDFromInt"]), RouteIDTo = GlobalCode.Field2Int(n["colRouteIDToInt"]), From = GlobalCode.Field2String(n["colFromVarchar"]), To = GlobalCode.Field2String(n["colToVarchar"]), DateCreated = GlobalCode.Field2DateTime(n["colDateCreatedDatetime"]), DateModified = GlobalCode.Field2DateTime(n["colDateModifiedDatetime"]), CreatedBy = GlobalCode.Field2String(n["colCreatedByVarchar"]), Modifiedby = GlobalCode.Field2String(n["colModifiedbyVarchar"]), IsActive = GlobalCode.Field2Bool(n["colIsActiveBit"]), RemarksForAudit = GlobalCode.Field2String(n["colRemarksForAuditVarchar"]), HotelID = GlobalCode.Field2Int(n["colHotelIDInt"]), IsVisible = GlobalCode.Field2Bool(n["colIsVisibleBit"]), ContractId = GlobalCode.Field2Int(n["colContractIdInt"]), IsSeaport = GlobalCode.Field2Bool(n["colIsSeaportBit"]), SeqNo = GlobalCode.Field2Int(n["colSeqNoInt"]), Driver = GlobalCode.Field2String(n["colDriverVarchar"]), VehicleDispatchTime = GlobalCode.Field2String(n["colVehicleDispatchTime"]), RouteFrom = GlobalCode.Field2String(n["colRouteFromVarchar"]), RouteTo = GlobalCode.Field2String(n["colRouteToVarchar"]), VehicleUnset = GlobalCode.Field2Bool(n["colVehicleUnset"]), VehicleUnsetBy = GlobalCode.Field2String(n["colVehicleUnsetBy"]), VehicleUnsetDate = GlobalCode.Field2DateTime(n["colVehicleUnsetDate"]), ConfirmBy = GlobalCode.Field2String(n["colConfirmByVarchar"]), Comments = GlobalCode.Field2String(n["colCommentsVarchar"]), ContractedRateMoney = GlobalCode.Field2Double(n["colContractedRateMoney"]), ConfirmRateMoney = GlobalCode.Field2Double(n["colConfirmRateMoney"]), CurrencyInt = GlobalCode.Field2Int(n["colCurrencyInt"]), StatusID = GlobalCode.Field2TinyInt(n["colStatusIDTinyint"]), ApprovedBy = GlobalCode.Field2String(n["colApprovedByVarchar"]), ApprovedDate = GlobalCode.Field2DateTime(n["colApprovedDate"]), EmailTo = GlobalCode.Field2String(n["colEmailTovarchar"]), RequestSourceID = GlobalCode.Field2TinyInt(n["colRequestSourceIDInt"]), TransportationDetails = GlobalCode.Field2String(n["colTransportationDetails"]), IsPortAgent = GlobalCode.Field2Bool(n["colIsPortAgentBit"]), VehicleVendor = GlobalCode.Field2String(n["VendorName"]), ColorCode = GlobalCode.Field2String(n["ColorCode"]), ForeColor = GlobalCode.Field2String(n["ForeColor"]), }).ToList() }).ToList()); } } } catch (Exception ex) { throw ex; } finally { if (ds != null) { ds.Dispose(); } } return(SeafarerInfo); }