protected string DashboardAddDateRow()
        {
            //string RowValueString = Eval("colDate").ToString();
            //string RowTextString = string.Format("{0:dd-MM-yyyy}", RowValueString);
            string RowTextString         = string.Format("{0:dd-MMM-yyyy}", Eval("colDate"));
            string currentDataFieldValue = RowTextString;

            //See if there's been a change in value
            if (lastDateFieldValue != currentDataFieldValue)
            {
                //There's been a change! Record the change and emit the table row
                lastDateFieldValue = currentDataFieldValue;
                string sURl = "HotelDashboard2.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "&dt=" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "&branchId=" + Eval("BranchID") + "&brandId=" + Eval("BrandId") + "&branchName=" + Eval("HotelBranchName");
                //string sReturn = string.Format("<td class=\"leftAligned\"><a class=\"leftAligned\" href=\"" + sURl + "\">{0}<a/></td> <td  class=\"leftAligned\">" + Eval("colDateName"), RowTextString);
                string sReturn = "<td class=\"leftAligned\"><a class=\"leftAligned\" href=\"" + sURl + "\">" + RowTextString + "<a/>";
                if (GlobalCode.Field2Bool(Eval("IsWithEvent")))
                {
                    sReturn += "&nbsp; <a id=\"uoLinkButtonEvents\" href=\"#\" class=\"EventNotification\" title=\"With Event(s)\" OnClick=\"return OpenEventsList('" + Eval("BranchID") + "', '0', '" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "');\">*</a>";
                    //<asp:LinkButton ID="uoLinkButtonEvents" runat="server" Text="*" CssClass="EventNotification" Visible='<%# Eval("IsWithEvent") %>' ToolTip="With Event(s)"></asp:LinkButton>
                }
                sReturn += "<td  class=\"leftAligned\">" + Eval("colDateName") + "</td>";
                return(sReturn);
            }
            else
            {
                //No change, return an empty string
                return("<td></td><td></td>");
            }
        }
