Beispiel #1
0
        private void InsertDriverTransaction()
        {
            try
            {
                VehicleManifestBLL BLL = new VehicleManifestBLL();
                DriverTransaction  d   = new DriverTransaction();

                DataTable dtparam = DriverTransaction();
                DataTable gtparam = GreeterTransaction();

                DataRow dr;

                HiddenField ConfirmedManifestID;
                HiddenField DriverRequestID;
                HiddenField uodfDriverPickupLatitude;
                HiddenField uodfDriverPickupLongitude;
                HiddenField uodfDriverDropOffLatitude;
                HiddenField uodfDriverDropOffLongitude;
                HiddenField uodfDriverParkingLatitude;
                HiddenField uodfDriverParkingLongitude;


                Label   Pickupdate;
                TextBox PickupTime;
                TextBox PickupLocation;
                TextBox DropOffLocation;


                foreach (ListViewDataItem list in uoListViewManifestConfirm.Items)
                {
                    ConfirmedManifestID = (HiddenField)list.FindControl("uoHiddenFieldConfirmedManifestID");
                    DriverRequestID     = (HiddenField)list.FindControl("uoHiddenFieldDriverRequestID");

                    uodfDriverPickupLatitude   = (HiddenField)list.FindControl("uodfDriverPickupLatitude");
                    uodfDriverPickupLongitude  = (HiddenField)list.FindControl("uodfDriverPickupLongitude");
                    uodfDriverDropOffLatitude  = (HiddenField)list.FindControl("uodfDriverDropOffLatitude");
                    uodfDriverDropOffLongitude = (HiddenField)list.FindControl("uodfDriverDropOffLongitude");
                    uodfDriverParkingLatitude  = (HiddenField)list.FindControl("uodfDriverParkingLatitude");
                    uodfDriverParkingLongitude = (HiddenField)list.FindControl("uodfDriverParkingLongitude");


                    Pickupdate      = (Label)list.FindControl("lblPickupDate");
                    PickupTime      = (TextBox)list.FindControl("txtPickupTime");
                    PickupLocation  = (TextBox)list.FindControl("txtPickupLocation");
                    DropOffLocation = (TextBox)list.FindControl("txtDropOffLocation");

                    if (GlobalCode.Field2Int(uoDropDownListDriver.SelectedIndex) > 0)
                    {
                        dr = dtparam.NewRow();
                        dr["DriverRequestID"] = GlobalCode.Field2Long(DriverRequestID.Value);
                        dr["UserID"]          = uoDropDownListDriver.SelectedItem.Value;
                        dr["PickupDate"]      = GlobalCode.Field2DateTime(Pickupdate.Text);
                        dr["PickupTime"]      = GlobalCode.Field2DateTime(PickupTime.Text);

                        dr["ParkingLocation"]  = GlobalCode.Field2String(uoTextBoxPakingLocation.Text);
                        dr["ParkingLatitude"]  = GlobalCode.Field2Double(uodfDriverParkingLatitude.Value);
                        dr["ParkingLongitude"] = GlobalCode.Field2Double(uodfDriverParkingLongitude.Value);

                        dr["PickupLocation"]  = GlobalCode.Field2String(PickupLocation.Text);
                        dr["PickupLatitude"]  = GlobalCode.Field2Double(uodfDriverPickupLatitude.Value);
                        dr["PickupLongitude"] = GlobalCode.Field2Double(uodfDriverPickupLongitude.Value);

                        dr["DropOffLocation"]  = GlobalCode.Field2String(DropOffLocation.Text);
                        dr["DropOffLatitude"]  = GlobalCode.Field2Double(uodfDriverDropOffLatitude.Value);
                        dr["DropOffLongitude"] = GlobalCode.Field2Double(uodfDriverParkingLongitude);

                        dr["VehicleDetailID"]     = GlobalCode.Field2Int(uoHiddenFieldVehicleHotelSPID.Value);
                        dr["ConfirmedManifestID"] = GlobalCode.Field2Long(ConfirmedManifestID.Value);

                        dtparam.Rows.Add(dr);
                    }


                    if (GlobalCode.Field2Int(uoDropDownListGreeter.SelectedIndex) > 0)
                    {
                        dr = gtparam.NewRow();
                        dr["GreeterRequestID"]    = GlobalCode.Field2Long(DriverRequestID.Value);
                        dr["UserID"]              = uoDropDownListGreeter.SelectedItem.Value;
                        dr["PickupDate"]          = GlobalCode.Field2DateTime(Pickupdate.Text);
                        dr["PickupTime"]          = GlobalCode.Field2DateTime(PickupTime.Text);
                        dr["PickupLocation"]      = GlobalCode.Field2String(PickupLocation.Text);
                        dr["PickupLatitude"]      = GlobalCode.Field2Double(uodfGreeterPickupLatitude.Value);
                        dr["PickupLongitude"]     = GlobalCode.Field2Double(uodfGreeterPickupLongitude.Value);
                        dr["DropOffLocation"]     = GlobalCode.Field2String(DropOffLocation.Text);
                        dr["DropOffLatitude"]     = GlobalCode.Field2Double(uodfGreeterDropOffLatitude.Value);
                        dr["DropOffLongitude"]    = GlobalCode.Field2Double(uodfGreterDropOffLongitude.Value);
                        dr["ConfirmedManifestID"] = GlobalCode.Field2Long(ConfirmedManifestID.Value);
                        gtparam.Rows.Add(dr);
                    }
                }

                BLL.SaveDriverTransaction(GlobalCode.Field2Int(uoHiddenFieldVendorID.Value), uoHiddenFieldsUserID.Value, uoHiddenFieldcmfid.Value, dtparam, gtparam);


                OpenParentPage("Created successfully.");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        /// ----------------------------------------------
        /// 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>
        /// Date Created:  22/Oct/2013
        /// Created By:    Josephine Gad
        /// (description)  GetServiceRequestEmail
        /// ---------------------------------------
        /// Date Modified: 25/Oct/2013
        /// Modified By:   Josephine Gad
        /// (description)  Add Service Provider Email
        /// </summary>
        public void GetServiceRequestEmail(Int32 iHotelRequestID, Int32 iVehicleRequestID,
                                           int iPortAgentRequestID, Int32 iMeetGreetRequestID, Int16 iLoadType)
        {
            List <ServiceRequestEmailList> list           = new List <ServiceRequestEmailList>();
            List <CrewAssistEmailDetail>   hotelEmail     = new List <CrewAssistEmailDetail>();
            List <CrewAssistTranspo>       vehicleEmail   = new List <CrewAssistTranspo>();
            List <CrewAssistMeetAndGreet>  meetGreetEmail = new List <CrewAssistMeetAndGreet>();
            List <CopyEmail> copyMail = new List <CopyEmail>();

            Database  db          = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase()
            DbCommand dbComm      = null;
            DataSet   ds          = null;
            DataTable dt          = null;
            DataTable dtCopy      = null;
            DataTable dtHotel     = null;
            DataTable dtVehicle   = null;
            DataTable dtMeetGreet = null;
            DataTable dtAirDetail = null;

            if (iLoadType == 0)
            {
                HttpContext.Current.Session["ServiceRequestEmail_EmailList"]    = list;
                HttpContext.Current.Session["ServiceRequestEmail_CopyMailList"] = copyMail;
            }
            HttpContext.Current.Session["ServiceRequestEmail_HotelEmailDetails"]     = hotelEmail;
            HttpContext.Current.Session["ServiceRequestEmail_VehicleEmailDetails"]   = vehicleEmail;
            HttpContext.Current.Session["ServiceRequestEmail_MeetGreetEmailDetails"] = meetGreetEmail;

            try
            {
                dbComm = db.GetStoredProcCommand("uspGetServiceRequestEmail");
                db.AddInParameter(dbComm, "@pHotelRequestID", DbType.Int32, iHotelRequestID);
                db.AddInParameter(dbComm, "@pVehicleRequestID", DbType.Int32, iVehicleRequestID);
                db.AddInParameter(dbComm, "@pMeetGreetRequestID", DbType.Int32, iMeetGreetRequestID);
                db.AddInParameter(dbComm, "@pPortAgentRequestID", DbType.Int32, iPortAgentRequestID);
                db.AddInParameter(dbComm, "@pLoadType", DbType.Int16, iLoadType);
                ds = db.ExecuteDataSet(dbComm);

                if (iLoadType == 0)
                {
                    dt   = ds.Tables[0];
                    list = (from a in dt.AsEnumerable()
                            select new ServiceRequestEmailList
                    {
                        HotelID = GlobalCode.Field2Int(a["HotelID"]),
                        HotelEmailTo = a.Field <string>("HotelEmailTo"),
                        HotelName = a.Field <string>("HotelName"),

                        VehicleID = GlobalCode.Field2Int(a["VehicleID"]),
                        VehicleEmailTo = a.Field <string>("VehicleEmailTo"),
                        VehicleName = a.Field <string>("VehicleName"),

                        MeetGreetID = GlobalCode.Field2Int(a["MeetGreetID"]),
                        MeetGreetEmailTo = a.Field <string>("MeetGreetEmailTo"),
                        MeetGreetName = a.Field <string>("MeetGreetName"),

                        PortAgentID = GlobalCode.Field2Int(a["MeetGreetID"]),
                        PortAgentName = a.Field <string>("PortAgentName"),
                        PortAgentEmailTo = a.Field <string>("PortAgentEmailTo"),


                        VesselID = GlobalCode.Field2Int(a["VesselID"]),
                        VesselEmailTo = a.Field <string>("VesselEmail")
                    }).ToList();

                    dtCopy      = ds.Tables[1];
                    dtHotel     = ds.Tables[2];
                    dtVehicle   = ds.Tables[3];
                    dtMeetGreet = ds.Tables[4];
                    dtAirDetail = ds.Tables[5];

                    copyMail = (from a in dtCopy.AsEnumerable()
                                select new CopyEmail
                    {
                        EmailName = GlobalCode.Field2String(a["EmailType"]),
                        EmailType = GlobalCode.Field2Int(a["EmailID"]),
                        Email = GlobalCode.Field2String(a["Email"]),
                    }).ToList();

                    HttpContext.Current.Session["ServiceRequestEmail_EmailList"]    = list;
                    HttpContext.Current.Session["ServiceRequestEmail_CopyMailList"] = copyMail;
                }
                else if (iLoadType == 1)
                {
                    dtHotel     = ds.Tables[0];
                    dtVehicle   = ds.Tables[1];
                    dtMeetGreet = ds.Tables[2];
                    dtAirDetail = ds.Tables[3];
                }
                //----------------------------------Get the request details to be emailed----------------------------------
                if (dtHotel != null)
                {
                    hotelEmail = (from a in dtHotel.AsEnumerable()
                                  select new CrewAssistEmailDetail
                    {
                        SeafarerID = GlobalCode.Field2String(a["colSeafarerIDInt"]),
                        LastName = GlobalCode.Field2String(a["LastName"]),
                        FirstName = GlobalCode.Field2String(a["FirstName"]),
                        GenderDiscription = GlobalCode.Field2String(a["Gender"]),
                        BrandCode = GlobalCode.Field2String(a["Branch"]),
                        RankName = GlobalCode.Field2String(a["Rank"]),
                        SFStatus = GlobalCode.Field2String(a["Status"]),
                        Nationality = GlobalCode.Field2String(a["Nationality"]),
                        VesselName = GlobalCode.Field2String(a["Vessel"]),
                        VesselId = GlobalCode.Field2Int(a["colVesselIdInt"]),
                        CostCenterCode = GlobalCode.Field2String(a["CostCenter"]),
                        RoomDesc = GlobalCode.Field2String(a["RoomType"]),
                        SharingWith = GlobalCode.Field2String(a["SharingWith"]),
                        TimeSpanStartDate = GlobalCode.Field2Date(a["TimeSpanStartDate"]),
                        TimeSpanEndDate = GlobalCode.Field2Date(a["TimeSpanStartDate"]),
                        TimeSpanStartTime = GlobalCode.Field2String(a["TimeSpanStartTime"]),
                        TimeSpanEndTime = GlobalCode.Field2String(a["TimeSpanEndTime"]),
                        Mealvoucheramount = GlobalCode.Field2Double(a["Mealvoucheramount"]).ToString("n2"),
                        //Confirmedbyhotelvendor = GlobalCode.Field2Double(a["Confirmedbyhotelvendor"]).ToString(),
                        ConfirmedbyRCCL = GlobalCode.Field2String(a["ConfirmedbyRCCL"]),
                        VendorBranch = GlobalCode.Field2String(a["colVendorBranchNameVarchar"]),
                        Roomrate = GlobalCode.Field2Double(a["Roomrate"]).ToString("n2"),              // GlobalCode.Field2String(a["Roomrate"])
                        Comment = GlobalCode.Field2String(a["colCommentsVarchar"]),
                        Confirmedbyhotelvendor = GlobalCode.Field2String(a["colConfirmName"]),
                        CrewAssistEmailAirDetail = (from n in dtAirDetail.AsEnumerable()
                                                    select new CrewAssistEmailAirDetail
                        {
                            AirDetail = GlobalCode.Field2String(n["AirDetail"])
                        }).ToList()
                    }).ToList();

                    HttpContext.Current.Session["ServiceRequestEmail_HotelEmailDetails"] = hotelEmail;
                }
                if (dtVehicle != null)
                {
                    vehicleEmail = (from a in dtVehicle.AsEnumerable()
                                    select new CrewAssistTranspo
                    {
                        VehicleTransID = GlobalCode.Field2Int(a["colTransVehicleIDBigint"]),
                        IdBigint = GlobalCode.Field2Long(a["colIdBigint"]),
                        TravelReqIDInt = GlobalCode.Field2Long(a["colTravelReqIDInt"]),
                        SeqNoInt = GlobalCode.Field2TinyInt(a["colSeqNoInt"]),
                        RecordLocatorVarchar = GlobalCode.Field2String(a["colRecordLocatorVarchar"]),
                        VehicleVendorIDInt = GlobalCode.Field2Long(a["colVehicleVendorIDInt"]),
                        VehicleVendor = GlobalCode.Field2String(a["colVehicleVendorNameVarchar"]),

                        VehiclePlateNoVarchar = GlobalCode.Field2String(a["colVehiclePlateNoVarchar"]),
                        PickUpDate = GlobalCode.Field2DateTime(a["colPickUpDate"]),
                        PickUpTime = GlobalCode.Field2DateTime(a["colPickUpTime"]),
                        DropOffDate = GlobalCode.Field2DateTime(a["colDropOffDate"]),
                        DropOffTime = GlobalCode.Field2DateTime(a["colDropOffTime"]),
                        ConfirmationNoVarchar = GlobalCode.Field2String(a["colConfirmationNoVarchar"]),
                        VehicleStatusVarchar = GlobalCode.Field2String(a["colVehicleStatusVarchar"]),
                        VehicleTypeIdInt = GlobalCode.Field2Int(a["colVehicleTypeIdInt"]),
                        SFStatus = GlobalCode.Field2String(a["colSFStatus"]),
                        RouteIDFromInt = GlobalCode.Field2Int(a["colRouteIDFromInt"]),
                        RouteIDToInt = GlobalCode.Field2Int(a["colRouteIDToInt"]),
                        FromVarchar = GlobalCode.Field2String(a["colFromVarchar"]),
                        ToVarchar = GlobalCode.Field2String(a["colToVarchar"]),
                        Comment = GlobalCode.Field2String(a["colRemarksForAuditVarchar"]),

                        //TransSender = UserID,

                        SeaparerID = GlobalCode.Field2Long(a["colSeafarerIdInt"]),
                        FirstName = GlobalCode.Field2String(a["colFirstNameVarchar"]),
                        LastName = GlobalCode.Field2String(a["colLastNameVarchar"]),
                        RankName = GlobalCode.Field2String(a["RankName"]),
                        Gender = GlobalCode.Field2String(a["colGenderDiscription"]),
                        NationalityName = GlobalCode.Field2String(a["Nationality"]),
                    }).ToList();
                    HttpContext.Current.Session["ServiceRequestEmail_VehicleEmailDetails"] = vehicleEmail;
                }
                if (dtMeetGreet != null)
                {
                    meetGreetEmail = (from Q in dtMeetGreet.AsEnumerable()
                                      select new CrewAssistMeetAndGreet
                    {
                        ReqMeetAndGreetID = GlobalCode.Field2Long(Q["colReqMeetAndGreetIDBigint"]),
                        IdBigint = GlobalCode.Field2Long(Q["colIdBigint"]),
                        TravelReqID = GlobalCode.Field2Long(Q["colTravelReqIDInt"]),
                        SeqNo = GlobalCode.Field2Int(Q["colSeqNoInt"]),
                        RecordLocator = GlobalCode.Field2String(Q["colRecordLocatorVarchar"]),
                        MeetAndGreetVendorID = GlobalCode.Field2Int(Q["colMeetAndGreetVendorIDInt"]),
                        MeetAndGreetVendor = GlobalCode.Field2String(Q["colMeetAndGreetVendorNameVarchar"]),
                        ConfirmationNo = GlobalCode.Field2String(Q["colConfirmationNoVarchar"]),
                        AirportID = GlobalCode.Field2Int(Q["colAirportInt"]),
                        FligthNo = GlobalCode.Field2String(Q["colFligthNoVarchar"]),
                        ServiceDate = GlobalCode.Field2DateTime(Q["colServiceDatetime"]),
                        Rate = GlobalCode.Field2Double(Q["colRateFloat"]),
                        SFStatus = GlobalCode.Field2String(Q["colSFStatus"]),
                        Comment = GlobalCode.Field2String(Q["colCommentVarchar"]),
                        IsAir = GlobalCode.Field2Bool(Q["colIsAirBit"]),
                        Email = GlobalCode.Field2String(Q["colEmailToVarchar"])
                    }).ToList();
                    HttpContext.Current.Session["ServiceRequestEmail_MeetGreetEmailDetails"] = meetGreetEmail;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dbComm != null)
                {
                    dbComm.Dispose();
                }
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (dtCopy != null)
                {
                    dtCopy.Dispose();
                }
                if (dtHotel != null)
                {
                    dtHotel.Dispose();
                }
                if (dtVehicle != null)
                {
                    dtVehicle.Dispose();
                }
                if (dtMeetGreet != null)
                {
                    dtMeetGreet.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
                if (dtAirDetail != null)
                {
                    dtAirDetail.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);
        }
Beispiel #5
0
        /// Date Modified: 26/03/2013
        /// Modified By:   Marco Abejar
        /// (description)  Save SF  Hotel Request
        /// -------------------------------------------
        /// Date Modified: 30/May/2013
        /// Modified By:   Josephine Gad
        /// (description)  Add Shuttle, MealLunchDinner, Tax Bit and Tax Percent
        ///                Add fields for audit trail use
        /// -------------------------------------------
        /// </summary>
        public static string SeafarerSaveRequest(string RequestNo, string SfID, string LastName, string FirstName, string Gender, string RegionID,
                                                 string PortID, string AirportID, string HotelID, string CheckinDate, string CheckoutDate, string NoNites, string RoomType,
                                                 bool MealBreakfast, bool MealLunch, bool MealDinner, bool MealLunchDinner, bool WithShuttle,
                                                 string RankID, string VesselInt, string CostCenter, string Comments, string SfStatus, string TimeIn, string TimeOut,
                                                 string RoomAmount, bool IsRoomTax, string RoomTaxPercent, string UserID, string TrID, string Currency,
                                                 string strLogDescription, string strFunction, string strPageName, DateTime DateGMT, DateTime CreatedDate)
        {
            Database  SFDatebase  = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase()
            DbCommand SFDbCommand = null;

            DbConnection connection = SFDatebase.CreateConnection();

            connection.Open();
            DbTransaction trans = connection.BeginTransaction();

            try
            {
                string strTimeZone = TimeZone.CurrentTimeZone.StandardName.ToString();

                SFDbCommand = SFDatebase.GetStoredProcCommand("uspInsertSFHotelRequest");
                SFDatebase.AddInParameter(SFDbCommand, "@pRequestNo", DbType.String, RequestNo);
                SFDatebase.AddInParameter(SFDbCommand, "@pSeafarerIDInt", DbType.Int32, Int32.Parse(SfID));
                SFDatebase.AddInParameter(SFDbCommand, "@pLastNameVarchar", DbType.String, LastName);
                SFDatebase.AddInParameter(SFDbCommand, "@pFirstNameVarchar", DbType.String, FirstName);
                SFDatebase.AddInParameter(SFDbCommand, "@pGender", DbType.Int32, Int32.Parse(Gender));
                SFDatebase.AddInParameter(SFDbCommand, "@pRegionIDInt", DbType.Int32, Int32.Parse(RegionID));
                SFDatebase.AddInParameter(SFDbCommand, "@pPortIDInt", DbType.Int32, Int32.Parse(PortID));
                SFDatebase.AddInParameter(SFDbCommand, "@pAirportIDInt", DbType.Int32, Int32.Parse(AirportID));
                SFDatebase.AddInParameter(SFDbCommand, "@pHotelIDInt", DbType.Int32, Int32.Parse(HotelID));
                SFDatebase.AddInParameter(SFDbCommand, "@pCheckinDate", DbType.DateTime, CheckinDate);
                SFDatebase.AddInParameter(SFDbCommand, "@pCheckoutDate", DbType.DateTime, CheckoutDate);
                SFDatebase.AddInParameter(SFDbCommand, "@pNoNitesInt", DbType.Int32, Int32.Parse(NoNites));
                SFDatebase.AddInParameter(SFDbCommand, "@pRoomTypeId", DbType.String, RoomType);
                SFDatebase.AddInParameter(SFDbCommand, "@pMealBreakfastBit", DbType.Boolean, MealBreakfast);
                SFDatebase.AddInParameter(SFDbCommand, "@pMealLunchBit", DbType.Boolean, MealLunch);
                SFDatebase.AddInParameter(SFDbCommand, "@pMealDinnerBit", DbType.Boolean, MealDinner);
                SFDatebase.AddInParameter(SFDbCommand, "@pMealLunchDinnerBit", DbType.Boolean, MealLunchDinner);
                SFDatebase.AddInParameter(SFDbCommand, "@pWithShuttleBit", DbType.Boolean, WithShuttle);

                SFDatebase.AddInParameter(SFDbCommand, "@pRankIDInt", DbType.Int32, Int32.Parse(RankID));
                SFDatebase.AddInParameter(SFDbCommand, "@pVesselInt", DbType.Int32, Int32.Parse(VesselInt));
                SFDatebase.AddInParameter(SFDbCommand, "@pCostCenterInt", DbType.Int32, Int32.Parse(CostCenter));
                SFDatebase.AddInParameter(SFDbCommand, "@pCommentsVarchar", DbType.String, Comments);
                SFDatebase.AddInParameter(SFDbCommand, "@pSfStatus", DbType.String, SfStatus);
                SFDatebase.AddInParameter(SFDbCommand, "@pTimeIn", DbType.String, TimeIn);
                SFDatebase.AddInParameter(SFDbCommand, "@pTimeOut", DbType.String, TimeOut);
                SFDatebase.AddInParameter(SFDbCommand, "@pRoomAmount", DbType.String, RoomAmount);
                SFDatebase.AddInParameter(SFDbCommand, "@pRoomRateTaxInclusive", DbType.Boolean, IsRoomTax);
                SFDatebase.AddInParameter(SFDbCommand, "@pRoomRateTaxPercentage", DbType.Double, GlobalCode.Field2Double(RoomTaxPercent));

                SFDatebase.AddInParameter(SFDbCommand, "@pUserID", DbType.String, UserID);
                SFDatebase.AddInParameter(SFDbCommand, "@pTrID", DbType.String, TrID);
                SFDatebase.AddInParameter(SFDbCommand, "@pCurrency", DbType.String, Currency);

                SFDatebase.AddInParameter(SFDbCommand, "@pDescription", DbType.String, strLogDescription);
                SFDatebase.AddInParameter(SFDbCommand, "@pFunction", DbType.String, strFunction);
                SFDatebase.AddInParameter(SFDbCommand, "@pFileName", DbType.String, strPageName);
                SFDatebase.AddInParameter(SFDbCommand, "@pTimezone", DbType.String, strTimeZone);
                SFDatebase.AddInParameter(SFDbCommand, "@pGMTDATE", DbType.DateTime, DateGMT);
                SFDatebase.AddInParameter(SFDbCommand, "@pCreateDate", DbType.DateTime, CreatedDate);

                string sHRID = SFDatebase.ExecuteScalar(SFDbCommand).ToString();
                trans.Commit();

                return(sHRID);
            }
            catch (Exception ex)
            {
                trans.Rollback();
                throw ex;
            }
            finally
            {
                if (connection != null)
                {
                    connection.Close();
                    connection.Dispose();
                }
                if (SFDbCommand != null)
                {
                    SFDbCommand.Dispose();
                }
                if (trans != null)
                {
                    trans.Dispose();
                }
            }
        }
        void insertTransportationRequest(string spName, string Status)
        {
            short       statusID = GlobalCode.Field2TinyInt(Request.QueryString["st"]);
            Label       uoLblSfID;
            Label       uoLabelLast;
            LinkButton  SeafarerLinkButton;
            Label       uoLblCheckOut;
            Label       uoLblNites;
            Label       uoLblRoom;
            Label       uoLblVessel;
            Label       uoLblRank;
            Label       uoLblCostCenter;
            Label       uoLblRecLoc;
            HiddenField RecLocID;
            HiddenField TravelReqID;
            HiddenField SeqNo;
            Label       lblSFStatus;
            Label       lblRoutFrom;
            Label       lblRoutTo;

            HiddenField uoHiddenFieldRouteFrom;
            HiddenField uoHiddenFieldRouteTo;
            HiddenField TransVehicleID;

            TextBox TextBoxRateConfirmedPerSeafarer;

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

            foreach (ListViewDataItem item in uoListviewVehicleInfo.Items)
            {
                uoLblSfID          = (Label)item.FindControl("uoLblSfID");
                uoLabelLast        = (Label)item.FindControl("uoLabelLast");
                SeafarerLinkButton = (LinkButton)item.FindControl("SeafarerLinkButton");
                uoLblCheckOut      = (Label)item.FindControl("uoLblCheckOut");
                uoLblNites         = (Label)item.FindControl("uoLblNites");
                uoLblRoom          = (Label)item.FindControl("uoLblRoom");
                lblSFStatus        = (Label)item.FindControl("lblStatus");
                uoLblVessel        = (Label)item.FindControl("uoLblVessel");
                uoLblRank          = (Label)item.FindControl("uoLblRank");
                uoLblCostCenter    = (Label)item.FindControl("Label1");
                uoLblRecLoc        = (Label)item.FindControl("uoLblRecLoc");
                RecLocID           = (HiddenField)item.FindControl("uoHiddenFieldListRecLocID");
                TravelReqID        = (HiddenField)item.FindControl("uoHiddenFieldListTRID");
                SeqNo                           = (HiddenField)item.FindControl("uoHiddenFieldSeqNo");
                lblRoutFrom                     = (Label)item.FindControl("lblRouteFrom");
                lblRoutTo                       = (Label)item.FindControl("lblRouteTo");
                uoHiddenFieldRouteFrom          = (HiddenField)item.FindControl("uoHiddenFieldRouteFrom");
                uoHiddenFieldRouteTo            = (HiddenField)item.FindControl("uoHiddenFieldRouteTo");
                lblRoutFrom.Text                = lblRoutFrom.Text == "" ? uoHiddenFieldRouteFrom.Value : lblRoutFrom.Text;
                lblRoutTo.Text                  = lblRoutFrom.Text == "" ? uoHiddenFieldRouteTo.Value : lblRoutTo.Text;
                TransVehicleID                  = (HiddenField)item.FindControl("uoHiddenFieldTransID");
                TextBoxRateConfirmedPerSeafarer = (TextBox)item.FindControl("uoTextBoxRateConfirmedPerSeafarer");
                PAH.Add(new NonTurnTransportationRequest
                {
                    TransVehicleID = GlobalCode.Field2Long(TransVehicleID.Value),
                    TravelReqID    = GlobalCode.Field2Long(TravelReqID.Value),
                    SeafarerID     = GlobalCode.Field2Long(uoLblSfID.Text),
                    IdBigint       = GlobalCode.Field2Long(RecLocID.Value),
                    RecordLocator  = GlobalCode.Field2String(uoLblRecLoc.Text),

                    SeqNoInt        = GlobalCode.Field2Int(SeqNo.Value),
                    VehicleVendorID = GlobalCode.Field2Int(uoVendorDropDownList.SelectedItem.Value),
                    VehiclePlateNo  = "",
                    PickUpDate      = GlobalCode.Field2DateTime(uoTextBoxPickupDate.Text),
                    PickUpTime      = GlobalCode.Field2DateTime(uoTextBoxPickupTime.Text),
                    DropOffDate     = GlobalCode.Field2DateTime(uoTextBoxPickupDate.Text),
                    DropOffTime     = GlobalCode.Field2DateTime(uoTextBoxPickupTime.Text),
                    ConfirmationNo  = GlobalCode.Field2String(uoTextBoxConfirmation.Text),
                    VehicleStatus   = "Open",
                    VehicleTypeId   = GlobalCode.Field2Int(uoDropDownListVehicleType.SelectedItem.Value),
                    RouteIDFrom     = GlobalCode.Field2Int(uoDropDownListTFrom.SelectedItem.Value),
                    RouteIDTo       = GlobalCode.Field2Int(uoDropDownListTTo.SelectedItem.Value),

                    RouteFromVarchar = GlobalCode.Field2String(lblRoutFrom.Text),
                    RouteToVarchar   = GlobalCode.Field2String(lblRoutTo.Text),

                    ContractId = GlobalCode.Field2Int(uoHiddenFieldContractID.Value),
                    DriverID   = 0,
                    SFStatus   = GlobalCode.Field2String(lblSFStatus.Text),

                    ConfirmBy = uoTextBoxConfirmedBy.Text,
                    Comments  = uoTextBoxComment.Text,
                    StatusID  = statusID, //(short)(Status == "Cancel" ? 5 : statusID),

                    ConfirmedRateMoney = GlobalCode.Field2Double(TextBoxRateConfirmedPerSeafarer.Text)
                });
            }


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

            dt = gc.getDataTable(PAH);

            PortAgentBLL PortBLL = new PortAgentBLL();

            PortBLL.InsertNonTurnTransactionRequestBooking(dt, spName, uoHiddenFieldUser.Value, uoTextBoxEmailAdd.Text, uoTextBoxCopy.Text);
        }
Beispiel #7
0
        public List <VehicleTransactionMedical> InsertVehicleTransactionMedical(List <VehicleTransactionMedical> Medical)
        {
            Database  SFDatebase  = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase()
            DbCommand SFDbCommand = null;

            try
            {
                List <VehicleTransactionMedical> VehicleTransMedical = new List <VehicleTransactionMedical>();
                GlobalCode gc = new GlobalCode();
                DataTable  dt = new DataTable();

                DataSet ds = new DataSet();

                dt = gc.getDataTable(Medical);

                dt.Columns.Remove("ColorCode");
                dt.Columns.Remove("ForeColor");



                string strTimeZone = TimeZone.CurrentTimeZone.StandardName.ToString();
                SFDbCommand = SFDatebase.GetStoredProcCommand("uspVehicleTransactionMedicalIns");
                SqlParameter param = new SqlParameter("@pVehicleTransactionMedical", dt);

                param.Direction = ParameterDirection.Input;
                param.SqlDbType = SqlDbType.Structured;

                SFDbCommand.Parameters.Add(param);
                ds = SFDatebase.ExecuteDataSet(SFDbCommand);

                VehicleTransMedical = (from n in ds.Tables[0].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"]),
                    VehicleVendor = GlobalCode.Field2String(n["colVehicleVendorName"]),
                    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"]),

                    ColorCode = GlobalCode.Field2String(n["ColorCode"]),
                    ForeColor = GlobalCode.Field2String(n["ForeColor"]),
                }).ToList();

                return(VehicleTransMedical);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (SFDbCommand != null)
                {
                    SFDbCommand.Dispose();
                }
            }
        }
Beispiel #8
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);
        }