/// <summary>
        /// Date Created:   01/Oct/2013
        /// Created By:     Josephine Gad
        /// (description)   Add contract vehicle details to session
        /// -----------------------------------------------------------
        /// Date Modified:   03/Oct/2013
        /// Created By:     Marco Abejar
        /// (description)   Modify route fields (from/to)
        /// </summary>
        private void ContractServiceDetailsAdd(int iServiceType, string sServiceType)
        {
            uoGridViewService.DataSource = null;
            try
            {
                List <ContractServiceDetailsAmt> list = new List <ContractServiceDetailsAmt>();
                ContractServiceDetailsAmt        item = new ContractServiceDetailsAmt();

                list = GetContractServiceDetailsList();

                item.BranchID   = GlobalCode.Field2Int(uoHiddenFieldVendorId.Value);
                item.ContractID = GlobalCode.Field2Int(uoHiddenFieldContractID.Value);
                //item.VehicleTypeID = GlobalCode.Field2Int(uoDropDownListServiceTypeDuration.SelectedValue);
                //item.ContractServiceDurationID = GlobalCode.Field2Int(uoDropDownListServiceTypeDuration.SelectedItem.Value);
                item.ContractServiceDurationID = iServiceType;
                //item.ServiceType = uoDropDownListServiceTypeDuration.SelectedItem.Text;
                item.ServiceType = sServiceType;
                item.RateAmount  = GlobalCode.Field2Float(uoTextBoxVehicleRate.Text);
                item.Tax         = GlobalCode.Field2Float(uoTextBoxTax.Text);

                int iIdentity = 1;
                if (uoHiddenFieldDetail.Value == "0")
                {
                    if (list.Count > 0)
                    {
                        iIdentity = GlobalCode.Field2Int(list[(list.Count - 1)].ContractDetailID) + 1;
                    }
                    item.ContractDetailID = iIdentity;
                    list.Add(item);
                }
                else
                {
                    iIdentity = GlobalCode.Field2Int(uoHiddenFieldDetail.Value);
                    list.RemoveAll(a => list.Exists(b => a.ContractDetailID == iIdentity));
                    item.ContractDetailID = iIdentity;
                    list.Add(item);
                }

                uoHiddenFieldDetail.Value = "0";
                list = list.OrderBy(a => a.ServiceType).ToList();

                Session["ContractServiceDetailsAmt"] = list;
                BindContractServiceDetailsList();
                uoButtonAddService.Text = uoHiddenFieldDetail.Value == "0" ? "Add" : "Save";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   14/Apr/2014
        /// Description:    get the amount to be saved with contracted rate
        /// </summary>
        /// <returns></returns>
        private DataTable getManifestAmountWithContract()
        {
            DataTable dt = null;

            try
            {
                dt = new DataTable();
                DataColumn dtCol;

                dtCol = new DataColumn("ContractRate", typeof(float));
                dt.Columns.Add(dtCol);

                dtCol = new DataColumn("Rate", typeof(float));
                dt.Columns.Add(dtCol);

                dtCol = new DataColumn("IDBigint", typeof(Int64));
                dt.Columns.Add(dtCol);

                dtCol = new DataColumn("TRID", typeof(Int64));
                dt.Columns.Add(dtCol);

                dtCol = new DataColumn("TransID", typeof(Int64));
                dt.Columns.Add(dtCol);

                dtCol = new DataColumn("SeqNo", typeof(Int32));
                dt.Columns.Add(dtCol);

                dtCol = new DataColumn("RouteFromID", typeof(Int16));
                dt.Columns.Add(dtCol);

                dtCol = new DataColumn("RouteToID", typeof(Int16));
                dt.Columns.Add(dtCol);

                dtCol = new DataColumn("RouteFromCity", typeof(string));
                dt.Columns.Add(dtCol);

                dtCol = new DataColumn("RouteToCity", typeof(string));
                dt.Columns.Add(dtCol);


                DataRow dtRow;

                HiddenField hiddenRecLocID;
                HiddenField hiddenTRID;
                HiddenField hiddenTransID;
                TextBox     txtRate;
                Label       lblContractRate;
                HiddenField hdnContractRate;
                Label       lblSeqNo;
                Label       lblRouteFromCity;
                Label       lblRouteToCity;
                HiddenField hdnRouteFromID;
                HiddenField hdnRouteToID;


                int iTotal = uoListviewVehicleInfo.Items.Count();
                for (int i = 0; i < iTotal; i++)
                {
                    hiddenRecLocID   = (HiddenField)uoListviewVehicleInfo.Items[i].FindControl("uoHiddenFieldListRecLocID");
                    hiddenTRID       = (HiddenField)uoListviewVehicleInfo.Items[i].FindControl("uoHiddenFieldListTRID");
                    hiddenTransID    = (HiddenField)uoListviewVehicleInfo.Items[i].FindControl("uoHiddenFieldTransID");
                    txtRate          = (TextBox)uoListviewVehicleInfo.Items[i].FindControl("uoTextBoxRateConfirmedPerSeafarer");
                    lblContractRate  = (Label)uoListviewVehicleInfo.Items[i].FindControl("uoLabelContractedRate");
                    hdnContractRate  = (HiddenField)uoListviewVehicleInfo.Items[i].FindControl("uoHiddenFieldContractedRate");
                    lblSeqNo         = (Label)uoListviewVehicleInfo.Items[i].FindControl("uoLabelSeqNo");
                    lblRouteFromCity = (Label)uoListviewVehicleInfo.Items[i].FindControl("uoLabelRouteFromCity");
                    lblRouteToCity   = (Label)uoListviewVehicleInfo.Items[i].FindControl("uoLabelRouteToCity");
                    hdnRouteFromID   = (HiddenField)uoListviewVehicleInfo.Items[i].FindControl("uoHiddenFieldRouteFromID");
                    hdnRouteToID     = (HiddenField)uoListviewVehicleInfo.Items[i].FindControl("uoHiddenFieldRouteToID");

                    dtRow = dt.NewRow();

                    dtRow["ContractRate"]  = GlobalCode.Field2Float(hdnContractRate.Value);
                    dtRow["Rate"]          = GlobalCode.Field2Float(txtRate.Text);
                    dtRow["IDBigint"]      = GlobalCode.Field2Int(hiddenRecLocID.Value);
                    dtRow["TRID"]          = GlobalCode.Field2Int(hiddenTRID.Value);
                    dtRow["TransID"]       = GlobalCode.Field2Int(hiddenTransID.Value);
                    dtRow["SeqNo"]         = GlobalCode.Field2Int(lblSeqNo.Text);
                    dtRow["RouteFromID"]   = GlobalCode.Field2TinyInt(hdnRouteFromID.Value);
                    dtRow["RouteToID"]     = GlobalCode.Field2TinyInt(hdnRouteToID.Value);
                    dtRow["RouteFromCity"] = lblRouteFromCity.Text;
                    dtRow["RouteToCity"]   = lblRouteToCity.Text;

                    dt.Rows.Add(dtRow);
                }
                return(dt);
            }
            catch (Exception ex)
            {
                AlertErrorMessage(ex.Message);
                throw ex;
            }
            finally
            {
                dt.Dispose();
            }
        }
Exemple #3
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   10/Mar/2014
        /// Description:    Confirm Service Provider Vehicle Manifest
        /// </summary>
        private void ConfirmVehicle()
        {
            Int32     iContractIDInt = GlobalCode.Field2Int(uoHiddenFieldContractID.Value);
            Int16     iVehicleTypeId = GlobalCode.Field2TinyInt(uoDropDownListVehicleType.SelectedValue);
            DataTable dt             = null;

            try
            {
                int   iCurrency = GlobalCode.Field2Int(uoDropDownListCurrency.SelectedValue);
                float fRate     = GlobalCode.Field2Float(uoTextBoxRateConfirmed.Text);

                DateTime dateNow = CommonFunctions.GetCurrentDateTime();

                string sTimeSpan = "";
                if (uoTextBoxPickupTime.Text.Trim() != "")
                {
                    sTimeSpan = GlobalCode.Field2DateTimeWithTime(uoTextBoxPickupTime.Text).ToString();
                }
                Int16 iVehicleTypeID = GlobalCode.Field2TinyInt(uoDropDownListVehicleType.SelectedValue);

                string sAction = GlobalCode.Field2String(Request.QueryString["Action"]);
                if (User.IsInRole(TravelMartVariable.RolePortSpecialist) &&
                    (sAction == ""))
                {
                    dt = getManifestAmountWithContract();
                    BLL.PortAgentManifestConfirmVehicle(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                        uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(), sTimeSpan,
                                                        iCurrency, fRate, uoTextBoxConfirmation.Text.Trim(),
                                                        "", uoTextBoxDriver.Text, uoTextBoxPlateNo.Text,
                                                        iVehicleTypeID, uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, iContractIDInt, "Confirmed Vehicle by Service Provider Vendor",
                                                        "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                        CommonFunctions.GetDateTimeGMT(dateNow), dateNow, dt, uoTextBoxTranspoDetails.Text.Trim());
                }
                else if (sAction == "EditAmount")
                {
                    dt = getManifestAmount();
                    BLL.PortAgentManifestConfirmVehicleAmount(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                              uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(),
                                                              iCurrency, fRate, uoTextBoxConfirmation.Text.Trim(),
                                                              uoTextBoxComment.Text,
                                                              uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, "Changed Amount of Vehicle by RCCL",
                                                              "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                              CommonFunctions.GetDateTimeGMT(dateNow), dateNow, dt);
                }
                else if (sAction == "Approve")
                {
                    BLL.PortAgentManifestConfirmVehicleApprove(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                               uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(),
                                                               uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue,
                                                               "Approve Service Provider Vehicle Manifest by RCCL",
                                                               "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                               CommonFunctions.GetDateTimeGMT(dateNow), dateNow);
                }
                else if (sAction == "CancelByRCCL" || sAction == "Cancel")
                {
                    string sDescription = sAction + ": Cancel Service Provider Vehicle Manifest";

                    BLL.PortAgentManifestConfirmVehicleCancel(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                              uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(),
                                                              uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, sDescription,
                                                              "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                              CommonFunctions.GetDateTimeGMT(dateNow), dateNow);
                }
                else if (sAction == "Add")
                {
                    dt = getManifestAmountWithContract();
                    BLL.PortAgentManifestConfirmVehicleAdd(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                           uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(),
                                                           iCurrency, fRate, uoTextBoxConfirmation.Text.Trim(),
                                                           uoTextBoxComment.Text,
                                                           uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, iContractIDInt,
                                                           iVehicleTypeId, "Create Vehicle Request by RCCL",
                                                           "ConfirmVehicle", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                           CommonFunctions.GetDateTimeGMT(dateNow), dateNow, dt);
                }
            }
            catch (Exception ex)
            {
                AlertErrorMessage("Confirm Vehicle: " + ex.Message);
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
        void insertHotelrequest(string spName, string status)
        {
            int?StatusID = null;

            List <NonTurnRequestBooking> PAH = new List <NonTurnRequestBooking>();

            foreach (ListViewDataItem item in uolistviewHotelInfo.Items)
            {
                if (status == "Cancel")
                {
                    StatusID = 5;
                }
                else
                {
                    StatusID = GlobalCode.Field2Int(((HiddenField)item.FindControl("uoHiddenFieldStatusID")).Value);
                }


                PAH.Add(new NonTurnRequestBooking
                {
                    TransHotelID  = GlobalCode.Field2Long(((HiddenField)item.FindControl("uoHiddenFieldTransHotelID")).Value),
                    TravelReqID   = GlobalCode.Field2Long(((HiddenField)item.FindControl("uoHiddenFieldListTRID")).Value),
                    SeafarerID    = GlobalCode.Field2Long(((Label)item.FindControl("uoLblSfID")).Text),
                    IdBigint      = GlobalCode.Field2Long(((HiddenField)item.FindControl("uoHiddenFieldListRecLocID")).Value),
                    RecordLocator = GlobalCode.Field2String(((Label)item.FindControl("uoLblRecLoc")).Text),
                    SeqNo         = GlobalCode.Field2Int(((HiddenField)item.FindControl("uoHiddenFieldSeqNo")).Value),
                    VendorID      = GlobalCode.Field2Int(uoVendorDropDownList.SelectedItem.Value),
                    RoomTypeID    = ((Label)item.FindControl("uoLblRoom")).Text == "double" ? 2 : 1,
                    CheckIn       = GlobalCode.Field2DateTime(uoTextBoxCheckInDate.Text),
                    CheckOut      = GlobalCode.Field2DateTime(((Label)item.FindControl("uoLblCheckOut")).Text),
                    Duration      = GlobalCode.Field2Int(((Label)item.FindControl("uoLblNites")).Text) <= 0 ? 1 : GlobalCode.Field2Int(((Label)item.FindControl("uoLblNites")).Text),
                    VoucherAmount = GlobalCode.Field2Double(uoHiddenFieldVoucher.Value),
                    ContractID    = GlobalCode.Field2Int(uoHiddenFieldContractID.Value),
                    ApprovedBy    = GlobalCode.Field2String(uoTextBoxConfirmedBy.Text),
                    ApprovedDate  = DateTime.Now.Date,
                    RoomCount     = GlobalCode.Field2Float((((Label)item.FindControl("uoLblRoom"))).Text == "double" ? 0.5 : 1.0),
                    HotelName     = GlobalCode.Field2String(uoTextBoxHotelname.Text),
                    //ConfirmRateMoney = GlobalCode.Field2Double(uoTextBoxRateConfirmed.Text),
                    //ContractedRateMoney = GlobalCode.Field2Double(uoTextBoxRateContract.Text),

                    ConfirmRateMoney    = GlobalCode.Field2Double(((TextBox)item.FindControl("txtContractedRate")).Text),
                    ContractedRateMoney = GlobalCode.Field2Double(((Label)item.FindControl("lblContractedRate")).Text),

                    EmailTo   = GlobalCode.Field2String(uoTextBoxEmailAdd.Text),
                    EmailCC   = GlobalCode.Field2String(uoTextBoxCopy.Text),
                    Comment   = GlobalCode.Field2String(uoTextBoxComment.Text),
                    Currency  = GlobalCode.Field2Int(uoDropDownListCurrency.SelectedItem.Value),
                    ConfirmBy = GlobalCode.Field2String(uoTextBoxConfirmedBy.Text),
                    StatusID  = StatusID,//GlobalCode.Field2Int(((HiddenField)item.FindControl("uoHiddenFieldStatusID")).Value),// == 1 ? 2 : 4 ,
                    IsMedical = GlobalCode.Field2Bool(((HiddenField)item.FindControl("uoHiddenFieldIsMedical")).Value),
                    UserID    = uoHiddenFieldUser.Value
                });
            }

            GlobalCode gc = new GlobalCode();
            DataTable  dt = new DataTable();

            dt = gc.getDataTable(PAH);

            PortBLL = new PortAgentBLL();
            PortBLL.InsertNonTurnTransactionRequestBooking(dt, spName, uoHiddenFieldUser.Value, uoTextBoxEmailAdd.Text, uoTextBoxCopy.Text);
        }
        /// <summary>
        /// Date Created:   22/02/2011
        /// Created By:     Josephine Gad
        /// (description)   disable lock button if past dates and if there is no data
        /// -------------------------------------------------------
        /// Date Modified:  23/03/2012
        /// Modified By:    Josephine Gad
        /// (description)   disable lock button  if already locked
        /// -------------------------------------------------------
        /// Date Modified:  02/10/2012
        /// Modified By:    Josephine Gad
        /// (description)   disable lock button  if "ALL Hotel" is selected
        /// -------------------------------------------------------
        /// </summary>
        //private void ButtonLockSettings()
        //{
        //    if (uolistviewHotelInfo.Items.Count > 0)
        //    {
        //        //uoBtnExportList.Enabled = true;
        //        if (uoDropDownListHotel.SelectedValue == "-1")
        //        {
        //            //uoButtonLock.Enabled = false;
        //        }
        //    }
        //    else
        //    {
        //        //uoBtnExportList.Enabled = false;
        //    }

        //    string sDate = GlobalCode.Field2DateTime((uoHiddenFieldDate.Value)).ToString();
        //    if (GlobalCode.Field2DateTime((sDate)) < DateTime.Parse(DateTime.Now.ToString("MM/dd/yyyy")))
        //    {
        //        //uoButtonLock.Enabled = false;
        //    }
        //    //bool IsAlreadyLocked = HotelManifestBLL.IsHotelHasLockedManifest(sDate, uoDropDownListHotel.SelectedValue, uoDropDownListHours.SelectedValue);
        //    //if (IsAlreadyLocked)
        //    //{
        //    //    uoButtonLock.Enabled = false;
        //    //}
        //}
        /// <summary>
        /// Date Created:   05/May/2015
        /// Created By:     Josephine Monteza
        /// (description)   Save the Additional Room to Hotel Room Blocks
        /// -------------------------------------------------------
        /// </summary>
        private void ApproveHotelForecast()
        {
            DataTable dt = null;

            try
            {
                HotelForecastBLL BLL      = new HotelForecastBLL();
                DateTime         dateNow  = CommonFunctions.GetCurrentDateTime();
                DateTime         dateOnly = GlobalCode.Field2DateTime(dateNow.ToString("MM/dd/yyyy"));

                Label listLabelDate;

                HiddenField listHiddenFieldToAddDBL;
                HiddenField listHiddenFieldToAddSGL;

                TextBox listTextBoxDBL;
                TextBox listTextBoxSGL;

                TextBox listTextBoxRoomToDropDBL;
                TextBox listTextBoxRoomToDropSGL;

                TextBox  listTextBoxRatePerDayMoneyDBL;
                TextBox  listTextBoxRatePerDayMoneySGL;
                TextBox  listTextBoxRoomRateTaxPercentage;
                CheckBox listCheckBoxTaxInclusive;

                DropDownList listDropDownListAction;

                int iCount   = uolistviewHotelInfo.Items.Count;
                int iHotelID = GlobalCode.Field2Int(uoHiddenFieldHotelID.Value);

                DataColumn colBranchIDInt = new DataColumn("colBranchIDInt", typeof(Int64));
                DataColumn colDate        = new DataColumn("colDate", typeof(DateTime));
                DataColumn colToAddDBL    = new DataColumn("colToAddDBL", typeof(int));
                DataColumn colToAddSGL    = new DataColumn("colToAddSGL", typeof(int));
                DataColumn colAction      = new DataColumn("colAction", typeof(string));

                DataColumn colRoomToDropDBL = new DataColumn("colRoomToDropDBL", typeof(int));
                DataColumn colRoomToDropSGL = new DataColumn("colRoomToDropSGL", typeof(int));

                DataColumn colRatePerDayMoneySGL     = new DataColumn("colRatePerDayMoneySGL", typeof(float));
                DataColumn colRatePerDayMoneyDBL     = new DataColumn("colRatePerDayMoneyDBL", typeof(float));
                DataColumn colCurrencyIDInt          = new DataColumn("colCurrencyIDInt", typeof(int));
                DataColumn colRoomRateTaxPercentage  = new DataColumn("colRoomRateTaxPercentage", typeof(float));
                DataColumn colRoomRateIsTaxInclusive = new DataColumn("colRoomRateIsTaxInclusive", typeof(float));

                dt = new DataTable();
                dt.Columns.Add(colBranchIDInt);
                dt.Columns.Add(colDate);
                dt.Columns.Add(colToAddDBL);
                dt.Columns.Add(colToAddSGL);
                dt.Columns.Add(colAction);

                dt.Columns.Add(colRoomToDropDBL);
                dt.Columns.Add(colRoomToDropSGL);

                dt.Columns.Add(colRatePerDayMoneySGL);
                dt.Columns.Add(colRatePerDayMoneyDBL);
                dt.Columns.Add(colCurrencyIDInt);
                dt.Columns.Add(colRoomRateTaxPercentage);
                dt.Columns.Add(colRoomRateIsTaxInclusive);

                DataRow  r;
                DateTime rowDate;

                //CheckBox lvuoCheckBoxSelect;

                for (int i = 0; i < iCount; i++)
                {
                    listDropDownListAction = (DropDownList)uolistviewHotelInfo.Items[i].FindControl("uoDropDownListAction");
                    //lvuoCheckBoxSelect = (CheckBox)uolistviewHotelInfo.Items[i].FindControl("uoCheckBoxSelect");
                    //if (lvuoCheckBoxSelect.Checked)
                    if (listDropDownListAction.SelectedValue == "Accept" ||
                        listDropDownListAction.SelectedValue == "Decline" ||
                        listDropDownListAction.SelectedValue == "Edit" ||
                        listDropDownListAction.SelectedValue == "Drop")
                    {
                        listLabelDate = (Label)uolistviewHotelInfo.Items[i].FindControl("uoLabelDate");
                        rowDate       = GlobalCode.Field2DateTime(listLabelDate.Text);

                        if (rowDate >= dateOnly)
                        {
                            listHiddenFieldToAddDBL = (HiddenField)uolistviewHotelInfo.Items[i].FindControl("uoHiddenFieldToAddDBL");
                            listHiddenFieldToAddSGL = (HiddenField)uolistviewHotelInfo.Items[i].FindControl("uoHiddenFieldToAddSGL");

                            listTextBoxDBL = (TextBox)uolistviewHotelInfo.Items[i].FindControl("uoTextBoxDBL");
                            listTextBoxSGL = (TextBox)uolistviewHotelInfo.Items[i].FindControl("uoTextBoxSGL");

                            listTextBoxRoomToDropDBL = (TextBox)uolistviewHotelInfo.Items[i].FindControl("uoTextBoxRoomToDropDBL");
                            listTextBoxRoomToDropSGL = (TextBox)uolistviewHotelInfo.Items[i].FindControl("uoTextBoxRoomToDropSGL");

                            listTextBoxRatePerDayMoneyDBL = (TextBox)uolistviewHotelInfo.Items[i].FindControl("uoTextBoxRatePerDayMoneyDBL");
                            listTextBoxRatePerDayMoneySGL = (TextBox )uolistviewHotelInfo.Items[i].FindControl("uoTextBoxRatePerDayMoneySGL");

                            listTextBoxRoomRateTaxPercentage = (TextBox)uolistviewHotelInfo.Items[i].FindControl("uoTextBoxRoomRateTaxPercentage");;
                            listCheckBoxTaxInclusive         = (CheckBox)uolistviewHotelInfo.Items[i].FindControl("uoCheckBoxTaxInclusive");

                            int iToAddDBLOld = GlobalCode.Field2Int(listHiddenFieldToAddDBL.Value);
                            int iToAddSGLOld = GlobalCode.Field2Int(listHiddenFieldToAddSGL.Value);

                            int iToAddDBLNew = GlobalCode.Field2Int(listTextBoxDBL.Text);
                            int iToAddSGLNew = GlobalCode.Field2Int(listTextBoxSGL.Text);

                            int iToDropDBL = GlobalCode.Field2Int(listTextBoxRoomToDropDBL.Text);
                            int iToDropSGL = GlobalCode.Field2Int(listTextBoxRoomToDropSGL.Text);

                            float fRatePerDayMoneyDBL   = GlobalCode.Field2Float(listTextBoxRatePerDayMoneyDBL.Text);
                            float fRatePerDayMoneySGL   = GlobalCode.Field2Float(listTextBoxRatePerDayMoneySGL.Text);
                            int   iCurrency             = GlobalCode.Field2Int(uoHiddenFieldCurrency.Value);
                            float fTaxPercent           = GlobalCode.Field2Float(listTextBoxRoomRateTaxPercentage.Text);
                            bool  bIsTaxInclusiveSingle = listCheckBoxTaxInclusive.Checked;

                            //if (iToAddDBLOld != iToAddDBLNew ||
                            //    iToAddSGLOld != iToAddSGLNew)
                            //{
                            r = dt.NewRow();
                            r["colBranchIDInt"] = iHotelID;
                            r["colDate"]        = rowDate;
                            r["colToAddDBL"]    = iToAddDBLNew;
                            r["colToAddSGL"]    = iToAddSGLNew;
                            r["colAction"]      = listDropDownListAction.SelectedValue;

                            r["colRoomToDropDBL"] = iToDropDBL;
                            r["colRoomToDropSGL"] = iToDropSGL;

                            r["colRatePerDayMoneySGL"]     = fRatePerDayMoneySGL;
                            r["colRatePerDayMoneyDBL"]     = fRatePerDayMoneyDBL;
                            r["colCurrencyIDInt"]          = iCurrency;
                            r["colRoomRateTaxPercentage"]  = fTaxPercent;
                            r["colRoomRateIsTaxInclusive"] = bIsTaxInclusiveSingle;

                            dt.Rows.Add(r);
                            //}
                        }
                    }
                }

                if (dt.Rows.Count > 0)
                {
                    BLL.ApproveForecastManifest(GlobalCode.Field2Int(uoHiddenFieldHotelID.Value),

                                                //GlobalCode.Field2Float(uoTextBoxRateSingle.Text),
                                                //GlobalCode.Field2Int(uoDropDownListCurrencySingle.SelectedValue),
                                                //GlobalCode.Field2Float(uoTextBoxTaxSingle.Text),
                                                //uoCheckBoxTaxInclusiveSingle.Checked,

                                                //GlobalCode.Field2Float(uoTextBoxRateDouble.Text),
                                                //GlobalCode.Field2Int(uoDropDownListCurrencyDouble.SelectedValue),
                                                //GlobalCode.Field2Float(uoTextBoxTaxDouble.Text),
                                                //uoCheckBoxTaxInclusiveDouble.Checked,

                                                uoHiddenFieldUser.Value, "Add Override Forecast by Vendor", "SaveHotelForecast",
                                                Path.GetFileName(Request.Path),
                                                CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, dt);

                    GetSFHotelTravelDetails();
                    AlertMessage("Record successfully saved!");
                }
                else
                {
                    AlertMessage("No record changed!");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.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;
                }
            }
        }
Exemple #7
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   10/Mar/2014
        /// Description:    Confirm Service Provider Hotel Manifest
        /// </summary>
        private void ConfirmHotel()
        {
            DataTable dt = null;

            try
            {
                int   iCurrency = GlobalCode.Field2Int(uoDropDownListCurrency.SelectedValue);
                float fRate     = GlobalCode.Field2Float(uoTextBoxRateConfirmed.Text);

                DateTime dateNow = CommonFunctions.GetCurrentDateTime();

                string sAction = GlobalCode.Field2String(Request.QueryString["Action"]);
                if (User.IsInRole(TravelMartVariable.RolePortSpecialist) &&
                    (sAction == ""))
                {
                    dt = getManifestAmount();
                    BLL.PortAgentManifestConfirmHotel(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                      uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(),
                                                      iCurrency, fRate, uoTextBoxConfirmation.Text.Trim(),
                                                      uoTextBoxHotelname.Text.Trim(), uoTextBoxComment.Text,
                                                      uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, "Confirmed Hotel by Service Provider Vendor",
                                                      "ConfirmHotel", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                      CommonFunctions.GetDateTimeGMT(dateNow), dateNow, dt);
                }
                else if (sAction == "EditAmount")
                {
                    dt = getManifestAmount();
                    BLL.PortAgentManifestConfirmHotelAmount(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                            uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(),
                                                            iCurrency, fRate, uoTextBoxConfirmation.Text.Trim(),
                                                            uoTextBoxHotelname.Text.Trim(), uoTextBoxComment.Text,
                                                            uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, "Changed Amount of Hotel by RCCL",
                                                            "ConfirmHotel", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                            CommonFunctions.GetDateTimeGMT(dateNow), dateNow, dt);
                }
                else if (sAction == "Approve")
                {
                    BLL.PortAgentManifestConfirmHotelApprove(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                             uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(),
                                                             uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, "Approve Service Provider Hotel Manifest by RCCL",
                                                             "ConfirmHotel", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                             CommonFunctions.GetDateTimeGMT(dateNow), dateNow);
                }
                else if (sAction == "CancelByRCCL" || sAction == "Cancel")
                {
                    string sDescription = sAction + ": Cancel Service Provider Hotel Manifest";

                    BLL.PortAgentManifestConfirmHotelCancel(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                            uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(),
                                                            uoTextBoxComment.Text, uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, sDescription,
                                                            "ConfirmHotel", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                            CommonFunctions.GetDateTimeGMT(dateNow), dateNow);
                }
                else if (sAction == "Add")
                {
                    dt = getManifestAmount();

                    BLL.PortAgentManifestConfirmHotelAdd(uoHiddenFieldUser.Value, uoHiddenFieldRole.Value,
                                                         uoTextBoxEmailAdd.Text.Trim(), uoTextBoxCopy.Text.Trim(),
                                                         iCurrency, fRate, uoTextBoxConfirmation.Text.Trim(),
                                                         uoTextBoxHotelname.Text.Trim(), uoTextBoxComment.Text,
                                                         uoTextBoxConfirmedBy.Text, uoDropDownListRequestSource.SelectedValue, "Create Hotel Request by RCCL",
                                                         "ConfirmHotel", Path.GetFileName(Request.UrlReferrer.AbsolutePath),
                                                         CommonFunctions.GetDateTimeGMT(dateNow), dateNow, dt);
                }
            }
            catch (Exception ex)
            {
                AlertErrorMessage("Confirm Hotel: " + ex.Message);
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Exemple #8
0
        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();
                }
            }
        }
Exemple #9
0
        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);
        }