Exemplo n.º 2
0
 protected void uoObjectDataSourceDashboard_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
 {
     e.InputParameters["iYear"]         = GlobalCode.Field2Int(uoDropDownListYear.SelectedValue);
     e.InputParameters["iMonth"]        = GlobalCode.Field2TinyInt(uoDropDownListMonth.SelectedValue);
     e.InputParameters["iRegion"]       = GlobalCode.Field2Int(uoDropDownListRegion.SelectedValue);
     e.InputParameters["iPort"]         = GlobalCode.Field2Int(uoDropDownListPortPerRegion.SelectedValue);
     e.InputParameters["sUser"]         = uoHiddenFieldUser.Value;
     e.InputParameters["IsPageChanged"] = GlobalCode.Field2Bool(uoHiddenFieldIsPageChanged.Value);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Date Created:   11/Jan/2013
        /// Created By:     Josephine Gad
        /// (description)   Get user's region and regions to be added
        /// </summary>
        public static void GetUserRegion(string UserString, string LoginName)
        {
            DbCommand comm = null;
            DataSet   ds   = null;

            try
            {
                HttpContext.Current.Session.Remove("UserRegionList");
                HttpContext.Current.Session.Remove("UserRegionToAdd");

                List <UserRegionList>  RegionList      = new List <UserRegionList>();
                List <UserRegionToAdd> RegionListToAdd = new List <UserRegionToAdd>();


                Database db = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase()
                comm = db.GetStoredProcCommand("uspGetUserRegion");
                db.AddInParameter(comm, "@pUserIDVarchar", DbType.String, UserString);
                db.AddInParameter(comm, "@pLoginName", DbType.String, LoginName);
                ds = db.ExecuteDataSet(comm);

                RegionList = (from a in ds.Tables[0].AsEnumerable()
                              select new UserRegionList {
                    UserRegionID = GlobalCode.Field2Int(a["colUserRegionIDInt"]),
                    RegionID = GlobalCode.Field2Int(a["colRegionIDInt"]),
                    RegionName = GlobalCode.Field2String(a["colRegionNameVarchar"]),
                    IsExist = GlobalCode.Field2Bool(a["IsExist"])
                }).ToList();

                RegionListToAdd = (from a in ds.Tables[1].AsEnumerable()
                                   select new UserRegionToAdd
                {
                    RegionID = GlobalCode.Field2Int(a["colRegionIDInt"]),
                    RegionName = GlobalCode.Field2String(a["colRegionNameVarchar"])
                }).ToList();

                HttpContext.Current.Session["UserRegionList"]  = RegionList;
                HttpContext.Current.Session["UserRegionToAdd"] = RegionListToAdd;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (comm != null)
                {
                    comm.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Author:         Josephine Gad
 /// Date Created:   29/Aug/2013
 /// Description:    Tag Visible show/hide Tag Label settings
 /// </summary>
 protected bool IsTaggedLabelVisible(object IsTaggedByUser, object IsFirstPartition)
 {
     if (GlobalCode.Field2Bool(IsTaggedByUser) == true && GlobalCode.Field2Bool(IsFirstPartition) == true)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Author:         Marco Abejar
 /// Date Created:   11/Nov/2013
 /// Description:    check services
 /// </summary>
 protected string IsServiceCheck(object IsService)
 {
     if (GlobalCode.Field2Bool(IsService) == false)
     {
         return("");
     }
     else
     {
         return("checked");
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Date Modified:   16/Oct/2013
        /// Modified By:     Josephine Gad
        /// (description)    Save the Vehicle Manifest if visible or hidden to vendor
        /// </summary>
        private void SaveVehicleManifest()
        {
            string    strLogDescription = "Show or Hide Vehicle Manifest to Vendor";
            DataTable dt = null;

            try
            {
                dt = new DataTable();
                DateTime   currentDate = CommonFunctions.GetCurrentDateTime();
                int        iCount      = uoListViewCrewAdmin.Items.Count;
                DataColumn col         = new DataColumn("TransactionID", typeof(Int64));
                dt.Columns.Add(col);
                col = new DataColumn("IsVisible", typeof(Boolean));
                dt.Columns.Add(col);
                DataRow     row;
                HiddenField listUOHiddenFieldTransID;
                CheckBox    listuoCheckBoxShow;

                for (int i = 0; i < iCount; i++)
                {
                    listuoCheckBoxShow = (CheckBox)uoListViewCrewAdmin.Items[i].FindControl("uoCheckBoxNoVehicleNeed");

                    if (listuoCheckBoxShow != null)
                    {
                        listUOHiddenFieldTransID = (HiddenField)uoListViewCrewAdmin.Items[i].FindControl("uoHiddenFieldTransID");
                        row = dt.NewRow();
                        row["TransactionID"] = listUOHiddenFieldTransID.Value;
                        if (listuoCheckBoxShow.Visible == true)
                        {
                            row["IsVisible"] = GlobalCode.Field2Bool(listuoCheckBoxShow.Checked);
                        }
                        else
                        {
                            row["IsVisible"] = false;
                        }
                        dt.Rows.Add(row);
                    }
                }
                VehicleManifestBLL BLL = new VehicleManifestBLL();
                BLL.UpdateVehicleManifestShowHide(uoHiddenFieldUser.Value, strLogDescription, "SaveVehicleManifest",
                                                  Path.GetFileName(Request.Path), CommonFunctions.GetDateTimeGMT(currentDate).ToString(), dt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Exemplo n.º 7
0
        protected string DashboardAddGroup()
        {
            string GroupValueString = "HotelBranchName";

            string currentDataFieldValue = Eval(GroupValueString).ToString();

            if (currentDataFieldValue != "")
            {
                uoHiddenFieldHotelName.Value = currentDataFieldValue;
            }

            if (currentDataFieldValue.Length == 0 || currentDataFieldValue == null)
            {
                currentDataFieldValue = "";
            }
            if (lastDataFieldValue != currentDataFieldValue)
            {
                lastDataFieldValue = currentDataFieldValue;

                string sEvent = "";
                if (GlobalCode.Field2Bool(Eval("IsWithEvent")))
                {
                    sEvent = "<a id=\"uoEvent\" class=\"rightAligned\" title=\"View Event(s)\" href=\"#\" OnClick=\"return OpenEventsList('" + Eval("BranchID") + "', '0', '" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "');\"><img ID=\"uoImageEvent\" src=\"../Images/calendar1.png\" Width=\"20px\" alt=\"View Event(s)\" border=\"0\"/></a>";
                }
                else
                {
                    //sEvent = "<a id=\"uoEvent\" class=\"rightAligned\" title=\"No Event(s)\"><img ID=\"uoImageEvent\" src=\"../Images/calendar1.png\" visible=\"false\" Width=\"20px\" alt=\"No Event(s)\" border=\"0\"/></a>";
                    sEvent = "<a id=\"uoEvent\" class=\"rightAligned\" title=\"No Event(s)\"></a>";
                }

                string sContract = "<td class=\"tdEvent\"><a id=\"uoContract\" class=\"rightAligned\" title=\"View Contract\" href=\"#\" onclick='return OpenContract(\"" + Eval("BranchID") + "\",\"" + Eval("ContractId") + "\")'\"><img ID=\"uoImageContract\" src=\"../Images/contract.jpg\" Width=\"20px\" alt=\"View Contract\" border=\"0\"/></a> " + sEvent + "</td>";
                //string sNoContract = "<td class=\"tdEvent\"><a id=\"uoContract\" class=\"rightAligned\" title=\"No Contract\"><img ID=\"uoImageContract\"  visible=\"false\" src=\"../Images/contract.jpg\" Width=\"20px\" alt=\"No Contract\" border=\"0\"/></a> " + sEvent + "</td>";
                string sNoContract = "<td class=\"tdEvent\"><a id=\"uoContract\" class=\"rightAligned\" title=\"No Contract\"></a> " + sEvent + "</td>";

                string sResult = "";
                if (Eval("IsWithContract").ToString() == "True")
                {
                    sResult = string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><span class=\"leftAligned\">{0}</span></strong></td>" + sContract + "</tr>", currentDataFieldValue);
                }
                else
                {
                    sResult = string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLink\"><a class=\"leftAligned\" href=\"#\">{0}<a/></strong></td>" + sNoContract + "</tr>", currentDataFieldValue);
                }
                return(sResult);
            }
            else
            {
                return(string.Empty);
            }
        }
Exemplo n.º 8
0
        protected string DashboardAddDateRow()
        {
            string RowTextString         = string.Format("{0:dd-MMM-yyyy}", Eval("colDate"));
            string currentDataFieldValue = RowTextString;

            lastDateFieldValue = currentDataFieldValue;
            string sReturn = "<tr><td class=\"leftAligned\"><label id=\"Label12\">Date:</label></td><td class=\"leftAligned\">" + RowTextString + "</td></tr>";

            if (GlobalCode.Field2Bool(Eval("IsWithEvent")))
            {
                sReturn += "&nbsp; <a id=\"uoLinkButtonEvents\" href=\"#\" class=\"EventNotification\" title=\"With Event(s)\" OnClick=\"return OpenEventsList('" + Eval("BranchID") + "', '0', '" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "');\">*</a>";
            }
            sReturn += "<tr><td class=\"leftAligned\"><label id=\"Label12\">Day of the Week:</label></td><td class=\"leftAligned\">" + Eval("colDateName") + "</td></tr>";
            return(sReturn);
        }
Exemplo n.º 9
0
        protected void LoadDetails()
        {
            IDataReader dr = null;

            try
            {
                dr = dbBLL.getOverrideDetails(uoHiddenFieldBranchId.Value, GlobalCode.Field2String(Request.QueryString["hrId"]), uoDropdownListRoom.SelectedValue);
                if (dr.Read())
                {
                    Hotel = dr["colVendorBranchNameVarchar"].ToString();
                    uoHiddenFieldCountryId.Value = dr["colCountryIDInt"].ToString();
                    if (Request.QueryString["hrId"] != "0")
                    {
                        DateTime dt = GlobalCode.Field2DateTime(dr["colEffectiveDate"]);
                        EffectiveDate = String.Format("{0:mm/dd/yyyy}", dr["colEffectiveDate"]) + " (" +
                                        dt.Day + ")";
                        uoHiddenFieldEffectiveDate.Value = String.Format("{0:mm/dd/yyyy}", dr["colEffectiveDate"]);
                        RoomType                    = dr["colRoomNameVarchar"].ToString();
                        uoTextBoxRate.Text          = dr["colRatePerDayMoney"].ToString().Remove(dr["colRatePerDayMoney"].ToString().Length - 2);
                        uoTextBoxRateTax.Text       = (GlobalCode.Field2Decimal(dr["colRoomRateTaxPercentage"].ToString()) * 100).ToString();
                        uoCheckBoxTaxBit.Checked    = GlobalCode.Field2Bool(dr["colRoomRateTaxInclusive"].ToString());
                        uoTextBoxNumberOfRooms.Text = dr["colRoomBlocksPerDayInt"].ToString();
                    }
                    else
                    {
                        //TREditrType.Visible = false;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dr != null)
                {
                    dr.Dispose();
                }
            }
        }
Exemplo n.º 10
0
        protected string DashboardAddGroup()
        {
            //Get the data field value of interest for this row
            //string GroupTextString = "Hotel Branch";
            string GroupValueString      = "HotelBranchName";
            string currentDataFieldValue = Eval(GroupValueString).ToString();

            string sURl = "HotelDashboard3.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "&dt=" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "&branchId=" + Eval("BranchID") + "&brandId=" + Eval("BrandId") + "&branchName=" + Eval("HotelBranchName");

            string sEvent = "";

            if (GlobalCode.Field2Bool(Eval("IsWithEvent")))
            {
                //sEvent = "<td class=\"tdEvent\"><a class=\"rightAligned\" title=\"View Event(s)\" href=\"#\" OnClick=\"return OpenEventsList('" + Eval("BranchID") + "', '0', '" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "');\"><img ID=\"uoImageEvent\" src=\"Images/calendar1.png\" Width=\"20px\" alt=\"View Event(s)\" border=\"0\"/></a></td>";
                sEvent = "<a id=\"uoEvent\" class=\"rightAligned\" title=\"View Event(s)\" href=\"#\" OnClick=\"return OpenEventsList('" + Eval("BranchID") + "', '0', '" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "');\"><img ID=\"uoImageEvent\" src=\"Images/calendar1.png\" Width=\"20px\" alt=\"View Event(s)\" border=\"0\"/></a>";
            }
            else
            {
                //sEvent = "<td class=\"tdEvent\"><a class=\"rightAligned\" title=\"No Event(s)\"><img ID=\"uoImageEvent\" src=\"Images/calendar1.png\" Width=\"20px\" alt=\"No Event(s)\" border=\"0\"/></a></td>";
                //sEvent = "<a id=\"uoEvent\" class=\"rightAligned\" title=\"No Event(s)\"><img ID=\"uoImageEvent\" src=\"Images/calendar1.png\" Width=\"20px\" alt=\"No Event(s)\" border=\"0\"/></a>";
                sEvent = "";
            }

            string sContract = "<td class=\"tdEvent\"><a id=\"uoContract\" class=\"rightAligned\" title=\"View Contract\" href=\"#\" onclick='return OpenContract(\"" + Eval("BranchID") + "\",\"" + Eval("ContractId") + "\")'\"><img ID=\"uoImageContract\" src=\"Images/contract.jpg\" Width=\"20px\" alt=\"View Contract\" border=\"0\"/></a> " + sEvent + "</td>";
            //string sNoContract = "<td class=\"tdEvent\"><a id=\"uoContract\" class=\"rightAligned\" title=\"No Contract\"><img ID=\"uoImageContract\" src=\"Images/contract.jpg\" Width=\"20px\" alt=\"No Contract\" border=\"0\"/></a> " + sEvent + "</td>";
            string sNoContract = "<td class=\"tdEvent\">" + sEvent + "</td>";

            string sReturn;

            if (Eval("IsWithContract").ToString() == "True")
            {
                sReturn = string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLink\"><a class=\"leftAligned\" href=\"" + sURl + "\">{0}<a/></strong></td>" + sContract + "</tr>", currentDataFieldValue);
                //return string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLink\"><a class=\"leftAligned\" href=\"" + sURl + "\">{0}<a/></strong></td>" + sContract + "" + sEvent + "</tr>", currentDataFieldValue);
            }
            else
            {
                sReturn = string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLink\"><a class=\"leftAligned\" href=\"" + sURl + "\">{0}<a/></strong></td>" + sNoContract + "</tr>", currentDataFieldValue);
                //return string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLink\"><a class=\"leftAligned\" href=\"" + sURl + "\">{0}<a/></strong></td>" + sNoContract + "" + sEvent + "</tr>", currentDataFieldValue);
            }
            return(sReturn);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Date Created: 08/08/2011
        /// Created By: Josephine Gad
        /// (description) Change the backgroung color of old record
        /// </summary>
        protected bool InactiveControl(object IsActive)
        {
            //if (IsActive.ToString() == "1")
            Boolean IsActiveBool = (bool)IsActive;

            if (IsActiveBool)
            {
                if (!GlobalCode.Field2Bool(uoHiddenFieldInactiveContract.Value))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// Date Created: 30/09/2011
        /// Created By: Charlene Remotigue
        /// </summary>

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (GlobalCode.Field2Int(Request.QueryString["vmId"]) == 0)
                {
                    uoHiddenFieldNew.Value = "true";
                }
                else
                {
                    uoHiddenFieldRegion.Value     = GlobalCode.Field2Int(Request.QueryString["vmId"]).ToString();
                    uoHiddenFieldRegionName.Value = GlobalCode.Field2String(Request.QueryString["vmName"]);
                }

                if (!GlobalCode.Field2Bool(uoHiddenFieldNew.Value))
                {
                    uoTextBoxRegionName.Text = uoHiddenFieldRegionName.Value;
                }

                LoadRegionPage();
            }
        }
Exemplo n.º 13
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();
                }
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Date Modified: 17/Oct/2013
        /// Modified By:   Josephine Gad
        /// (description)  Get Service Request List
        /// </summary>
        public void GetServiceRequestList(DateTime dDate, string sUser, int iStartRow, int iMaxRow,
                                          Int16 iLoad, string sOrderBy, Int16 iViewFilter, Int16 iViewActive, Int16 iViewBooked,
                                          Int16 iFilterType, Int64 iEmployeeID, string sCrewAssistUser)
        {
            List <ServiceRequestList> list = new List <ServiceRequestList>();
            Database  db     = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase()
            DbCommand dbComm = null;
            DataSet   ds     = null;
            DataTable dt     = null;
            int       iCount = 0;

            HttpContext.Current.Session["ServiceRequestView_Count"]          = iCount;
            HttpContext.Current.Session["ServiceRequestView_ServiceReqList"] = list;

            try
            {
                dbComm = db.GetStoredProcCommand("uspGetServiceRequest");
                db.AddInParameter(dbComm, "@pDate", DbType.DateTime, dDate);
                db.AddInParameter(dbComm, "@pUserID", DbType.String, sUser);
                db.AddInParameter(dbComm, "@pStartRow", DbType.Int32, iStartRow);
                db.AddInParameter(dbComm, "@pMaxRow", DbType.Int32, iMaxRow);
                db.AddInParameter(dbComm, "@pLoadType", DbType.Int16, iLoad);
                db.AddInParameter(dbComm, "@pOrderby", DbType.String, sOrderBy);

                db.AddInParameter(dbComm, "@pViewFilter", DbType.Int16, iViewFilter);
                db.AddInParameter(dbComm, "@pViewActive", DbType.Int16, iViewActive);
                db.AddInParameter(dbComm, "@pViewBooked", DbType.Int16, iViewBooked);

                //db.AddInParameter(dbComm, "@pViewAllDate", DbType.Boolean, isViewAllDate);
                db.AddInParameter(dbComm, "@pViewFilterType", DbType.Int16, iFilterType);
                db.AddInParameter(dbComm, "@pSeafarerIDInt", DbType.Int64, iEmployeeID);
                db.AddInParameter(dbComm, "@pCrewAssistUser", DbType.String, sCrewAssistUser);


                dbComm.CommandTimeout = 120;
                ds     = db.ExecuteDataSet(dbComm);
                iCount = GlobalCode.Field2Int(ds.Tables[0].Rows[0][0]);
                dt     = ds.Tables[1];

                list = (from a in dt.AsEnumerable()
                        select new ServiceRequestList
                {
                    HotelRequestIDBigint = GlobalCode.Field2Int(a["HotelRequestIDBigint"]),
                    VehicleRequestIDBigint = GlobalCode.Field2Int(a["VehicleRequestIDBigint"]),
                    MeetGreetRequestIDBigint = GlobalCode.Field2Int(a["MeetGreetRequestIDBigint"]),
                    PortAgentRequestIDBigint = GlobalCode.Field2Int(a["PortAgentRequestIDBigint"]),

                    IDBigInt = GlobalCode.Field2Int(a["colIDBigInt"]),
                    TravelReqIDInt = GlobalCode.Field2Int(a["colTravelReqIDInt"]),
                    //RequestIDInt = 0,


                    SeafarerIDInt = GlobalCode.Field2Int(a["colSeafarerIDInt"]),
                    SFStatus = a.Field <string>("colSFStatus"),
                    SignOnOffDate = a.Field <DateTime?>("SignOnOffDate"),

                    VesselID = GlobalCode.Field2Int(a["colVesselIdInt"]),
                    VesselName = a.Field <string>("Vessel"),

                    LastName = a.Field <string>("LastName"),
                    FirstName = a.Field <string>("FirstName"),

                    IsWithHotelRequest = GlobalCode.Field2Bool(a["IsWithHotelRequest"]),
                    IsWithVehicleRequest = GlobalCode.Field2Bool(a["IsWithVehicleRequest"]),
                    IsWithMeetGreetRequest = GlobalCode.Field2Bool(a["IsWithMeetGreetRequest"]),
                    IsWithPortAgentRequest = GlobalCode.Field2Bool(a["IsWithPortAgentRequest"]),

                    IsHotelRequestActive = GlobalCode.Field2Bool(a["IsHotelRequestActive"]),
                    IsVehicleRequestActive = GlobalCode.Field2Bool(a["IsVehicleRequestActive"]),
                    IsMeetGreetRequestActive = GlobalCode.Field2Bool(a["IsMeetGreetRequestActive"]),
                    IsPortAgentRequestActive = GlobalCode.Field2Bool(a["IsPortAgentRequestActive"]),

                    IsHotelRequestBook = GlobalCode.Field2Bool(a["IsHotelRequestBook"]),
                    IsVehicleRequestBook = GlobalCode.Field2Bool(a["IsVehicleRequestBook"]),
                    IsMeetGreetRequestBook = GlobalCode.Field2Bool(a["IsMeetGreetRequestBook"]),
                    IsPortAgentRequestBook = GlobalCode.Field2Bool(a["IsPortAgentRequestBook"]),

                    IsEmailVisible = GlobalCode.Field2Bool(a["IsEmailVisible"]),
                    AirSeqNo = GlobalCode.Field2Int(a["colSeqNoInt"]),
                    RankName = GlobalCode.Field2String(a["RankName"]),

                    HotelRequestCreatedBy = a.Field <string>("HotelRequestCreatedBy"),
                    VehicleRequestCreatedBy = a.Field <string>("VehicleRequestCreatedBy"),
                    PortAgentRequestCreatedBy = a.Field <string>("PortAgentRequestCreatedBy"),

                    HotelRequestCreatedDate = a.Field <DateTime?>("HotelRequestCreatedDate"),
                    VehicleRequestCreatedDate = a.Field <DateTime?>("VehicleRequestCreatedDate"),
                    PortAgentRequestCreatedDate = a.Field <DateTime?>("PortAgentRequestCreatedDate"),
                }).ToList();

                HttpContext.Current.Session["ServiceRequestView_Count"]          = iCount;
                HttpContext.Current.Session["ServiceRequestView_ServiceReqList"] = list;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dbComm != null)
                {
                    dbComm.Dispose();
                }
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// Author:         Marco Abejar Gad
        /// Modified Date:   26/April/2013
        /// Description:    Added columns and include aie legs
        /// </summary>
        public static void CreateExcel(DataTable dtSource, string strFileName, string sVessel)
        {
            try
            {
                // Create XMLWriter
                using (XmlTextWriter xtwWriter = new XmlTextWriter(strFileName, Encoding.UTF8))
                {
                    int iColCount = (dtSource.Columns.Count) - 1;
                    //Format the output file for reading easier
                    xtwWriter.Formatting = Formatting.Indented;

                    // <?xml version="1.0"?>
                    xtwWriter.WriteStartDocument();

                    // <?mso-application progid="Excel.Sheet"?>
                    xtwWriter.WriteProcessingInstruction("mso-application", "progid=\"Excel.Sheet\"");

                    // <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet >"
                    xtwWriter.WriteStartElement("Workbook", "urn:schemas-microsoft-com:office:spreadsheet");

                    //Write definition of namespace
                    xtwWriter.WriteAttributeString("xmlns", "o", null, "urn:schemas-microsoft-com:office:office");
                    xtwWriter.WriteAttributeString("xmlns", "x", null, "urn:schemas-microsoft-com:office:excel");
                    xtwWriter.WriteAttributeString("xmlns", "ss", null, "urn:schemas-microsoft-com:office:spreadsheet");
                    xtwWriter.WriteAttributeString("xmlns", "html", null, "http://www.w3.org/TR/REC-html40");

                    // <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
                    xtwWriter.WriteStartElement("DocumentProperties", "urn:schemas-microsoft-com:office:office");

                    // Write document properties
                    xtwWriter.WriteElementString("Author", "Travelmart");
                    xtwWriter.WriteElementString("LastAuthor", Environment.UserName);
                    xtwWriter.WriteElementString("Created", DateTime.Now.ToString("u") + "Z");
                    xtwWriter.WriteElementString("Company", "RCCL");
                    xtwWriter.WriteElementString("Version", "1");

                    // </DocumentProperties>
                    xtwWriter.WriteEndElement();

                    // <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
                    xtwWriter.WriteStartElement("ExcelWorkbook", "urn:schemas-microsoft-com:office:excel");

                    // Write settings of workbook
                    xtwWriter.WriteElementString("WindowHeight", "13170");
                    xtwWriter.WriteElementString("WindowWidth", "17580");
                    xtwWriter.WriteElementString("WindowTopX", "120");
                    xtwWriter.WriteElementString("WindowTopY", "60");
                    xtwWriter.WriteElementString("ProtectStructure", "False");
                    xtwWriter.WriteElementString("ProtectWindows", "False");

                    // </ExcelWorkbook>
                    xtwWriter.WriteEndElement();

                    // <Styles>
                    xtwWriter.WriteStartElement("Styles");

                    // <Style ss:ID="Default" ss:Name="Normal">
                    xtwWriter.WriteStartElement("Style");
                    xtwWriter.WriteAttributeString("ss", "ID", null, "Default");
                    xtwWriter.WriteAttributeString("ss", "Name", null, "Normal");

                    // <Alignment ss:Vertical="Bottom"/>
                    xtwWriter.WriteStartElement("Alignment");
                    xtwWriter.WriteAttributeString("ss", "Vertical", null, "Bottom");
                    xtwWriter.WriteEndElement();

                    // Write null on the other properties
                    xtwWriter.WriteElementString("Borders", null);
                    xtwWriter.WriteElementString("Font", null);
                    xtwWriter.WriteElementString("Interior", null);
                    xtwWriter.WriteElementString("NumberFormat", null);
                    xtwWriter.WriteElementString("Protection", null);
                    // </Style>
                    xtwWriter.WriteEndElement();

                    //Style for header
                    xtwWriter.WriteStartElement("Style");
                    //<Style ss:ID="s62">
                    xtwWriter.WriteAttributeString("ss", "ID", null, "s62");
                    xtwWriter.WriteStartElement("Font");
                    // <Font ss:Bold="1"/>
                    xtwWriter.WriteAttributeString("ss", "Bold", null, "1");
                    //end of font
                    xtwWriter.WriteEndElement();
                    //End Style for header
                    xtwWriter.WriteEndElement();

                    //////////////////////////////////////////////////////////////////////
                    //Style for for group with border
                    xtwWriter.WriteStartElement("Style");
                    //<Style ss:ID="s63">
                    xtwWriter.WriteAttributeString("ss", "ID", null, "s63");

                    xtwWriter.WriteStartElement("Alignment");
                    xtwWriter.WriteAttributeString("ss", "Horizontal", null, "Left");
                    xtwWriter.WriteAttributeString("ss", "Vertical", null, "Bottom");
                    xtwWriter.WriteEndElement(); //End of Alignment
                    xtwWriter.WriteStartElement("Borders");
                    xtwWriter.WriteStartElement("Border");
                    xtwWriter.WriteAttributeString("ss", "Position", null, "Top");
                    xtwWriter.WriteAttributeString("ss", "LineStyle", null, "Continuous");
                    xtwWriter.WriteAttributeString("ss", "Weight", null, "1");
                    xtwWriter.WriteEndElement(); //End of Borders
                    xtwWriter.WriteEndElement(); // End of Border

                    //End Style for group with border
                    xtwWriter.WriteEndElement();
                    ////////////////////////////////////////////////////////////////////////

                    //Style for total summary numbers
                    xtwWriter.WriteStartElement("Style");
                    //<Style ss:ID="s64">
                    xtwWriter.WriteAttributeString("ss", "ID", null, "s64");
                    xtwWriter.WriteStartElement("Alignment");
                    xtwWriter.WriteAttributeString("ss", "Horizontal", null, "Right");
                    xtwWriter.WriteAttributeString("ss", "Vertical", null, "Bottom");
                    xtwWriter.WriteEndElement();
                    //End Style for header
                    xtwWriter.WriteEndElement();


                    //Style for Rows
                    xtwWriter.WriteStartElement("Style");
                    //<Style ss:ID="s64">
                    xtwWriter.WriteAttributeString("ss", "ID", null, "s65");
                    xtwWriter.WriteStartElement("Alignment");
                    xtwWriter.WriteAttributeString("ss", "Horizontal", null, "Left");
                    xtwWriter.WriteAttributeString("ss", "Vertical", null, "Bottom");
                    // </Alignment>
                    xtwWriter.WriteEndElement();
                    // </Style>
                    xtwWriter.WriteEndElement();


                    // </Styles>
                    xtwWriter.WriteEndElement();

                    // <Worksheet ss:Name="xxx">
                    xtwWriter.WriteStartElement("Worksheet");
                    xtwWriter.WriteAttributeString("ss", "Name", null, "Ship_" + sVessel);

                    // <Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="3" x:FullColumns="1" x:FullRows="1" ss:DefaultColumnWidth="60">
                    xtwWriter.WriteStartElement("Table");

                    int iRow = dtSource.Rows.Count + 15;

                    xtwWriter.WriteAttributeString("ss", "ExpandedColumnCount", null, iColCount.ToString());
                    xtwWriter.WriteAttributeString("ss", "ExpandedRowCount", null, iRow.ToString());

                    xtwWriter.WriteAttributeString("x", "FullColumns", null, "1");
                    xtwWriter.WriteAttributeString("x", "FullRows", null, "1");
                    xtwWriter.WriteAttributeString("ss", "DefaultColumnWidth", null, "60");


                    //Header
                    xtwWriter.WriteStartElement("Row");
                    xtwWriter.WriteAttributeString("ss", "StyleID", null, "s62");
                    int i = 1;
                    foreach (DataColumn Header in dtSource.Columns)
                    {
                        if (i <= iColCount)
                        {
                            if (Header.ColumnName.ToUpper() != "ISVISIBLE")
                            {
                                xtwWriter.WriteStartElement("Cell");
                                // xxx
                                xtwWriter.WriteStartElement("Data");
                                xtwWriter.WriteAttributeString("ss", "Type", null, "String");
                                // Write content of cell
                                xtwWriter.WriteValue(Header.ColumnName);
                                xtwWriter.WriteEndElement();
                                xtwWriter.WriteEndElement();
                            }
                        }
                        i++;
                    }
                    xtwWriter.WriteEndElement();


                    // Run through all rows of data source
                    foreach (DataRow row in dtSource.Rows)
                    {
                        //// <Row>
                        //xtwWriter.WriteStartElement("Row");

                        //i = 1;
                        //// Run through all cell of current rows
                        //foreach (object cellValue in row.ItemArray)
                        //{
                        //    if (i <= iColCount)
                        //    {
                        //        // <Cell>
                        //        xtwWriter.WriteStartElement("Cell");

                        //        // <Data ss:Type="String">xxx</Data>
                        //        xtwWriter.WriteStartElement("Data");
                        //        xtwWriter.WriteAttributeString("ss", "Type", null, "String");
                        //        // Write content of cell
                        //        if (dtSource.Columns[i - 1].Caption.ToUpper() == "AIRSEQUENCE" ||
                        //                   dtSource.Columns[i - 1].Caption.ToUpper() == "FROM CITY" ||
                        //                   dtSource.Columns[i - 1].Caption.ToUpper() == "TO CITY" ||
                        //                   dtSource.Columns[i - 1].Caption.ToUpper() == "DEPT DATE" ||
                        //                   dtSource.Columns[i - 1].Caption.ToUpper() == "DEPT TIME" ||
                        //                   dtSource.Columns[i - 1].Caption.ToUpper() == "ARVL DATE" ||
                        //                   dtSource.Columns[i - 1].Caption.ToUpper() == "ARVL TIME" ||
                        //                   dtSource.Columns[i - 1].Caption.ToUpper() == "CARRIER" ||
                        //                   dtSource.Columns[i - 1].Caption.ToUpper() == "FLIGHTNO")
                        //        {
                        //            // Write content of cell
                        //            xtwWriter.WriteValue(GlobalCode.Field2String(cellValue));
                        //        }
                        //        else
                        //        {
                        //            xtwWriter.WriteValue("");
                        //        }

                        //        // </Data>
                        //        xtwWriter.WriteEndElement();

                        //        // </Cell>
                        //        xtwWriter.WriteEndElement();
                        //    }
                        //    i++;
                        //}
                        //// </Row>
                        //xtwWriter.WriteEndElement();

                        bool bGroup = false;
                        bGroup = GlobalCode.Field2Bool(row["IsVisible"]);

                        // <Row>
                        xtwWriter.WriteStartElement("Row");
                        xtwWriter.WriteAttributeString("ss", "StyleID", null, "s65");
                        i = 1;

                        //sEmployeeName = row["Name"].ToString();

                        // Run through all cell of current rows

                        foreach (object cellValue in row.ItemArray)
                        {
                            if (dtSource.Columns[i - 1].Caption.ToUpper() != "ISVISIBLE")
                            {
                                if (bGroup)
                                {
                                    if (i <= iColCount)
                                    {
                                        // <Cell>
                                        xtwWriter.WriteStartElement("Cell");
                                        //Border
                                        xtwWriter.WriteAttributeString("ss", "StyleID", null, "s63");
                                        // <Data ss:Type="String">xxx</Data>
                                        xtwWriter.WriteStartElement("Data");

                                        if (dtSource.Columns[i - 1].Caption.ToUpper() == "E1ID" ||
                                            //dtSource.Columns[i - 1].Caption.ToUpper() == "HOTEL NITES" ||
                                            //dtSource.Columns[i - 1].Caption.ToUpper() == "ROOM TYPE" ||
                                            //dtSource.Columns[i - 1].Caption.ToUpper() == "MEAL ALLOWANCE" ||
                                            //dtSource.Columns[i - 1].Caption.ToUpper() == "FLIGHT NO." ||
                                            //dtSource.Columns[i - 1].Caption.ToUpper() == "DEPT TIME" ||
                                            //dtSource.Columns[i - 1].Caption.ToUpper() == "ARVL TIME" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "AIR SEQUENCE")
                                        {
                                            xtwWriter.WriteAttributeString("ss", "Type", null, "Number");
                                        }
                                        else if (dtSource.Columns[i - 1].Caption.ToUpper() == "COSTCENTER")
                                        {
                                            if (GlobalCode.Field2Int(cellValue) > 0)
                                            {
                                                xtwWriter.WriteAttributeString("ss", "Type", null, "Number");
                                            }
                                            else
                                            {
                                                xtwWriter.WriteAttributeString("ss", "Type", null, "String");
                                            }
                                        }
                                        else
                                        {
                                            xtwWriter.WriteAttributeString("ss", "Type", null, "String");
                                        }

                                        // Write content of cell
                                        xtwWriter.WriteValue(GlobalCode.Field2String(cellValue));

                                        // </Data>
                                        xtwWriter.WriteEndElement();

                                        // </Cell>
                                        xtwWriter.WriteEndElement();
                                    }
                                }
                                else
                                {
                                    if (i <= iColCount)
                                    {
                                        // <Cell>
                                        xtwWriter.WriteStartElement("Cell");

                                        // <Data ss:Type="String">xxx</Data>
                                        xtwWriter.WriteStartElement("Data");

                                        if (
                                            //dtSource.Columns[i - 1].Caption.ToUpper() == "FLIGHT NO." ||
                                            //dtSource.Columns[i - 1].Caption.ToUpper() == "DEPT TIME" ||
                                            //dtSource.Columns[i - 1].Caption.ToUpper() == "ARVL TIME" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "AIR SEQUENCE")
                                        {
                                            xtwWriter.WriteAttributeString("ss", "Type", null, "Number");
                                        }
                                        else if (dtSource.Columns[i - 1].Caption.ToUpper() == "COSTCENTER")
                                        {
                                            if (GlobalCode.Field2Int(cellValue) > 0)
                                            {
                                                xtwWriter.WriteAttributeString("ss", "Type", null, "Number");
                                            }
                                            else
                                            {
                                                xtwWriter.WriteAttributeString("ss", "Type", null, "String");
                                            }
                                        }
                                        else
                                        {
                                            xtwWriter.WriteAttributeString("ss", "Type", null, "String");
                                        }

                                        if (dtSource.Columns[i - 1].Caption.ToUpper() == "AIR SEQUENCE" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "FROM CITY" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "TO CITY" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "DEPT DATE" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "DEPT TIME" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "ARVL DATE" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "ARVL TIME" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "AIRLINE" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "FLIGHT NO." ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "HOTEL" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "CHECKIN" ||
                                            dtSource.Columns[i - 1].Caption.ToUpper() == "CHECKOUT")
                                        {
                                            // Write content of cell
                                            xtwWriter.WriteValue(GlobalCode.Field2String(cellValue).ToUpper());
                                        }
                                        else
                                        {
                                            xtwWriter.WriteValue("");
                                        }
                                        // </Data>
                                        xtwWriter.WriteEndElement();

                                        // </Cell>
                                        xtwWriter.WriteEndElement();
                                    }
                                }
                            }
                            i++;
                        }
                        // </Row>
                        xtwWriter.WriteEndElement();
                    }

                    // </Table>
                    xtwWriter.WriteEndElement();

                    // <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
                    xtwWriter.WriteStartElement("WorksheetOptions", "urn:schemas-microsoft-com:office:excel");

                    // Write settings of page
                    xtwWriter.WriteStartElement("PageSetup");
                    xtwWriter.WriteStartElement("Header");
                    xtwWriter.WriteAttributeString("x", "Margin", null, "0.4921259845");
                    xtwWriter.WriteEndElement();
                    xtwWriter.WriteStartElement("Footer");
                    xtwWriter.WriteAttributeString("x", "Margin", null, "0.4921259845");
                    xtwWriter.WriteEndElement();
                    xtwWriter.WriteStartElement("PageMargins");
                    xtwWriter.WriteAttributeString("x", "Bottom", null, "0.984251969");
                    xtwWriter.WriteAttributeString("x", "Left", null, "0.78740157499999996");
                    xtwWriter.WriteAttributeString("x", "Right", null, "0.78740157499999996");
                    xtwWriter.WriteAttributeString("x", "Top", null, "0.984251969");
                    xtwWriter.WriteEndElement();
                    xtwWriter.WriteEndElement();

                    // <Selected/>
                    xtwWriter.WriteElementString("Selected", null);

                    // <Panes>
                    xtwWriter.WriteStartElement("Panes");

                    // <Pane>
                    xtwWriter.WriteStartElement("Pane");

                    // Write settings of active field
                    xtwWriter.WriteElementString("Number", "1");
                    xtwWriter.WriteElementString("ActiveRow", "1");
                    xtwWriter.WriteElementString("ActiveCol", "1");

                    // </Pane>
                    xtwWriter.WriteEndElement();

                    // </Panes>
                    xtwWriter.WriteEndElement();

                    // <ProtectObjects>False</ProtectObjects>
                    xtwWriter.WriteElementString("ProtectObjects", "False");

                    // <ProtectScenarios>False</ProtectScenarios>
                    xtwWriter.WriteElementString("ProtectScenarios", "False");

                    // </WorksheetOptions>
                    xtwWriter.WriteEndElement();

                    // </Worksheet>
                    xtwWriter.WriteEndElement();

                    // </Workbook>
                    xtwWriter.WriteEndElement();

                    // Write file on hard disk
                    xtwWriter.Flush();
                    xtwWriter.Close();

                    //FileInfo FileName = new FileInfo(strFileName);
                    //FileStream fs = new FileStream(FileName.FullName, FileMode.Create);
                    //fs.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dtSource != null)
                {
                    dtSource.Dispose();
                }
            }
        }
Exemplo n.º 16
0
        protected void btnApproved_click(object sender, EventArgs e)
        {
            try
            {
                ImmigrationBLL BLL = new ImmigrationBLL();

                if (uoListViewCrewverification.Items.Count == 0)
                {
                    AlertMessage("Crew member has no upcomming assigment, Please try other crew member! ");
                    return;
                }

                bool   IsApproved    = true;
                Button ApproveButton = (Button)sender;

                DateTime curDate = new DateTime();

                //curDate = GlobalCode.Field2DateTime("2015-05-05 16:11:28.680");
                //DateTime T = GlobalCode.Field2TimeZoneTime(GlobalCode.Field2DateTime("2015-05-05 16:11:28.680") , );


                if (ApproveButton.ID == "btnApproved")
                {
                    IsApproved = true;
                    rdbFraudulentDoc.Checked = false;
                    rdbPriorIIssue.Checked   = false;
                    rdbPriorConDep.Checked   = false;
                    rdbOther.Checked         = false;
                    txtOtherComment.Text     = "";
                }
                else
                {
                    IsApproved = false;
                }


                HiddenField uoCrewVericationID = null;
                HiddenField uoLOEControlNumber = null;

                HiddenField uoHDFVesselID = null;
                HiddenField uoHDFRankID   = null;

                TextBox txtJoindate = null;
                TextBox txtJoinPort = null;
                TextBox txtJoinCity = null;

                foreach (ListViewItem item in uoListViewCrewverification.Items)
                {
                    uoLOEControlNumber = (HiddenField)item.FindControl("uoHiddenFieldControlNo");
                    uoCrewVericationID = (HiddenField)item.FindControl("uoHiddenFieldCrewVericationID");

                    txtJoindate = (TextBox)item.FindControl("txtJoindate");
                    txtJoinPort = (TextBox)item.FindControl("txtJoinPort");
                    txtJoinCity = (TextBox)item.FindControl("txtJoinCity");


                    uoHDFRankID   = (HiddenField)item.FindControl("uoHDFRankID");
                    uoHDFVesselID = (HiddenField)item.FindControl("uoHDFVesselID");
                }



                List <CrewImmigration> Immigration = new List <CrewImmigration>();
                if (rdbOther.Checked == false)
                {
                    txtOtherComment.Text = "";
                }

                Immigration.Add(new CrewImmigration
                {
                    CrewVericationID = GlobalCode.Field2Long(uoCrewVericationID.Value),
                    SeaparerID       = GlobalCode.Field2Long(txtUniqeID.Text),

                    TravelReqID      = GlobalCode.Field2Long(uoHDFCrewVericationID.Value),
                    RecordLocator    = GlobalCode.Field2String(uoHDFRecordLocator.Value),
                    ItinerarySeqNo   = GlobalCode.Field2Int(uoHDFItinerarySeqID.Value),
                    LOEControlNumber = GlobalCode.Field2String(txtLOEControlNo.Text),

                    VesselID = GlobalCode.Field2Int(uoHDFVesselID.Value),
                    RankID   = GlobalCode.Field2Int(uoHDFRankID.Value),

                    Joindate = GlobalCode.Field2DateTime(txtJoindate.Text),
                    JoinPort = GlobalCode.Field2String(txtJoinPort.Text),
                    JoinCity = GlobalCode.Field2String(txtJoinCity.Text),

                    Reason             = 0,
                    IsFraudulentDoc    = GlobalCode.Field2Bool(rdbFraudulentDoc.Checked),
                    IsPriorImmigIssues = GlobalCode.Field2Bool(rdbPriorIIssue.Checked),
                    IsPriorConDep      = GlobalCode.Field2Bool(rdbPriorConDep.Checked),
                    IsOther            = GlobalCode.Field2Bool(rdbOther.Checked),
                    IsApproved         = GlobalCode.Field2Bool(IsApproved),
                    OtherDetail        = GlobalCode.Field2String(txtOtherComment.Text),
                    UserID             = GlobalCode.Field2String(uoHDFuserID.Value),
                });
                Immigration = BLL.InsertCrewImmigration(Immigration);

                Session["immigration"] = Immigration;

                int row = 0;

                if (Immigration.Count > 1)
                {
                    foreach (CrewImmigration item in Immigration)
                    {
                        if (item.CrewVericationID == GlobalCode.Field2Long(uoCrewVericationID.Value))
                        {
                            row = row + 1;
                        }
                    }
                }

                crewverification(Immigration, row);
            }
            catch (Exception ex)
            { throw ex; }
        }
Exemplo n.º 17
0
        /// <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();
                }
            }
        }
Exemplo n.º 18
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();
                }
            }
        }
Exemplo n.º 19
0
        void crewverification(List <CrewImmigration> immigration, int RowIndex)
        {
            tblUCDate.Text = DateTime.Now.ToString("MM/dd/yyyy") + " [" + DateTime.Now.ToString("hh:mm tt") + "]";

            if (immigration.Count > 0)
            {
                txtUniqeID.Text   = immigration[RowIndex].SeaparerID.ToString();
                txtTelephone.Text = immigration[RowIndex].ContactNo;

                txtPassportNo.Text   = immigration[RowIndex].PassportNo;
                txtNationality.Text  = immigration[RowIndex].Nationality;
                txtLastName.Text     = immigration[RowIndex].LastName;
                txtFirstName.Text    = immigration[RowIndex].FirstName;
                txtLOEControlNo.Text = immigration[RowIndex].LOEControlNumber;
                txtExpiration.Text   = immigration[RowIndex].PassportExpiredate;
                txtDateOffBirth.Text = immigration[0].DateOfBirth == null ? "" : GlobalCode.Field2DateTime(immigration[0].DateOfBirth).ToString("MM/dd/yyyy");

                txtOtherComment.Text        = immigration[RowIndex].OtherDetail;
                uoHiddenFieldOldOther.Value = txtOtherComment.Text;
                txtEmailAdd.Text            = immigration[RowIndex].EmailAdd;

                //txtBrand.Text = immigration[0].Brand;
                //txtJoindate.Text = immigration[0].SignOnDate.ToString();
                //txtJoinShip.Text = immigration[0].Vessel;
                //txtJoinPort.Text = immigration[0].Seaport;
                //txtJoinCity.Text = immigration[0].Seaport;
                //txtPosition.Text = immigration[0].Rank;
                //txtPosition.Text = immigration[0].Rank;

                if (txtLOEControlNo.Text == "")
                {
                    txtLOEControlNo.BackColor = System.Drawing.Color.Red;
                    txtLOEControlNo.ToolTip   = "No LOE Available";

                    immigration[0].SignOnDate = null;
                    immigration[0].DateHired  = null;
                }
                else
                {
                    txtLOEControlNo.BackColor = System.Drawing.Color.White;
                    txtLOEControlNo.ToolTip   = immigration[RowIndex].LOEControlNumber;

                    //btnApproved.Enabled = true;
                    //btnDecline.Enabled = true;
                }

                uoListViewCrewverification.DataSource = immigration;
                uoListViewCrewverification.DataBind();

                rdbFraudulentDoc.Checked    = GlobalCode.Field2Bool(immigration[RowIndex].IsFraudulentDoc);
                rdbOther.Checked            = GlobalCode.Field2Bool(immigration[RowIndex].IsOther);
                rdbPriorConDep.Checked      = GlobalCode.Field2Bool(immigration[RowIndex].IsPriorConDep);
                rdbPriorIIssue.Checked      = GlobalCode.Field2Bool(immigration[RowIndex].IsPriorImmigIssues);
                chkNew.Checked              = GlobalCode.Field2Bool(immigration[RowIndex].NewHire);
                chkReHire.Checked           = GlobalCode.Field2Bool(immigration[RowIndex].NewHire) == true ? false : true;
                uoHDFCrewVericationID.Value = immigration[RowIndex].CrewVericationID.ToString();

                //uoHiddenFieldServerdate.Value = immigration[RowIndex].ProcessDate.ToString();

                if (immigration[RowIndex].CrewVericationID > 0)
                {
                    if (immigration[RowIndex].IsApproved == true)
                    {
                        uoHiddenFieldAppDecMessage.Value = "This immigration entry was approved by " + immigration[RowIndex].UserName + " on " + GlobalCode.Field2TimeZoneTime(GlobalCode.Field2DateTime(immigration[RowIndex].ProcessDate), uoHiddenFieldTimeZoneID.Value).ToString() + " are you sure you would like to ";

                        tblUCDate.Text = DateTime.Now.ToString("MM/dd/yyyy") + " [" + DateTime.Now.ToString("hh:mm tt") + "]" + "       Assignment Status : Approved   ";
                    }
                    else
                    {
                        uoHiddenFieldAppDecMessage.Value = "This immigration entry was declined by " + immigration[RowIndex].UserName + " on " + GlobalCode.Field2TimeZoneTime(GlobalCode.Field2DateTime(immigration[RowIndex].ProcessDate), uoHiddenFieldTimeZoneID.Value).ToString() + " are you sure you would like to ";
                        tblUCDate.Text = DateTime.Now.ToString("MM/dd/yyyy") + " [" + DateTime.Now.ToString("hh:mm tt") + "]" + "       Assignment Status : Declined   ";
                    }
                }
                else
                {
                    tblUCDate.Text = DateTime.Now.ToString("MM/dd/yyyy") + " [" + DateTime.Now.ToString("hh:mm tt") + "]";
                }

                //if (HiddenFieldIsImage.Value == "0")
                //{
                //    if (immigration[0].SeafarerImage.Count > 0)
                //    {
                //        uoImageCM.ImageUrl = GlobalCode.Field2PictureImage(immigration[0].SeafarerImage[0].Image, immigration[0].SeafarerImage[0].ImageType);
                //    }
                //    else {
                //        uoImageCM.ImageUrl = "~/Images/no-profile-image.jpg";
                //    }
                //}
                //else
                //{
                //    uoImageCM.ImageUrl = HiddenFieldCMImage.Value;
                //}

                string URL   = ConfigurationManager.AppSettings["MediaURL"];
                string Token = ConfigurationManager.AppSettings["MediaToken"];

                VehicleImageFile img = new VehicleImageFile();
                GlobalCode       k   = new GlobalCode();
                img = k.GetPhoto(URL + "/avatars/jde/" + txtUniqeID.Text.ToString() + "?at=" + Token);


                if (img.Image == null)
                {
                    if (GlobalCode.Field2Long(immigration[0].CtracDetail.user_id) > 0)
                    {
                        VehicleImageFile cimg = new VehicleImageFile();
                        cimg = k.GetPhoto(URL + "/avatars/ctrac/" + GlobalCode.Field2String(immigration[0].CtracDetail.user_id) + "?at=" + Token);
                        if (cimg.Image != null)
                        {
                            uoImageCM.ImageUrl = "data:image/*;base64," + cimg.Image;
                        }
                        else
                        {
                            if (immigration[0].SeafarerImage.Count > 0)
                            {
                                uoImageCM.ImageUrl = GlobalCode.Field2PictureImage(immigration[0].SeafarerImage[0].Image, immigration[0].SeafarerImage[0].ImageType);
                            }
                            else
                            {
                                uoImageCM.ImageUrl = "~/Images/no-profile-image.jpg";
                            }
                        }
                    }
                    else
                    {
                        if (immigration[0].SeafarerImage.Count > 0)
                        {
                            uoImageCM.ImageUrl = GlobalCode.Field2PictureImage(immigration[0].SeafarerImage[0].Image, immigration[0].SeafarerImage[0].ImageType);
                        }
                        else
                        {
                            uoImageCM.ImageUrl = "~/Images/no-profile-image.jpg";
                        }
                    }
                }
                else
                {
                    uoImageCM.ImageUrl = "data:image/*;base64," + img.Image;
                }

                if (immigration[0].ImmigrationAirTransaction.Count > 0)
                {
                    uoListviewAir.DataSource = immigration[0].ImmigrationAirTransaction;
                    uoListviewAir.DataBind();
                }
                else
                {
                    uoListviewAir.DataSource = null;
                    uoListviewAir.DataBind();
                }

                if (immigration[0].ImmigrationHotelBooking.Count > 0)
                {
                    uoListViewHotelBook.DataSource = immigration[0].ImmigrationHotelBooking;
                    uoListViewHotelBook.DataBind();
                }
                else
                {
                    uoListViewHotelBook.DataSource = null;
                    uoListViewHotelBook.DataBind();
                }

                if (immigration[0].ImmigrationTransportion.Count > 0)
                {
                    uoListViewTransportation.DataSource = immigration[0].ImmigrationTransportion;
                    uoListViewTransportation.DataBind();
                }
                else
                {
                    uoListViewTransportation.DataSource = null;
                    uoListViewTransportation.DataBind();
                }

                if (immigration[0].ImmigrationTransportion.Count > 0)
                {
                    uoListViewTransportation.DataSource = immigration[0].ImmigrationTransportion;
                    uoListViewTransportation.DataBind();
                }
                else
                {
                    uoListViewTransportation.DataSource = null;
                    uoListViewTransportation.DataBind();
                }


                if (immigration[0].ImmigrationEmploymentHistory.Count > 0)
                {
                    uoListViewRecentEmployment.DataSource = immigration[0].ImmigrationEmploymentHistory;
                    uoListViewRecentEmployment.DataBind();
                }
                else
                {
                    uoListViewRecentEmployment.DataSource = null;
                    uoListViewRecentEmployment.DataBind();
                }

                if (immigration[0].Parent.Count > 0)
                {
                    uoListViewParent.DataSource = immigration[0].Parent;
                    uoListViewParent.DataBind();
                }
                else
                {
                    uoListViewParent.DataSource = null;
                    uoListViewParent.DataBind();
                }
            }
            else
            {
                uoImageCM.ImageUrl = "~/Images/no-profile-image.jpg";
            }
        }
Exemplo n.º 20
0
        protected string DashboardAddGroup()
        {
            //Get the data field value of interest for this row
            //string GroupTextString = "Hotel Branch";
            string GroupValueString      = "HotelBranchName";
            string currentDataFieldValue = Eval(GroupValueString).ToString();

            //Specify name to display if dataFieldValue is a database NULL
            if (currentDataFieldValue.Length == 0 || currentDataFieldValue == null)
            {
                currentDataFieldValue = "";
            }
            //See if there's been a change in value
            if (lastDataFieldValue != currentDataFieldValue)
            {
                string sEditOverrideLink  = "";
                string sEditEmergencyLink = "";

                if (uoHiddenFieldRole.Value == TravelMartVariable.RoleAdministrator ||
                    uoHiddenFieldRole.Value == TravelMartVariable.RoleHotelSpecialist
                    )
                {
                    sEditEmergencyLink = "&nbsp&nbsp <a class= \"clsEmergency\" style=\"font-size:x-small\" href=\"HotelRoomEmergencyEdit2.aspx?bID=" + Eval("BranchId") + "&rID=1&dt=" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "\">Emergency Room</a>";
                    sEditOverrideLink  = sEditOverrideLink = "&nbsp&nbsp<a class=\"clsOverride\" style=\"font-size:x-small\" href=\"HotelRoomOverrideEdit2.aspx?bID=" + Eval("BranchId") + "&rID=1&dt=" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "\">Override Room</a>";

                    sEditOverrideLink += sEditEmergencyLink;
                }
                //There's been a change! Record the change and emit the table row
                lastDataFieldValue = currentDataFieldValue;
                string sURl = "HotelDashboard3.aspx?ufn=" + Request.QueryString["ufn"].ToString() + "&dt=" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "&branchId=" + Eval("BranchID") + "&brandId=" + Eval("BrandId") + "&branchName=" + Eval("HotelBranchName");

                //string sContract = "<td class=\"tdContract\"><a class=\"rightAligned\" title=\"View Contract\" href=\"#\" onclick='return OpenContract(\"" + Eval("BranchID") + "\",\"" + Eval("ContractId") + "\")'\"><img ID=\"uoImageContract\" src=\"Images/contract.jpg\" Width=\"20px\" alt=\"View Contract\" border=\"0\"/></a></td>";
                //string sNoContract = "<td class=\"tdContract\"><a class=\"rightAligned\" title=\"No Contract\"><img ID=\"uoImageContract\" src=\"Images/contract.jpg\" Width=\"20px\" alt=\"No Contract\" border=\"0\"/></a></td>";

                string sEvent = "";
                if (GlobalCode.Field2Bool(Eval("IsWithEvent")))
                {
                    //sEvent = "<td class=\"tdEvent\"><a class=\"rightAligned\" title=\"View Event(s)\" href=\"#\" OnClick=\"return OpenEventsList('" + Eval("BranchID") + "', '0', '" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "');\"><img ID=\"uoImageEvent\" src=\"Images/calendar1.png\" Width=\"20px\" alt=\"View Event(s)\" border=\"0\"/></a></td>";
                    sEvent = "<a id=\"uoEvent\" class=\"rightAligned\" title=\"View Event(s)\" href=\"#\" OnClick=\"return OpenEventsList('" + Eval("BranchID") + "', '0', '" + String.Format("{0:MM-dd-yyyy}", Eval("colDate")) + "');\"><img ID=\"uoImageEvent\" src=\"Images/calendar1.png\" Width=\"20px\" alt=\"View Event(s)\" border=\"0\"/></a>";
                }
                else
                {
                    //sEvent = "<td class=\"tdEvent\"><a class=\"rightAligned\" title=\"No Event(s)\"><img ID=\"uoImageEvent\" src=\"Images/calendar1.png\" Width=\"20px\" alt=\"No Event(s)\" border=\"0\"/></a></td>";
                    //sEvent = "<a id=\"uoEvent\" class=\"rightAligned\" title=\"No Event(s)\"><img ID=\"uoImageEvent\" src=\"Images/calendar1.png\" Width=\"20px\" alt=\"No Event(s)\" border=\"0\"/></a>";
                    sEvent = "";
                }

                string sContract = "<td class=\"tdEvent\"><a id=\"uoContract\" class=\"rightAligned\" title=\"View Contract\" href=\"#\" onclick='return OpenContract(\"" + Eval("BranchID") + "\",\"" + Eval("ContractId") + "\")'\"><img ID=\"uoImageContract\" src=\"Images/contract.jpg\" Width=\"20px\" alt=\"View Contract\" border=\"0\"/></a> " + sEvent + "</td>";
                //string sNoContract = "<td class=\"tdEvent\"><a id=\"uoContract\" class=\"rightAligned\" title=\"No Contract\"><img ID=\"uoImageContract\" src=\"Images/contract.jpg\" Width=\"20px\" alt=\"No Contract\" border=\"0\"/></a> " + sEvent + "</td>";
                string sNoContract = "<td class=\"tdEvent\">" + sEvent + "</td>";

                string sReturn;
                if (Eval("IsWithContract").ToString() == "True")
                {
                    sReturn = string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLink\"><a class=\"leftAligned\" href=\"" + sURl + "\">{0}<a/></strong>" + sEditOverrideLink + "</td>" + sContract + "</tr>", currentDataFieldValue);
                    //return string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLink\"><a class=\"leftAligned\" href=\"" + sURl + "\">{0}<a/></strong></td>" + sContract + "" + sEvent + "</tr>", currentDataFieldValue);
                }
                else
                {
                    sReturn = string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLinkExpired\" href=\"" + sURl + "\">{0}<a/></strong>" + sEditOverrideLink + "</td>" + sNoContract + "</tr>", currentDataFieldValue);
                    //sReturn = string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLinkExpired\"><a class=\"leftAligned\" href=\"" + sURl + "\">{0}<a/></strong>" + sEditOverrideLink + "</td>" + sNoContract + "</tr>", currentDataFieldValue);
                    //return string.Format("<tr><td class=\"group\" colspan=\"3\"><strong><a class=\"groupLink\"><a class=\"leftAligned\" href=\"" + sURl + "\">{0}<a/></strong></td>" + sNoContract + "" + sEvent + "</tr>", currentDataFieldValue);
                }
                return(sReturn);
            }
            else
            {
                //No change, return an empty string
                return(string.Empty);
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// Author:         Muhallidin G Wali
        /// Date Created:   01/oct/2014
        /// Description:    Get Excption Data to load in the page
        /// ---------------------------------------------------------------
        /// </summary>
        /// <returns></returns>
        public List <ExceptionPageData> GetExceptionPageData(short LoadType, string UserId
                                                             , DateTime Date, int RegionID, int PortID, int CountryID, string UserRole

                                                             )
        {
            DataSet ds = new DataSet();
            List <ExceptionPageData> ExceptionPageData = new List <ExceptionPageData>();
            DbCommand com = null;

            try
            {
                Database db = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase();
                com = db.GetStoredProcCommand("upsGetExceptionPageData");
                db.AddInParameter(com, "@pLoadType", DbType.Int16, LoadType);
                db.AddInParameter(com, "@pUserId", DbType.String, UserId);
                db.AddInParameter(com, "@pDate", DbType.DateTime, Date);
                db.AddInParameter(com, "@pRegionIDInt", DbType.Int32, RegionID);
                db.AddInParameter(com, "@pPortIDInt", DbType.Int32, PortID);
                db.AddInParameter(com, "@pCountryIdInt", DbType.Int32, CountryID);
                db.AddInParameter(com, "@pUserRolevarchar", DbType.String, UserRole);


                ds = db.ExecuteDataSet(com);

                ExceptionPageData.Add(new ExceptionPageData {
                    RegionList = (from a in ds.Tables[0].AsEnumerable()
                                  select new RegionList
                    {
                        RegionId = GlobalCode.Field2Int(a["colRegionIDInt"]),
                        RegionName = GlobalCode.Field2String(a["colRegionNameVarchar"])
                    }).ToList(),

                    PortList = (from a in ds.Tables[1].AsEnumerable()
                                select new PortList
                    {
                        PortId = GlobalCode.Field2Int(a["PORTID"]),
                        PortName = GlobalCode.Field2String(a["PORT"])
                    }).ToList(),

                    Hotels = (from a in ds.Tables[2].AsEnumerable()
                              select new Hotels
                    {
                        VendorId = GlobalCode.Field2Int(a["VendorId"]),
                        BranchId = GlobalCode.Field2Int(a["BranchId"]),
                        BranchName = GlobalCode.Field2String(a["BranchName"]),
                        CountryId = GlobalCode.Field2Int(a["CountryId"]),
                        CityId = GlobalCode.Field2Int(a["CityId"]),
                        isAccredited = GlobalCode.Field2Bool(a["isAccredited"]),
                        withEvent = GlobalCode.Field2Bool(a["withEvent"]),
                        withContract = GlobalCode.Field2Bool(a["withContract"]),
                        ContractId = GlobalCode.Field2Int(a["ContractId"]),
                        colDate = GlobalCode.Field2DateTime(a["colDate"])
                    }).ToList(),
                    ExceptionBooking = (from a in ds.Tables[3].AsEnumerable()
                                        select new ExceptionBooking
                    {
                        ExceptionIdBigInt = GlobalCode.Field2Int(a["ExceptionIdBigInt"]),
                        IdBigint = GlobalCode.Field2Int(a["IDBigint"]),
                        SeqNo = GlobalCode.Field2Int(a["SeqNo"]),

                        TravelReqId = GlobalCode.Field2Int(a["TravelReqId"]),
                        E1TravelReqId = GlobalCode.Field2Int(a["E1TravelReqId"]),
                        SeafarerId = GlobalCode.Field2Int(a["SeafarerId"]),
                        SeafarerName = GlobalCode.Field2String(a["SeafarerName"]),


                        PortId = GlobalCode.Field2Int(a["PortId"]),
                        PortName = GlobalCode.Field2String(a["PortName"]),
                        VesselName = GlobalCode.Field2String(a["VesselName"]),

                        SFStatus = GlobalCode.Field2String(a["SFStatus"]),
                        OnOffDate = GlobalCode.Field2DateTime(a["OnOffDate"]),



                        ArrivalDepartureDatetime = GlobalCode.Field2DateTime(a["ArrivalDepartureDatetime"]),


                        Carrier = GlobalCode.Field2String(a["Carrier"]),
                        FlightNo = GlobalCode.Field2String(a["FlightNo"]),

                        FromCity = GlobalCode.Field2String(a["FromCity"]),
                        ToCity = GlobalCode.Field2String(a["ToCity"]),
                        RankName = GlobalCode.Field2String(a["RankName"]),



                        Stripes = GlobalCode.Field2Decimal(a["Stripes"]),
                        RecordLocator = GlobalCode.Field2String(a["RecordLocator"]),
                        Gender = GlobalCode.Field2String(a["Gender"]),
                        Nationality = GlobalCode.Field2String(a["Nationality"]),
                        RoomTypeId = GlobalCode.Field2Int(a["RoomTypeId"]),
                        RoomType = GlobalCode.Field2String(a["RoomType"]),

                        ReasonCode = GlobalCode.Field2String(a["ReasonCode"]),
                        ExceptionRemarks = GlobalCode.Field2String(a["ExceptionRemarks"]),
                        Invalid = GlobalCode.Field2Bool(a["Invalid"]),


                        BookingRemarks = GlobalCode.Field2String(a["BookingRemarks"]),

                        HotelCity = GlobalCode.Field2String(a["HotelCity"]),
                        IsByPort = GlobalCode.Field2String(a["IsPort"]),

                        //Comments = GlobalCode.Field2String(a["VendorId"]),
                        //RemovedBy = GlobalCode.Field2String(a["VendorId"]),
                        //Birthday = GlobalCode.Field2DateTime(a["VendorId"]),
                    }).ToList()
                });


                return(ExceptionPageData);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (com != null)
                {
                    com.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
            }
        }
Exemplo n.º 22
0
        private List <CrewImmigration> ProcessCrewImmigration(DataSet ds)
        {
            List <CrewImmigration> immigration = new List <CrewImmigration>();

            try
            {
                string  user_id = "", jde_id = "";
                DataRow dr;
                if (ds.Tables[7].Rows.Count > 0)
                {
                    dr      = ds.Tables[7].Rows[0];
                    user_id = dr["user_id"].ToString();
                    jde_id  = dr["jde_id"].ToString();
                }

                immigration = (from a in ds.Tables[0].AsEnumerable()
                               select new CrewImmigration
                {
                    CrewVericationID = GlobalCode.Field2Long(a["colCrewVericationIDBigint"]),
                    SeaparerID = GlobalCode.Field2Long(a["IDNumber"]),
                    FirstName = GlobalCode.Field2String(a["FirstName"]),
                    LastName = GlobalCode.Field2String(a["LastName"]),
                    LOEControlNumber = GlobalCode.Field2String(a["LOEControlNumber"]),
                    Nationality = GlobalCode.Field2String(a["NationalityName"]),
                    ContactNo = GlobalCode.Field2String(a["ContactNo"]),
                    EmailAdd = GlobalCode.Field2String(a["EmailAdd"]),
                    PassportNo = GlobalCode.Field2String(a["PassportNo"]),
                    PassportExpiredate = GlobalCode.Field2DateTimeNull(a["ExpirationDate"]) == null ? null : GlobalCode.Field2DateTime(a["ExpirationDate"]).ToString("MM/dd/yyyy"),
                    PassportIssuedate = GlobalCode.Field2String(a["IssueDate"]),
                    Vessel = GlobalCode.Field2String(a["Ship"]),
                    Brand = GlobalCode.Field2String(a["BrandName"]),
                    SignOnDate = GlobalCode.Field2DateTime(a["SignOnDateAdj"]),
                    Seaport = GlobalCode.Field2String(a["PortName"]),
                    Rank = GlobalCode.Field2String(a["PositionName"]),
                    NewHire = GlobalCode.Field2Bool(a["NewHire"]),
                    Joindate = GlobalCode.Field2DateTime(a["SignOnDateAdj"]),
                    JoinPort = GlobalCode.Field2String(a["SeaportCode"]),
                    JoinCity = GlobalCode.Field2String(a["AirportCode"]),
                    DateHired = GlobalCode.Field2DateTimeNull(a["DateHired"]),
                    Reason = GlobalCode.Field2Int(a["colReasonInt"]),
                    IsFraudulentDoc = GlobalCode.Field2Bool(a["colIsFraudulentDocBit"]),
                    IsPriorImmigIssues = GlobalCode.Field2Bool(a["colIsPriorImmigIssuesBit"]),
                    IsPriorConDep = GlobalCode.Field2Bool(a["colIsPriorConDepBit"]),
                    IsOther = GlobalCode.Field2Bool(a["colIsOtherBit"]),
                    OtherDetail = GlobalCode.Field2String(a["colOtherDetailVarchar"]),
                    IsApproved = GlobalCode.Field2Bool(a["colIsApprovedBit"]),
                    DateOfBirth = GlobalCode.Field2DateTimeNull(a["DateOfBirth"]),
                    UserName = GlobalCode.Field2String(a["UserName"]),
                    ProcessDate = GlobalCode.Field2DateTimeNull(a["ProcessDate"]),

                    ImmigrationAirTransaction = (from n in ds.Tables[1].AsEnumerable()
                                                 select new ImmigrationAirTransaction
                    {
                        SeqNo = GlobalCode.Field2Int(n["colSeqNoInt"]),
                        AirLine = GlobalCode.Field2String(n["AirlineName"]),
                        DepartureDateTime = GlobalCode.Field2DateTime(n["DepartureDateTime"]),
                        ArrivalDateTime = GlobalCode.Field2DateTime(n["ArrivalDateTime"]),
                        DepartureAirportLocationCode = GlobalCode.Field2String(n["DepartureAirportCode"]),
                        ArrivalAirportLocationCode = GlobalCode.Field2String(n["ArrivalAirportCode"]),
                    }).ToList(),


                    ImmigrationHotelBooking = (from i in ds.Tables[2].AsEnumerable()
                                               select new ImmigrationHotelBooking
                    {
                        BranchName = GlobalCode.Field2String(i["BranchName"]),
                        TimeSpanStartDate = GlobalCode.Field2DateTime(i["CheckInDate"]),
                        TimeSpanStartTime = GlobalCode.Field2DateTime(i["CheckInTime"]),
                        TimeSpanEndDate = GlobalCode.Field2DateTime(i["CheckOutDate"]),
                        TimeSpanEndTime = GlobalCode.Field2DateTime(i["CheckOutTime"]),
                        TimeSpanDurationInt = GlobalCode.Field2Int(i["TimeSpanDuration"]),
                        RoomType = GlobalCode.Field2String(i["RoomType"]),
                        ForeColor = GlobalCode.Field2String(i["coldForeColorVarchar"]),
                        ColorCode = GlobalCode.Field2String(i["colColorCodevarchar"]),
                    }).ToList(),

                    ImmigrationTransportion = (from e in ds.Tables[3].AsEnumerable()
                                               select new ImmigrationTransportion
                    {
                        VehicleVendorName = GlobalCode.Field2String(e["Transportation"]),
                        RouteFrom = GlobalCode.Field2String(e["RouteFrom"]),
                        RouteTo = GlobalCode.Field2String(e["RouteTo"]),
                        PickUpDate = GlobalCode.Field2DateTime(e["colPickUpDate"]),
                        PickUpTime = GlobalCode.Field2DateTime(e["colPickUpTime"]),
                        ForeColor = GlobalCode.Field2String(e["coldForeColorVarchar"]),
                        ColorCode = GlobalCode.Field2String(e["colColorCodevarchar"]),
                    }).ToList(),

                    ImmigrationEmploymentHistory = (from b in ds.Tables[4].AsEnumerable()
                                                    select new ImmigrationEmploymentHistory
                    {
                        CrewVericationID = GlobalCode.Field2Long(b["colCrewVericationIDBigint"]),
                        SeaparerID = GlobalCode.Field2Long(b["IDNumber"]),
                        FirstName = GlobalCode.Field2String(b["FirstName"]),
                        LastName = GlobalCode.Field2String(b["LastName"]),
                        LOEControlNumber = GlobalCode.Field2String(b["LOEControlNumber"]),
                        Nationality = GlobalCode.Field2String(b["NationalityName"]),
                        ContactNo = GlobalCode.Field2String(b["ContactNo"]),
                        EmailAdd = GlobalCode.Field2String(b["EmailAdd"]),
                        PassportNo = GlobalCode.Field2String(b["PassportNo"]),
                        PassportExpiredate = GlobalCode.Field2DateTime(b["ExpirationDate"]).ToString("MM/dd/yyyy"),
                        PassportIssuedate = GlobalCode.Field2String(b["IssueDate"]),
                        Vessel = GlobalCode.Field2String(b["Ship"]),
                        Brand = GlobalCode.Field2String(b["BrandName"]),
                        SignOnDate = GlobalCode.Field2DateTime(b["SignOnDate"]),
                        Seaport = GlobalCode.Field2String(b["PortName"]),
                        NewHire = GlobalCode.Field2Bool(b["NewHire"]),
                        Joindate = GlobalCode.Field2DateTime(b["SignOnDate"]),
                        JoinPort = GlobalCode.Field2String(b["SeaportCode"]),
                        JoinCity = GlobalCode.Field2String(b["AirportCode"]),
                        DateHired = GlobalCode.Field2DateTime(b["DateHired"]),
                        Reason = GlobalCode.Field2Int(b["colReasonInt"]),
                        IsFraudulentDoc = GlobalCode.Field2Bool(b["colIsFraudulentDocBit"]),
                        IsPriorImmigIssues = GlobalCode.Field2Bool(b["colIsPriorImmigIssuesBit"]),
                        IsPriorConDep = GlobalCode.Field2Bool(b["colIsPriorConDepBit"]),
                        IsOther = GlobalCode.Field2Bool(b["colIsOtherBit"]),
                        OtherDetail = GlobalCode.Field2String(b["colOtherDetailVarchar"]),
                        IsApproved = GlobalCode.Field2Bool(b["colIsApprovedBit"]),
                        DateOfBirth = GlobalCode.Field2DateTime(b["DateOfBirth"]),
                        ShipID = GlobalCode.Field2Int(b["ShipID"]),
                        Ship = GlobalCode.Field2String(b["Ship"]),
                        RankID = GlobalCode.Field2Int(b["RankID"]),
                        Rank = GlobalCode.Field2String(b["PositionName"]),
                        ColorCode = GlobalCode.Field2String(b["ColorCode"]),
                        ForeColor = GlobalCode.Field2String(b["ForeColor"]),
                    }).ToList(),

                    SeafarerImage = (from k in ds.Tables[5].AsEnumerable()
                                     where GlobalCode.Field2Long(k["SeafarerID"]) == GlobalCode.Field2Long(a["IDNumber"])
                                     select new SeafarerImage
                    {
                        SeaparerID = GlobalCode.Field2Int(k["SeafarerID"]),
                        Image = GlobalCode.Field2PictureByte(k["PictureImage"]),
                        ImageType = GlobalCode.Field2String(k["PictureType"]),
                    }).ToList(),

                    Parent = (from p in ds.Tables[6].AsEnumerable()
                              select new EmployeeParent
                    {
                        EmployeeID = GlobalCode.Field2Long(p["EmployeeID"]),
                        FatherName = GlobalCode.Field2String(p["FatherName"]),
                        MotherName = GlobalCode.Field2String(p["MotherName"]),
                    }).ToList(),

                    CtracDetail = new CtracDetail {
                        user_id = user_id, jde_id = jde_id
                    }
                }).ToList();
            }
            catch (Exception ex) {
                throw ex;
            }

            return(immigration);
        }
Exemplo n.º 23
0
        /// <summary>
        /// ===============================================================
        /// Modified By:    Josephine Gad
        /// Date Created:   17/Mar/2013
        /// Description:    Change List to Void
        ///                 Assign Session values here
        /// ===============================================================
        /// </summary>
        public static void GetNonTurnPortNotInTM(DateTime Date, string UserId, string PortCode, string OrderBy)
        {
            Database  db          = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase();
            DbCommand dbCommand   = null;
            DataSet   ds          = null;
            DataTable dtNew       = null;
            DataTable dtConfirmed = null;
            DataTable dtCancelled = null;
            DataTable dtEmail     = null;

            try
            {
                List <NonTurnPortsList> NonTurnPortsList = new List <NonTurnPortsList>();
                HttpContext.Current.Session["PortNotExistExceptionList"] = NonTurnPortsList;

                dbCommand = db.GetStoredProcCommand("uspGetNonTurnPortsNoInTM");
                db.AddInParameter(dbCommand, "@pDate", DbType.Date, Date);
                db.AddInParameter(dbCommand, "@pUserId", DbType.String, UserId);
                db.AddInParameter(dbCommand, "@pPortCode", DbType.String, PortCode);
                db.AddInParameter(dbCommand, "@pOrderby", DbType.String, OrderBy);

                ds = db.ExecuteDataSet(dbCommand);

                dtNew = ds.Tables[0];

                NonTurnPortsList = (from a in dtNew.AsEnumerable()
                                    select new NonTurnPortsList
                {
                    IDBigInt = GlobalCode.Field2Long(a["IDBigInt"]),
                    TravelReqID = GlobalCode.Field2Long(a["TravelReqID"]),
                    E1TravelReqID = GlobalCode.Field2Int(a["E1TravelReqID"]),
                    RoomTypeId = GlobalCode.Field2Int(a["RoomTypeId"]),
                    PortId = GlobalCode.Field2Int(a["PortId"]),
                    SFStatus = GlobalCode.Field2String(a["SFStatus"]),
                    HotelCity = GlobalCode.Field2String(a["HotelCity"]),
                    Checkin = GlobalCode.Field2String(a["Checkin"]),
                    CheckOut = GlobalCode.Field2String(a["CheckOut"]),
                    HotelNite = GlobalCode.Field2String(a["HotelNite"]),
                    LastName = GlobalCode.Field2String(a["colLastNameVarchar"]),
                    FirstName = GlobalCode.Field2String(a["colFirstNameVarchar"]),

                    Employee = GlobalCode.Field2Long(a["Employee"]),
                    Gender = GlobalCode.Field2String(a["Gender"]),
                    SingleDouble = GlobalCode.Field2String(a["SingleDouble"]),
                    Couple = GlobalCode.Field2String(a["Couple"]),
                    Title = GlobalCode.Field2String(a["Title"]),
                    Ship = GlobalCode.Field2String(a["Ship"]),
                    Costcenter = GlobalCode.Field2String(a["Costcenter"]),
                    Nationality = GlobalCode.Field2String(a["Natioality"]),
                    HotelRequest = GlobalCode.Field2String(a["HotelRequest"]),
                    RecLoc = GlobalCode.Field2String(a["RecLoc"]),
                    RecLocID = GlobalCode.Field2Long(a["RecLocID"]),
                    AirSequence = GlobalCode.Field2Int(a["AirSequence"]),
                    deptCity = GlobalCode.Field2String(a["DeptCity"]),
                    ArvlCity = GlobalCode.Field2String(a["ArvlCity"]),
                    Arvldate = GlobalCode.Field2String(a["ArrvlDate"]),
                    ArvlTime = GlobalCode.Field2String(a["ArrvlTime"]),
                    Carrier = GlobalCode.Field2String(a["Carrier"]),
                    FlightNo = GlobalCode.Field2String(a["FlightNo"]),
                    Voucher = GlobalCode.Field2String(a["Voucher"]),
                    PassportNo = GlobalCode.Field2String(a["PassportNo"]),
                    PassportExp = GlobalCode.Field2String(a["PassportExp"]),
                    PassportIssued = GlobalCode.Field2String(a["PassportIssued"]),
                    HotelBranch = GlobalCode.Field2String(a["HotelBranch"]),
                    Booking = GlobalCode.Field2String(a["Booking"]),
                    Bookingremark = GlobalCode.Field2String(a["Bookingremark"]),
                    IsVisible = GlobalCode.Field2Bool(a["IsVisible"]),
                    stripes = GlobalCode.Field2Decimal(a["colStripesDecimal"]),
                    GroupNo = GlobalCode.Field2TinyInt(a["GroupNo"]),
                    PortName = GlobalCode.Field2String(a["PortName"]),
                }).ToList();

                HttpContext.Current.Session["PortNotExistExceptionList"] = NonTurnPortsList;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dbCommand != null)
                {
                    dbCommand.Dispose();
                }
                if (dtNew != null)
                {
                    dtNew.Dispose();
                }
                if (dtConfirmed != null)
                {
                    dtConfirmed.Dispose();
                }
                if (dtCancelled != null)
                {
                    dtCancelled.Dispose();
                }
                if (dtEmail != null)
                {
                    dtEmail.Dispose();
                }
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// Date Created:   25/June/2015
        /// Created By:     Josephine Monteza
        /// (description)   Get Crew Assist Remarks
        /// ---------------------------------------
        /// </summary>
        public static List <CrewAssistRemarksList> GetCrewAssistRemarks(Int32 iYear,
                                                                        Int32 iMonth, string sCreatedBy, string sUserID, Int16 iLoadType,
                                                                        Int16 iFilterBy, string sFilterValue,
                                                                        string sOrderBy, short IR, int iStartRow, int iMaxRow)
        {
            Database  db   = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase()
            DbCommand comm = null;
            DataSet   ds   = null;
            DataTable dt   = null;
            int       iRow = 0;

            List <CrewAssistRemarksList> list = new List <CrewAssistRemarksList>();

            try
            {
                comm = db.GetStoredProcCommand("uspGetCrewAssistRemarks");
                db.AddInParameter(comm, "@pYear", DbType.Int32, iYear);
                db.AddInParameter(comm, "@pMonth", DbType.Int32, iMonth);

                db.AddInParameter(comm, "@pCreatedBy", DbType.String, sCreatedBy);
                db.AddInParameter(comm, "@pUserID", DbType.String, sUserID);
                db.AddInParameter(comm, "@pLoadType", DbType.Int16, iLoadType);

                db.AddInParameter(comm, "@pFilterBy", DbType.Int16, iFilterBy);
                db.AddInParameter(comm, "@pFilterValue", DbType.String, sFilterValue);

                db.AddInParameter(comm, "@pOrderBy", DbType.String, sOrderBy);
                db.AddInParameter(comm, "@pStartRow", DbType.Int32, iStartRow);
                db.AddInParameter(comm, "@pMaxRow", DbType.Int32, iMaxRow);
                db.AddInParameter(comm, "@pIncidentReport", DbType.Int16, IR);

                ds = db.ExecuteDataSet(comm);
                if (ds.Tables.Count > 0)
                {
                    iRow = GlobalCode.Field2Int(ds.Tables[0].Rows[0][0]);
                    dt   = ds.Tables[1];

                    list = (from a in dt.AsEnumerable()
                            select new CrewAssistRemarksList
                    {
                        TravelRequestID = GlobalCode.Field2Long(a["colTravelReqIdInt"]),
                        SeafarerID = GlobalCode.Field2Long(a["colSeafarerIDBigint"]),
                        Source = a.Field <string>("RequestSource"),
                        RequestHeader = a.Field <string>("RemarksTypeHeader"),
                        RequestType = a.Field <string>("RemarksType"),
                        Summary = a.Field <string>("Summary"),
                        Remarks = a.Field <string>("Remarks"),
                        RemarksStatus = a.Field <string>("RemarksStatus"),
                        Requestor = a.Field <string>("Requestor"),
                        CreatedDate = GlobalCode.Field2DateTime(a["colDateCreatedDateTime"]),
                        CreatedBy = a.Field <string>("colCreatedByVarchar"),
                        TransactionDate = a.Field <DateTime?>("colTransactionDate"),
                        TransactionTime = a.Field <TimeSpan?>("colTransactionTime"),
                        IR = GlobalCode.Field2Bool(a["IRBit"])
                    }).ToList();

                    HttpContext.Current.Session["CrewAssistRemarks_Count"] = iRow;
                }
                return(list);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (comm != null)
                {
                    comm.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
Exemplo n.º 25
0
        /// <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;
                }
            }
        }
Exemplo n.º 26
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();
                }
            }
        }
Exemplo n.º 27
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   09/02/2012
        /// Descrption:     send hotel dashboard queries (list and count) to list
        /// -----------------------------------------------------------------------
        /// Modfied by:     Charlene Remotigue
        /// Date Modified:  07/03/2012
        /// Description:    added the ff parameters:
        ///                 SingleAvailableContractRooms
        ///                 DoubleAvailableContractRooms
        ///                 SingleAvailableOverrideRooms
        ///                 DoubleAvailableOverrideRooms
        ///                 isAccredited
        /// -------------------------------------------------------------------------------------
        /// Modfied by:     Gabriel Oquialda
        /// Date Modified:  13/03/2012
        /// Description:    This is a modified 'LoadAllHotelDashboardTables' copy for new screens
        /// -------------------------------------------------------------------------------------
        /// Modfied by:     Josephine Gad
        /// Date Modified:  30/03/2012
        /// Description:    Add count for TR with Arrival/Departure same with On/Off Date
        /// -------------------------------------------------------------------------------------
        /// Modfied by:     Josephine Gad
        /// Date Modified:  22/05/2012
        /// Description:    Add Region List
        /// </summary>
        /// <param name="iRegionID"></param>
        /// <param name="iCountryID"></param>
        /// <param name="iCityID"></param>
        /// <param name="sUserName"></param>
        /// <param name="sRole"></param>
        /// <param name="iBranchID"></param>
        /// <param name="dFrom"></param>
        /// <param name="dTo"></param>
        /// <param name="sBranchName"></param>
        /// <param name="StartRow"></param>
        /// <param name="MaxRow"></param>
        /// <returns></returns>
        public List <HotelDashboardDTOGenericClass> LoadAllHotelDashboardTables2(Int16 iLoadType, Int32 iRegionID, Int32 iCountryID,
                                                                                 Int32 iCityID, Int32 iPortID, string sUserName, string sRole, Int32 iBranchID, DateTime dFrom, DateTime dTo,
                                                                                 string sBranchName, int StartRow, int MaxRow)
        {
            List <HotelDashboardDTOGenericClass> HotelDashboardTables = new List <HotelDashboardDTOGenericClass>();
            Database  db        = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = null;

            Int32 maxRows                    = 0;
            Int32 ExceptionCount             = 0;
            Int32 OverflowCount              = 0;
            Int32 NoTravelRequestCount       = 0;
            Int32 ArrDeptSameOnOffDateCount  = 0;
            Int32 NoHotelContract            = 0;
            Int32 RestrictedNationalityCount = 0;


            DataTable dtRegion = null;
            DataTable dt       = null;
            DataSet   ds       = null;

            try
            {
                dbCommand = db.GetStoredProcCommand("uspGetHotelDashboardRoomTypeFromSummary_PROTOTYPE2");
                db.AddInParameter(dbCommand, "@pRegionID", DbType.Int32, iRegionID);
                db.AddInParameter(dbCommand, "@pCountryID", DbType.Int32, iCountryID);
                db.AddInParameter(dbCommand, "@pCityID", DbType.Int32, iCityID);
                db.AddInParameter(dbCommand, "@pPortID", DbType.Int32, iPortID);

                db.AddInParameter(dbCommand, "@pUserName", DbType.String, sUserName);
                db.AddInParameter(dbCommand, "@pRole", DbType.String, sRole);
                db.AddInParameter(dbCommand, "@pBranchID", DbType.Int32, iBranchID);

                db.AddInParameter(dbCommand, "@pFrom", DbType.DateTime, dFrom);
                db.AddInParameter(dbCommand, "@pTo", DbType.DateTime, dTo);

                db.AddInParameter(dbCommand, "@pBranchName", DbType.String, sBranchName);

                db.AddInParameter(dbCommand, "@pStartRow", DbType.Int32, StartRow);
                db.AddInParameter(dbCommand, "@pMaxRow", DbType.Int32, MaxRow);

                db.AddInParameter(dbCommand, "@pLoadType", DbType.Int16, iLoadType);

                dbCommand.CommandTimeout = 0;
                ds      = db.ExecuteDataSet(dbCommand);
                dt      = ds.Tables[1];
                maxRows = Int32.Parse(ds.Tables[0].Rows[0][0].ToString());
                if (iLoadType == 0 || iLoadType == 1)
                {
                    ExceptionCount             = Int32.Parse(ds.Tables[2].Rows[0][0].ToString());
                    OverflowCount              = Int32.Parse(ds.Tables[3].Rows[0][0].ToString());
                    NoTravelRequestCount       = Int32.Parse(ds.Tables[4].Rows[0][0].ToString());
                    ArrDeptSameOnOffDateCount  = Int32.Parse(ds.Tables[5].Rows[0][0].ToString());
                    RestrictedNationalityCount = Int32.Parse(ds.Tables[6].Rows[0][0].ToString());
                    NoHotelContract            = Int32.Parse(ds.Tables[7].Rows[0][0].ToString());
                }

                HotelDashboardTables.Add(new HotelDashboardDTOGenericClass()
                {
                    HotelDashboardList = (from a in dt.AsEnumerable()
                                          select new HotelDashboardList
                    {
                        RowNo = GlobalCode.Field2Int(a["RowNo"]),

                        CountryId = GlobalCode.Field2Int(a["colCountryIdInt"]),
                        CityIdInt = GlobalCode.Field2Int(a["colCityIdInt"]),

                        BranchID = GlobalCode.Field2Int(a["BranchID"]),
                        BrandID = GlobalCode.Field2Int(a["BrandID"]),

                        //RoomTypeID = GlobalCode.Field2TinyInt(a["RoomTypeID"]),
                        HotelBranchName = a["HotelBranchName"].ToString(),

                        colDate = GlobalCode.Field2DateTime(a["colDate"]),
                        colDateName = a["colDateName"].ToString(),

                        //RoomType = a["RoomType"].ToString(),
                        //ReservedCrew = GlobalCode.Field2Int(a["ReservedCrew"]),
                        //OverflowCrew = GlobalCode.Field2Int(a["OverflowCrew"]),
                        //TotalCrew = GlobalCode.Field2Int(a["TotalCrew"]),

                        ReservedRoom = GlobalCode.Field2Decimal(a["ReservedRoom"]),
                        //TotalRoomBlocks = GlobalCode.Field2Int(a["TotalRoomBlocks"]),

                        //AvailableRoomBlocks = GlobalCode.Field2Decimal(a["AvailableRoomBlocks"]),
                        //EmergencyRoomBlocks = GlobalCode.Field2Int(a["EmergencyRoomBlocks"]),
                        //AvailableEmergencyRoomBlocks = GlobalCode.Field2Decimal(a["AvailableEmergencyRoomBlocks"]),

                        TotalSingleAvailableRoom = GlobalCode.Field2Decimal(a["TotalSingleAvailableRooms"]),
                        TotalSingleRoomBlock = GlobalCode.Field2Decimal(a["TotalSingleBookings"]),
                        TotalDoubleRoomBlock = GlobalCode.Field2Decimal(a["TotalDoubleBookings"]),
                        TotalDoubleAvailableRoom = GlobalCode.Field2Decimal(a["TotalDoubleAvailableRooms"]),

                        IsWithEvent = GlobalCode.Field2Bool(a["IsWithEvent"]),
                        //IsAccredited = GlobalCode.Field2Bool(a["IsAccredited"]),
                        IsWithContract = GlobalCode.Field2Bool(a["IsWithContract"]),
                        //TotalSingleRoomBlock = GlobalCode.Field2Int(a["TotalSingleRoomBlock"]),
                        //TotalDoubleRoomBlock = GlobalCode.Field2Int(a["TotalDoubleRoomBlock"]),
                        //TotalSingleAvailableRoom = GlobalCode.Field2Int(a["TotalSingleAvailableRoom"]),
                        //TotalDoubleAvailableRoom = GlobalCode.Field2Decimal(a["TotalDoubleAvailableRoom"]),
                        //SingleAvailableContractRooms = GlobalCode.Field2Int(a["SingleAvailableContractRooms"]),
                        //DoubleAvailableContractRooms = GlobalCode.Field2Decimal(a["DoubleAvailableContractRooms"]),
                        //SingleAvailableOverrideRooms = GlobalCode.Field2Int(a["SingleAvailableOverrideRooms"]),
                        //DoubleAvailableOverrideRooms = GlobalCode.Field2Decimal(a["DoubleAvailableOverrideRooms"]),
                        ContractId = GlobalCode.Field2Int(a["ContractId"]),
                    }).ToList(),
                    HotelDashboardListCount    = maxRows,
                    HotelExceptionCount        = ExceptionCount,
                    HotelOverflowCount         = OverflowCount,
                    NoTravelRequestCount       = NoTravelRequestCount,
                    ArrDeptSameOnOffDateCount  = ArrDeptSameOnOffDateCount,
                    NoContractCount            = NoHotelContract,
                    RestrictedNationalityCount = RestrictedNationalityCount,
                });
                if (iLoadType == 0)
                {
                    dtRegion = ds.Tables[9];
                    HotelDashboardTables.Add(new HotelDashboardDTOGenericClass()
                    {
                        RegionList = (from a in dtRegion.AsEnumerable()
                                      select new RegionList
                        {
                            RegionId = GlobalCode.Field2Int(a["colRegionIDInt"]),
                            RegionName = a["colRegionNameVarchar"].ToString()
                        }
                                      ).ToList()
                    });

                    TMSettings.E1CHLastProcessedDate = GlobalCode.Field2DateTime(ds.Tables[10].Rows[0][0].ToString());
                }

                return(HotelDashboardTables);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dbCommand != null)
                {
                    dbCommand.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (dtRegion != null)
                {
                    dtRegion.Dispose();
                }
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   09/02/2012
        /// Descrption:     send hotel dashboard queries (list and count) to list
        /// </summary>
        /// <param name="iRegionID"></param>
        /// <param name="iCountryID"></param>
        /// <param name="iCityID"></param>
        /// <param name="sUserName"></param>
        /// <param name="sRole"></param>
        /// <param name="iBranchID"></param>
        /// <param name="dFrom"></param>
        /// <param name="dTo"></param>
        /// <param name="sBranchName"></param>
        /// <param name="StartRow"></param>
        /// <param name="MaxRow"></param>
        /// <returns></returns>
        public List <HotelDashboardDTOGenericClass> LoadAllHotelDashboardTables(Int16 iLoadType, Int32 iRegionID, Int32 iCountryID,
                                                                                Int32 iCityID, Int32 iPortID, string sUserName, string sRole, Int32 iBranchID, DateTime dFrom, DateTime dTo,
                                                                                string sBranchName, int StartRow, int MaxRow)
        {
            List <HotelDashboardDTOGenericClass> HotelDashboardTables = new List <HotelDashboardDTOGenericClass>();
            Database  db        = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = null;

            Int32 maxRows = 0;
            //Int32 ExceptionCount = 0;
            Int32 OverflowCount = 0;
            //Int32 NoTravelRequestCount = 0;
            Int32 ArrDeptSameOnOffDateCount = 0;

            DataTable dt         = null;
            DataTable dtOverflow = null;
            DataSet   ds         = null;
            DataTable dtExceptionNoTravelRequest = null;

            try
            {
                dbCommand = db.GetStoredProcCommand("uspGetHotelDashboardRoomTypeFromSummary");
                db.AddInParameter(dbCommand, "@pRegionID", DbType.Int32, iRegionID);
                db.AddInParameter(dbCommand, "@pCountryID", DbType.Int32, iCountryID);
                db.AddInParameter(dbCommand, "@pCityID", DbType.Int32, iCityID);
                db.AddInParameter(dbCommand, "@pPortID", DbType.Int32, iPortID);

                db.AddInParameter(dbCommand, "@pUserName", DbType.String, sUserName);
                db.AddInParameter(dbCommand, "@pRole", DbType.String, sRole);
                db.AddInParameter(dbCommand, "@pBranchID", DbType.Int32, iBranchID);

                db.AddInParameter(dbCommand, "@pFrom", DbType.DateTime, dFrom);
                db.AddInParameter(dbCommand, "@pTo", DbType.DateTime, dTo);

                db.AddInParameter(dbCommand, "@pBranchName", DbType.String, sBranchName);

                db.AddInParameter(dbCommand, "@pStartRow", DbType.Int32, StartRow);
                db.AddInParameter(dbCommand, "@pMaxRow", DbType.Int32, MaxRow);

                db.AddInParameter(dbCommand, "@pLoadType", DbType.Int16, iLoadType);

                ds      = db.ExecuteDataSet(dbCommand);
                dt      = ds.Tables[1];
                maxRows = Int32.Parse(ds.Tables[0].Rows[0][0].ToString());
                //if(iLoadType == 0)
                //{
                //ExceptionCount =  Int32.Parse(ds.Tables[2].Rows[0][0].ToString());
                //OverflowCount =  Int32.Parse(ds.Tables[2].Rows[0][0].ToString());
                //NoTravelRequestCount = Int32.Parse(ds.Tables[5].Rows[0][0].ToString());

                //dtOverflow = ds.Tables[3];
                //HotelDashboardClass.PendingBooking = (from c in dtOverflow.AsEnumerable()
                //                                      select new OverflowBooking
                //                                      {
                //                                          CoupleId = c.Field<int?>("colCoupleIdInt"),
                //                                          Gender = c.Field<string>("colGenderVarchar"),
                //                                          Nationality = c.Field<string>("colNationalityVarchar"),
                //                                          CostCenter = c.Field<string>("coLCostCenterVarchar"),
                //                                          CheckInDate = GlobalCode.Field2DateTime(c["colCheckInDateTime"]),
                //                                          CheckOutDate = GlobalCode.Field2DateTime(c["colCheckOutDatetime"]),

                //                                          TravelReqId = GlobalCode.Field2Int(c["colTravelRequestIdInt"]),
                //                                          SFStatus = c.Field<string>("colStatusVarchar"),
                //                                          Name = c.Field<string>("colNameVarchar"),
                //                                          SeafarerId = GlobalCode.Field2Int(c["colSeafarerIdInt"]),
                //                                          VesselName = c.Field<string>("colVesselNameVarchar"),
                //                                          RoomName = c.Field<string>("colRoomNameVarchar"),
                //                                          RankName = c.Field<string>("colRankNameVarchar"),
                //                                          CityId = GlobalCode.Field2Int(c["colCityIdInt"]),
                //                                          CountryId = GlobalCode.Field2Int(c["colCountryIdInt"]),
                //                                          HotelCity = c.Field<string>("colHotelCityVarchar"),
                //                                          HotelNites = GlobalCode.Field2Int(c["colHotelNitesInt"]),
                //                                          FromCity = c.Field<string>("colFromCityVarchar"),
                //                                          ToCity = c.Field<string>("colToCityVarchar"),
                //                                          RecordLocator = c.Field<string>("colRecordLocatorVarchar"),
                //                                          Carrier = c.Field<string>("colCarrierVarchar"),
                //                                          DepartureDate = GlobalCode.Field2DateTime(c["colDepartureDateTime"]),
                //                                          ArrivalDate = GlobalCode.Field2DateTime(c["colArrivalDatetime"]),
                //                                          FlightNo = c.Field<string>("colFlightNoVarchar"),
                //                                          OnOffDate = GlobalCode.Field2DateTime(c["colOnOffDate"]),
                //                                          Voucher = c["colVoucherMoney"].ToString(),
                //                                          ReasonCode = c.Field<string>("colReasonCodeVarchar"),
                //                                          Stripe = c.Field<decimal?>("colStripesDecimal"),
                //                                          VendorId = GlobalCode.Field2Int(c["colVendorIdInt"]),
                //                                          BranchId = GlobalCode.Field2Int(c["colBranchIdInt"]),
                //                                          RoomTypeId = GlobalCode.Field2Int(c["colRoomTypeIdInt"]),
                //                                          PortId = GlobalCode.Field2Int(c["colPortIdInt"]),
                //                                          VesselId = GlobalCode.Field2Int(c["colVesselIdInt"]),
                //                                          EnabledBit = GlobalCode.Field2Bool(c["isEnabled"]),
                //                                      }).ToList();
                //HotelDashboardClass.PendingBookingCount = OverflowCount;

                //dtExceptionNoTravelRequest = ds.Tables[4];
                //HotelDashboardDTO.HotelExceptionNoTravelRequestList = (from d in dtExceptionNoTravelRequest.AsEnumerable()
                //                                                       select new HotelExceptionNoTravelRequestList
                //                                                       {
                //                                                           colDate = GlobalCode.Field2DateTime(d["colDate"]),
                //                                                           ExceptionCount = GlobalCode.Field2Int(d["ExceptionCount"]),
                //                                                           NoTravelCount = GlobalCode.Field2Int(d["NoTravelCount"]),
                //                                                           ArrDeptSameOnOffDateCount = GlobalCode.Field2Int(d["ArrDepSameDateCount"])
                //                                                       }).ToList();
                //}

                HotelDashboardTables.Add(new HotelDashboardDTOGenericClass()
                {
                    HotelDashboardList = (from a in dt.AsEnumerable()
                                          select new HotelDashboardList
                    {
                        RowNo = GlobalCode.Field2Int(a["RowNo"]),

                        BranchID = GlobalCode.Field2Int(a["BranchID"]),
                        BrandID = GlobalCode.Field2Int(a["BrandID"]),

                        RoomTypeID = GlobalCode.Field2TinyInt(a["RoomTypeID"]),
                        HotelBranchName = a["HotelBranchName"].ToString(),

                        colDate = GlobalCode.Field2DateTime(a["colDate"]),
                        colDateName = a["colDateName"].ToString(),

                        RoomType = a["RoomType"].ToString(),
                        ReservedCrew = GlobalCode.Field2Int(a["ReservedCrew"]),
                        OverflowCrew = GlobalCode.Field2Int(a["OverflowCrew"]),
                        //TotalCrew = GlobalCode.Field2Int(a["TotalCrew"]),

                        //ReservedRoom = GlobalCode.Field2Decimal(a["ReservedRoom"]),
                        //TotalRoomBlocks = GlobalCode.Field2Int(a["TotalRoomBlocks"]),

                        AvailableRoomBlocks = GlobalCode.Field2Decimal(a["AvailableRoomBlocks"]),

                        //EmergencyRoomBlocks = GlobalCode.Field2Int(a["EmergencyRoomBlocks"]),
                        //AvailableEmergencyRoomBlocks = GlobalCode.Field2Decimal(a["AvailableEmergencyRoomBlocks"]),

                        IsWithEvent = GlobalCode.Field2Bool(a["IsWithEvent"]),
                        IsWithContract = GlobalCode.Field2Bool(a["IsWithContract"])
                    }).ToList(),
                    HotelDashboardListCount = maxRows,
                    //HotelExceptionNoTravelRequestList = (from d in dtExceptionNoTravelRequest.AsEnumerable()
                    //                                                       select new HotelExceptionNoTravelRequestList
                    //                                                       {
                    //                                                           colDate = GlobalCode.Field2DateTime(d["colDate"]),
                    //                                                           ExceptionCount = GlobalCode.Field2Int(d["ExceptionCount"]),
                    //                                                           NoTravelCount = GlobalCode.Field2Int(d["NoTravelCount"]),
                    //                                                           ArrDeptSameOnOffDateCount = GlobalCode.Field2Int(d["ArrDepSameDateCount"])
                    //                                                       }).ToList(),
                    //HotelOverflowCount = OverflowCount,
                    //HotelExceptionCount = ExceptionCount,
                    //NoTravelRequestCount = NoTravelRequestCount
                });

                if (iLoadType == 0)
                {
                    dtExceptionNoTravelRequest = ds.Tables[2];

                    HotelDashboardTables.Add(new HotelDashboardDTOGenericClass()
                    {
                        HotelExceptionNoTravelRequestList = (from d in dtExceptionNoTravelRequest.AsEnumerable()
                                                             select new HotelExceptionNoTravelRequestList
                        {
                            colDate = GlobalCode.Field2DateTime(d["colDate"]),
                            ExceptionCount = GlobalCode.Field2Int(d["ExceptionCount"]),
                            NoTravelCount = GlobalCode.Field2Int(d["NoTravelCount"]),
                            ArrDeptSameOnOffDateCount = GlobalCode.Field2Int(d["ArrDepSameDateCount"])
                        }).ToList(),
                    });
                }
                return(HotelDashboardTables);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dbCommand != null)
                {
                    dbCommand.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
                if (dt != null)
                {
                    dt.Dispose();
                }
                if (dtOverflow != null)
                {
                    dtOverflow.Dispose();
                }
            }
        }
Exemplo n.º 29
0
        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);
        }
Exemplo n.º 30
0
        public void LoadImmigrationPage(Int16 LoadType, DateTime FromDate, DateTime ToDate,
                                        string UserID, string Role, string OrderBy, int SeaportID, string FilterByName,
                                        string SeafarerID, string NationalityID, string Gender, string RankID, string Status,
                                        Int16 iAirLeg, Int16 iRouteFrom, Int16 iRouteTo, int StartRow, int MaxRow)
        {
            List <ImmigrationManifestList> listImmigration = new List <ImmigrationManifestList>();

            HttpContext.Current.Session["Immigration_Manifest"]      = listImmigration;
            HttpContext.Current.Session["Immigration_ManifestCount"] = 0;

            Database  db        = ConnectionSetting.GetConnection(); //  DatabaseFactory.CreateDatabase()
            DbCommand dbCommand = null;

            Int32     maxRows       = 0;
            DataTable dtImmigration = null;
            DataTable dtNationality = null;
            DataTable dtGender      = null;
            DataTable dtRank        = null;
            DataTable dtCount       = null;
            DataTable dtSeaport     = null;
            DataTable dtRoute       = null;

            DataSet ds = null;

            try
            {
                dbCommand = db.GetStoredProcCommand("uspSelectImmigrationPage");
                db.AddInParameter(dbCommand, "@pLoadType", DbType.Int16, LoadType);
                db.AddInParameter(dbCommand, "@pFromDate", DbType.DateTime, FromDate);
                db.AddInParameter(dbCommand, "@pToDate", DbType.DateTime, ToDate);
                db.AddInParameter(dbCommand, "@pUserID", DbType.String, UserID);
                db.AddInParameter(dbCommand, "@pRole", DbType.String, Role);
                db.AddInParameter(dbCommand, "@pOrderBy", DbType.String, OrderBy);
                db.AddInParameter(dbCommand, "@pStartRow", DbType.Int32, StartRow);
                db.AddInParameter(dbCommand, "@pMaxRow", DbType.Int32, MaxRow);
                db.AddInParameter(dbCommand, "@pSeaportID", DbType.Int32, SeaportID);
                db.AddInParameter(dbCommand, "@pFilterByName", DbType.Int16, GlobalCode.Field2TinyInt(FilterByName));
                db.AddInParameter(dbCommand, "@pSeafarerID", DbType.String, SeafarerID);
                db.AddInParameter(dbCommand, "@pNationalityID", DbType.Int32, GlobalCode.Field2Int(NationalityID));
                db.AddInParameter(dbCommand, "@pGender", DbType.Int32, GlobalCode.Field2Int(Gender));
                db.AddInParameter(dbCommand, "@pRankID", DbType.Int32, GlobalCode.Field2Int(RankID));
                db.AddInParameter(dbCommand, "@pStatus", DbType.String, Status);
                db.AddInParameter(dbCommand, "@pShowLegInt", DbType.Int16, iAirLeg);
                db.AddInParameter(dbCommand, "@pRouteIDFrom", DbType.Int16, iRouteFrom);
                db.AddInParameter(dbCommand, "@pRouteIDTo", DbType.Int16, iRouteTo);

                dbCommand.CommandTimeout = 60;
                ds = db.ExecuteDataSet(dbCommand);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    maxRows = Int32.Parse(ds.Tables[0].Rows[0][0].ToString());
                    HttpContext.Current.Session["Immigration_ManifestCount"] = maxRows;
                }
                dtImmigration = ds.Tables[1];

                //if (dtCrewAdmin.Rows.Count > 0)
                //{
                //    DataView dv = dtCrewAdmin.DefaultView;
                //    dv.Sort = OrderBy;
                //    dtCrewAdmin = dv.ToTable();
                //}

                //List<CrewAdminList> recordList = new List<CrewAdminList>();
                listImmigration = (from a in dtImmigration.AsEnumerable()
                                   select new ImmigrationManifestList
                {
                    //IsManual = GlobalCode.Field2Bool(a["IsManual"]),
                    IDBigInt = GlobalCode.Field2Int(a["IDBigInt"]),
                    E1TravelRequest = GlobalCode.Field2Int(a["E1TravelRequest"]),
                    RequestID = GlobalCode.Field2Int(a["RequestID"]),
                    TravelRequestID = GlobalCode.Field2Long(a["TravelRequestID"]),
                    RecLoc = GlobalCode.Field2String(a["RecLoc"]),
                    SeafarerID = GlobalCode.Field2Long(a["SeafarerID"]),
                    Name = GlobalCode.Field2String(a["Name"]),
                    DateOnOff = a.Field <DateTime>("DateOnOff"),

                    Status = GlobalCode.Field2String(a["Status"]),
                    Brand = GlobalCode.Field2String(a["Brand"]),
                    Vessel = GlobalCode.Field2String(a["Vessel"]),
                    //PortCode = GlobalCode.Field2String(a["PortCode"]),
                    Port = GlobalCode.Field2String(a["Port"]),
                    //RankCode = GlobalCode.Field2String(a["RankCode"]),
                    Rank = GlobalCode.Field2String(a["Rank"]),

                    ReasonCode = GlobalCode.Field2String(a["ReasonCode"]),
                    IsWithSail = GlobalCode.Field2Bool(a["IsWithSail"]),

                    Arrival = GlobalCode.Field2String(a["AirportArrival"]),
                    Departure = GlobalCode.Field2String(a["AirportDeparture"]),
                    ArrivalDateTime = a.Field <DateTime?>("colArrivalDateTime"),
                    DepartureDateTime = a.Field <DateTime?>("colDepartureDateTime"),
                    FlightNo = GlobalCode.Field2String(a["colFlightNoVarchar"]),
                    Airline = GlobalCode.Field2String(a["Airline"]),

                    Hotel = GlobalCode.Field2String(a["Hotel"]),
                    IsMeetGreet = GlobalCode.Field2Bool(a["IsMeetGreet"]),
                    IsPortAgent = GlobalCode.Field2Bool(a["IsPortAgent"]),
                    IsHotelVendor = GlobalCode.Field2Bool(a["IsHotelVendor"]),
                    Remarks = a.Field <string>("Remarks"),

                    PassportNo = GlobalCode.Field2String(a["PassportNo"]),
                    PassportIssued = GlobalCode.Field2String(a["PassportIssued"]),
                    PassportExp = GlobalCode.Field2String(a["PassportExp"]),

                    Checkin = a.Field <DateTime?>("CheckIn"),
                    Checkout = a.Field <DateTime?>("Checkout"),
                    SingleDouble = a.Field <string>("colSingleDoubleFloat"),
                    Gender = a.Field <string>("colGender"),
                    CostCenter = a.Field <string>("colCostCenter"),
                    Nationality = a.Field <string>("colNationality"),
                    MealAllowance = a.Field <string>("colMealAllowance"),
                    Duration = GlobalCode.Field2Int(a["Duration"]),
                    Lastname = a.Field <string>("Lastname"),
                    Firstname = a.Field <string>("Firstname"),
                    IsVisible = GlobalCode.Field2Bool(a["IsVisible"]),
                    SequenceNo = GlobalCode.Field2Int(a["SeqNo"]),
                    Birthday = a.Field <DateTime?>("colBirthday"),

                    TransVehicleID = GlobalCode.Field2Int(a["TransVehicleID"]),
                    IsCheckBoxForVehicleVisible = GlobalCode.Field2Bool(a["IsCheckBoxForVehicleVisible"]),
                    IsVisibleToVehicleVendor = GlobalCode.Field2Bool(a["IsVisibleToVehicleVendor"]),
                    IsNeedVehicleBooking = GlobalCode.Field2Bool(a["IsNeedVehicleBooking"]),
                    IsToPrintItinerary = GlobalCode.Field2Bool(a["IsToPrintItinerary"]),

                    RouteFrom = a.Field <string>("RouteFrom"),
                    RouteTo = a.Field <string>("RouteTo"),
                    PickupDatetime = a.Field <DateTime?>("PickupDateTime"),
                    VehicleName = a["colVehicleVendorNameVarchar"].ToString(),
                    Confirm = a["Confirm"].ToString(),
                    ConfirmBy = a["colConfirmedBy"].ToString(),
                    ConfirmDate = a["colConfirmedDate"].ToString(),
                }
                                   ).ToList();

                if (LoadType == 0)
                {
                    List <SeaportDTO>      listSeaport     = new List <SeaportDTO>();
                    List <NationalityList> listNationality = new List <NationalityList>();
                    List <GenderList>      listGender      = new List <GenderList>();
                    List <RankList>        listRank        = new List <RankList>();
                    List <VehicleRoute>    listRoute       = new List <VehicleRoute>();

                    int iOnCount  = 0;
                    int iOffCount = 0;

                    HttpContext.Current.Session["Immigration_Seaport"]     = listSeaport;
                    HttpContext.Current.Session["Immigration_Nationality"] = listNationality;
                    HttpContext.Current.Session["Immigration_Gender"]      = listGender;
                    HttpContext.Current.Session["Immigration_Rank"]        = listRank;
                    HttpContext.Current.Session["Immigration_Route"]       = listRoute;

                    HttpContext.Current.Session["Immigration_OnCount"]  = iOnCount;
                    HttpContext.Current.Session["Immigration_OffCount"] = iOffCount;



                    dtSeaport   = ds.Tables[2];
                    listSeaport = (from a in dtSeaport.AsEnumerable()
                                   select new SeaportDTO
                    {
                        SeaportIDString = GlobalCode.Field2String(a["colPortIdInt"]),
                        SeaportNameString = GlobalCode.Field2String(a["PortName"]),
                    }).ToList();
                    HttpContext.Current.Session["Immigration_Seaport"] = listSeaport;


                    dtNationality = ds.Tables[3];
                    dtGender      = ds.Tables[4];
                    dtRank        = ds.Tables[5];
                    dtCount       = ds.Tables[6];
                    dtRoute       = ds.Tables[7];


                    listNationality = (from a in dtNationality.AsEnumerable()
                                       select new NationalityList
                    {
                        NationalityID = GlobalCode.Field2Int(a["NationalityID"]),
                        Nationality = GlobalCode.Field2String(a["Nationality"])
                    }).ToList();

                    HttpContext.Current.Session["Immigration_Nationality"] = listNationality;

                    listGender = (from a in dtGender.AsEnumerable()
                                  select new GenderList
                    {
                        GenderID = GlobalCode.Field2Int(a["GenderID"]),
                        Gender = GlobalCode.Field2String(a["Gender"])
                    }).ToList();
                    HttpContext.Current.Session["Immigration_Gender"] = listGender;

                    listRank = (from a in dtRank.AsEnumerable()
                                select new RankList
                    {
                        RankID = GlobalCode.Field2Int(a["RankID"]),
                        Rank = GlobalCode.Field2String(a["Rank"])
                    }).ToList();
                    HttpContext.Current.Session["Immigration_Rank"] = listRank;



                    //int iOnCount = 0;
                    //int iOffCount = 0;

                    if (dtCount.Rows.Count > 0)
                    {
                        var StatusCount = (from a in dtCount.AsEnumerable()
                                           //where GlobalCode.Field2String(a["Status"]).Equals("On")
                                           select new
                        {
                            iCount = GlobalCode.Field2Int(a["StatusCount"]),
                            status = GlobalCode.Field2String(a["Status"])
                        }
                                           ).ToList();
                        if (StatusCount.Count > 0)
                        {
                            var on = (from a in StatusCount
                                      where a.status.ToUpper().Equals("ON")
                                      select new
                            {
                                iCount = a.iCount
                            }).ToList();
                            var off = (from a in StatusCount
                                       where a.status.ToUpper().Equals("OFF")
                                       select new
                            {
                                iCount = a.iCount
                            }).ToList();
                            if (on.Count > 0)
                            {
                                iOnCount = GlobalCode.Field2Int(on[0].iCount);
                            }
                            if (off.Count > 0)
                            {
                                iOffCount = GlobalCode.Field2Int(off[0].iCount);
                            }
                        }
                    }


                    HttpContext.Current.Session["Immigration_OnCount"]  = iOnCount;
                    HttpContext.Current.Session["Immigration_OffCount"] = iOffCount;

                    listRoute = (from a in dtRoute.AsEnumerable()
                                 select new VehicleRoute
                    {
                        RouteID = GlobalCode.Field2Int(a["colRouteIDInt"]),
                        RouteDesc = GlobalCode.Field2String(a["colRouteNameVarchar"]),
                    }).ToList();
                    HttpContext.Current.Session["Immigration_Route"] = listRoute;
                }
                else
                {
                    dtCount = ds.Tables[2];

                    int iOnCount  = 0;
                    int iOffCount = 0;

                    if (dtCount.Rows.Count > 0)
                    {
                        var StatusCount = (from a in dtCount.AsEnumerable()
                                           //where GlobalCode.Field2String(a["Status"]).Equals("On")
                                           select new
                        {
                            iCount = GlobalCode.Field2Int(a["StatusCount"]),
                            status = GlobalCode.Field2String(a["Status"])
                        }
                                           ).ToList();
                        if (StatusCount.Count > 0)
                        {
                            var on = (from a in StatusCount
                                      where a.status.ToUpper().Equals("ON")
                                      select new
                            {
                                iCount = a.iCount
                            }).ToList();
                            var off = (from a in StatusCount
                                       where a.status.ToUpper().Equals("OFF")
                                       select new
                            {
                                iCount = a.iCount
                            }).ToList();
                            if (on.Count > 0)
                            {
                                iOnCount = GlobalCode.Field2Int(on[0].iCount);
                            }
                            if (off.Count > 0)
                            {
                                iOffCount = GlobalCode.Field2Int(off[0].iCount);
                            }
                        }
                    }

                    //CrewAdminTables.Add(new CrewAdminGenericClass()
                    //{
                    //    CrewAdminList = recordList,
                    //    CrewAdminListCount = maxRows,
                    //    OnCount = iOnCount,
                    //    OffCount = iOffCount
                    //});

                    HttpContext.Current.Session["Immigration_OnCount"]  = iOnCount;
                    HttpContext.Current.Session["Immigration_OffCount"] = iOffCount;
                }

                HttpContext.Current.Session["Immigration_Manifest"] = listImmigration;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dbCommand != null)
                {
                    dbCommand.Dispose();
                }
                if (ds != null)
                {
                    ds.Dispose();
                }
                if (dtImmigration != null)
                {
                    dtImmigration.Dispose();
                }
                if (dtNationality != null)
                {
                    dtNationality.Dispose();
                }
                if (dtGender != null)
                {
                    dtGender.Dispose();
                }
                if (dtRank != null)
                {
                    dtRank.Dispose();
                }
                if (dtCount != null)
                {
                    dtCount.Dispose();
                }
                if (dtSeaport != null)
                {
                    dtSeaport.Dispose();
                }
                if (dtRoute != null)
                {
                    dtRoute.Dispose();
                }
            }
        }