Ejemplo n.º 1
0
    protected void BindItems()
    {
        DateTime?sFromDate;
        DateTime?sToDate;

        if (ViewState["sFromDT"].ToString() == "")
        {
            sFromDate = null;
        }
        else
        {
            sFromDate = UDFLib.ConvertDateToNull(ViewState["sFromDT"]);
        }
        if (ViewState["sToDT"].ToString() == "")
        {
            sToDate = null;
        }
        else
        {
            sToDate = UDFLib.ConvertDateToNull(ViewState["sToDT"]);
        }

        int Record_count = 0;

        gvPortReport.DataSource = BLL_OPS_VoyageReports.Get_PortReportIndex(Convert.ToInt32(ViewState["iVesselID"]), sFromDate, sToDate, UDFLib.ConvertStringToNull(ViewState["Sort_Column"]), UDFLib.ConvertStringToNull(ViewState["Sort_Direction"]),
                                                                            UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CurrentPageIndex),
                                                                            UDFLib.ConvertIntegerToNull(ucCustomPagerItems.PageSize), ref Record_count);

        gvPortReport.DataBind();

        ucCustomPagerItems.CountTotalRec = Record_count.ToString();
        ucCustomPagerItems.BuildPager();
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["VesselId"] != null && Request.QueryString["PortInfoReportId"] != null && Request.QueryString["OfficeId"] != null)
        {
            _Vessel_Id        = int.Parse(Request.QueryString["VesselId"].ToString());
            _PortInfoReportId = int.Parse(Request.QueryString["PortInfoReportId"].ToString());
            _Office_Id        = int.Parse(Request.QueryString["OfficeId"].ToString());
            DataSet   ds     = BLL_OPS_VoyageReports.GET_MOOR_Attachment_List(_Vessel_Id, _PortInfoReportId, _Office_Id);
            DataRow[] imgrow = ds.Tables[0].Select("FileType = 'IMAGE'");

            if (imgrow.Length > 0)
            {
                imgMooringPlan.ImageUrl = "../Uploads/MOOR/" + imgrow[0]["File_Path"].ToString();
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                txtRemarks.Text = ds.Tables[0].Rows[0]["Remarks"].ToString();
            }
            int Vessel_Id    = 0;
            int Page_Type_Id = 3;
            int Report_Id    = 0;
            Vessel_Id = int.Parse(Request.QueryString["VesselId"].ToString());
            Report_Id = int.Parse(Request.QueryString["PortInfoReportId"].ToString());
            DataTable dt = BLL_OPS_VoyageReports.Get_PRT_Attachment(Page_Type_Id, Report_Id, Vessel_Id);
            dt.DefaultView.RowFilter = "MoorSide='L'";
            DataView dvLeft = dt.DefaultView;
            imgListLeft.DataSource = dvLeft;
            imgListLeft.DataBind();
            dt.DefaultView.RowFilter = "MoorSide='R'";
            DataView dvRight = dt.DefaultView;
            imgListRight.DataSource = dvRight;
            imgListRight.DataBind();
        }
    }
Ejemplo n.º 3
0
    public void BindVoyageNumber()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }


        DataTable dt = BLL_OPS_VoyageReports.BindVoyageNumber(txtfilter.Text != "" ? txtfilter.Text : null, sortbycoloumn, sortdirection
                                                              , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }


        if (dt.Rows.Count > 0)
        {
            grdVoyageId.DataSource = dt;
            grdVoyageId.DataBind();
        }
        else
        {
            grdVoyageId.DataSource = dt;
            grdVoyageId.DataBind();
        }
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["LastNoon"] != null)
                {
                    string    Vessel_Code = Request.QueryString["LastNoon"].ToString();
                    DataTable dt          = BLL_OPS_VoyageReports.Get_LatestNoonReport(Vessel_Code);

                    if (dt.Rows.Count > 0)
                    {
                        PKID = int.Parse(dt.Rows[0]["PKID"].ToString());
                    }
                }
                else
                {
                    PKID = UDFLib.ConvertToInteger(Request.QueryString["id"].ToString());
                    //string[] filters = Request.QueryString["filters"].Split('~');
                    //DataTable dtReports = BLL_OPS_VoyageReports.Get_VoyageReportIndex("N", Convert.ToInt32(filters[1]), Convert.ToInt32(filters[2]), filters[3], filters[4], Convert.ToInt32(filters[5]));
                    //dtReports.PrimaryKey = new DataColumn[] { dtReports.Columns["pkid"] };
                    //ctlRecordNavigationReport.InitRecords(dtReports);
                    //ctlRecordNavigationReport.CurrentIndex = dtReports.Rows.IndexOf(dtReports.Rows.Find(PKID));
                }
                dtCPROB = BLL_OPS_VoyageReports.OPS_Get_RecentCPROB();
                BindReport(null);
            }
        }
        catch
        {
        }
    }
Ejemplo n.º 5
0
    protected void BindItems()
    {
        string sFromDate = "";
        string sToDate   = "";

        if (ViewState["sFromDT"].ToString() == "")
        {
            sFromDate = "1900/01/01";
        }
        else
        {
            sFromDate = ViewState["sFromDT"].ToString();
        }
        if (ViewState["sToDT"].ToString() == "")
        {
            sToDate = "1900/01/01";
        }
        else
        {
            sToDate = ViewState["sToDT"].ToString();
        }

        int Record_count = 0;

        gvVoyageReport.DataSource = BLL_OPS_VoyageReports.Get_VoyageReportIndex(ViewState["sReportType"].ToString(), Convert.ToInt32(ViewState["iVesselID"]), Convert.ToInt32(ViewState["iLocationID"]), sFromDate, sToDate, Convert.ToInt32(ViewState["iFleetID"]),
                                                                                UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CurrentPageIndex),
                                                                                UDFLib.ConvertIntegerToNull(ucCustomPagerItems.PageSize), ref Record_count, UDFLib.ConvertStringToNull(ViewState["Sort_Column"]), UDFLib.ConvertStringToNull(ViewState["Sort_Direction"]));

        gvVoyageReport.DataBind();

        ucCustomPagerItems.CountTotalRec = Record_count.ToString();
        ucCustomPagerItems.BuildPager();
    }
Ejemplo n.º 6
0
 protected void btnsave_Click(object sender, EventArgs e)
 {
     try
     {
         BLL_OPS_VoyageReports.OPS_Ins_CPDtaType(txtDataType.Text.Trim(), txtDataCode.Text.Trim());
     }
     catch { }
 }
Ejemplo n.º 7
0
    protected void ImgVoyageDelete_Click(object sender, CommandEventArgs e)
    {
        int ID = Convert.ToInt32(e.CommandArgument.ToString());

        BLL_OPS_VoyageReports.Delete_VoyageNo(UDFLib.ConvertToInteger(Session["userid"].ToString()), ID);
        txtValue.Text = "";
        BindVoyageNumber();
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable            dtReports = BLL_OPS_VoyageReports.Get_Telegram_ToMail();
        WebClient            myClient  = new WebClient();
        BLL_Crew_CrewDetails objMail   = new BLL_Crew_CrewDetails();
        string MailHeader = "";

        foreach (DataRow dr in dtReports.Rows)
        {
            string       ReportPageHTML = null;
            byte[]       requestHTML;
            string       currentPageUrl = Request.Url.ToString();
            UTF8Encoding utf8           = new UTF8Encoding();
            MailHeader = dr["Vessel_Name"].ToString() + " / " + DateTime.Now.ToString("yy") + DateTime.Now.ToString("MM") + DateTime.Now.ToString("dd") + " / ";

            if (dr["Telegram_Type"].ToString().ToUpper() == "N")
            {
                currentPageUrl = "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/Operations/NoonReport.aspx?id=" + dr["PKID"].ToString();
                MailHeader    += "NOON";
            }
            else if (dr["Telegram_Type"].ToString().ToUpper() == "D")
            {
                currentPageUrl = "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/Operations/DepartureReport.aspx?id=" + dr["PKID"].ToString();
                MailHeader    += "DEPARTURE";
            }
            else if (dr["Telegram_Type"].ToString().ToUpper() == "A")
            {
                currentPageUrl = "http://" + HttpContext.Current.Request.Url.Host + HttpContext.Current.Request.ApplicationPath + "/Operations/ArrivalReport.aspx?id=" + dr["PKID"].ToString();
                MailHeader    += "ARRIVAL";
            }

            requestHTML    = myClient.DownloadData(currentPageUrl);
            ReportPageHTML = utf8.GetString(requestHTML);

            if (dr["Telegram_Type"].ToString().ToUpper() == "N")
            {
                #region Noon report
                ReportPageHTML = ReportPageHTML.Replace("class='leafTD-data-left'", "style='width: 140px; height: 20px; padding: 0px 0px 0px 2px;  background-color: #cce499;text-align: center;'");
                ReportPageHTML = ReportPageHTML.Replace("class='leafTD-data'", "style='width: 140px;     height: 20px;    padding: 0px 0px 0px 0px; background-color: #cce499;text-align: left;'");
                ReportPageHTML = ReportPageHTML.Replace("class='leafTD-header-midsec'", "style=' width: 170px;height: 20px;padding: 0px 0px 0px 0px;text-align: left;'");
                ReportPageHTML = ReportPageHTML.Replace("class='leafTD-header'", "style=' width: 120px; height: 20px; padding: 0px 0px 0px 0px;text-align: left;'");
                ReportPageHTML = ReportPageHTML.Replace("class='leafTD-data-midsec'", "style='width: 115px; height: 20px; padding: 0px 0px 0px 0px; background-color: #cce499;text-align: right;'");
                ReportPageHTML = ReportPageHTML.Replace("class='leafTD-data-consmp'", "style='width: 120px;height: 20px;padding: 0px 0px 0px 0px; background-color: #cce499;text-align: right;border-right: solid 1px white; white-space: normal; line-height: normal;letter-spacing: normal;'");
                ReportPageHTML = ReportPageHTML.Replace("class='leafTR'", "style=' border-bottom-style: solid;border-bottom-color: White;border-bottom-width: 1px;'");
                #endregion noon report
            }
            else
            {
                #region Departure Report
                ReportPageHTML = ReportPageHTML.Replace("class='leafTR'", "style='border-bottom-style: solid; border-bottom-color: White; border-bottom-width: 1px;'");
                ReportPageHTML = ReportPageHTML.Replace("class='leafTD-header'", "style='width: 80px;height: 10px; padding: 0px 0px 0px 10px;text-align: left;'");
                ReportPageHTML = ReportPageHTML.Replace("class='leafTD-data'", "style='width: 100px;height: 10px; padding: 0px 0px 0px 0px;background-color: #cce499;text-align: left;'");
                #endregion
            }
            string[] strArray = ReportPageHTML.Split(new string[] { "<div" }, StringSplitOptions.None);
            ReportPageHTML = "<div " + strArray[8] + "<div> <div " + strArray[9];
        }
    }
Ejemplo n.º 9
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         BLL_OPS_VoyageReports.OPS_SP_Ins_CPEntries(int.Parse(ddldatatypeCP.SelectedValue), int.Parse(ddlvesselCP.SelectedValue), GetSessionUserID(), decimal.Parse(txtdatavalue.Text.Trim()));
         BindCPEntries();
         string hidemodal = String.Format("hideModal('divadd')");
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
     }
     catch { }
 }
Ejemplo n.º 10
0
    public void BindCPEntries()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        //int CurrentSTS = 1;
        //if (rdoCPEntryFlag.SelectedValue == true) CurrentSTS = 1; else CurrentSTS = 0;
        if (rdoCPEntryFlag.SelectedItem.Value == "1")
        {
            CurrentSTS = 1;
        }

        else
        {
            CurrentSTS = 0;
        }

        //DataTable dt = BLL_OPS_VoyageReports.OPS_SP_Get_CPEntries(UDFLib.ConvertToInteger(ddlDatatype.SelectedValue), UDFLib.ConvertToInteger(ddlvessel.SelectedValue),
        //                                                            UDFLib.ConvertToInteger(ddlUser.SelectedValue), CurrentSTS, UDFLib.ConvertToInteger(DDLFleet.SelectedValue));

        //gvCPEntry.DataSource = dt;
        //gvCPEntry.DataBind();
        BLL_OPS_VoyageReports objTechService = new BLL_OPS_VoyageReports();
        DataTable             dtCpEntry      = new DataTable();
        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)

        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }

        dtCpEntry = objTechService.OPS_SP_Get_CPEntries(UDFLib.ConvertIntegerToNull(ddlDatatype.SelectedValue), UDFLib.ConvertIntegerToNull(ddlvessel.SelectedValue),
                                                        UDFLib.ConvertIntegerToNull(ddlUser.SelectedValue), CurrentSTS, UDFLib.ConvertIntegerToNull(DDLFleet.SelectedValue)
                                                        , sortbycoloumn, sortdirection
                                                        , ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }

        if (dtCpEntry.Rows.Count > 0)
        {
            gvCPEntry.DataSource = dtCpEntry;
            gvCPEntry.DataBind();
        }
        else
        {
            gvCPEntry.DataSource = dtCpEntry;
            gvCPEntry.DataBind();
        }
    }
Ejemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ReportDocument reportDocumentObj = new ReportDocument();

        reportDocumentObj.Load(Server.MapPath("~/operations/CR_VoyageReport.rpt"));

        DataTable dtreport = BLL_OPS_VoyageReports.Get_VoyageReport(Request.QueryString["REPORTTYPE"], Convert.ToInt32(Request.QueryString["VESSELID"]), Convert.ToInt32(Request.QueryString["LOCATIONCODE"]), Request.QueryString["FROMDT"], Request.QueryString["TODT"], Convert.ToInt32(Request.QueryString["FLEETID"]));

        reportDocumentObj.SetDataSource(dtreport);
        CrystalReportViewer.ReportSource     = reportDocumentObj;
        CrystalReportViewer.DisplayToolbar   = true;
        CrystalReportViewer.DisplayGroupTree = false;
    }
Ejemplo n.º 12
0
    public void BindReport(DataRow dr)
    {
        int BunkerReportId = dr != null?Convert.ToInt32(dr["BUNKER_REPORT_ID"]) : Convert.ToInt32(Request.QueryString["BunkerReportId"]);

        int VesselId = dr != null?Convert.ToInt32(dr["Vessel_Id"]) : Convert.ToInt32(Request.QueryString["VesselID"]);

        if (BunkerReportId != 0)
        {
            DataTable dtBunker = BLL_OPS_VoyageReports.Get_BunkerReport(BunkerReportId, VesselId);
            txtRemarks.Text     = Convert.ToString(dtBunker.Rows[0]["REMARKS"]);
            fvBunker.DataSource = dtBunker;
            fvBunker.DataBind();
        }
    }
Ejemplo n.º 13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (Request.QueryString["id"] != null)
         {
             dtCPROB = BLL_OPS_VoyageReports.OPS_Get_RecentCPROB();
             BindReport(null);
         }
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            UserAccessValidation();



            BindFleetDLL();
            DDLFleet.SelectedValue = Session["USERFLEETID"].ToString();
            BindVesselDDL();

            BLL_Infra_VesselLib objVessel = new BLL_Infra_VesselLib();
            ddllocation.DataSource     = objVessel.GetVesselLocations();
            ddllocation.DataTextField  = "location_name";
            ddllocation.DataValueField = "location_code";
            ddllocation.DataBind();
            ListItem allloc = new ListItem("SELECT ALL", "0");
            ddllocation.Items.Insert(0, allloc);
            if (Session["Vessel_ID"] != null)
            {
                ddlvessel.SelectedValue = Session["Vessel_ID"].ToString();
                ViewState["iVesselID"]  = ddlvessel.SelectedValue;
                Session["Vessel_ID"]    = null;
            }
            else
            {
                ViewState["iVesselID"] = ddlvessel.SelectedValue;
            }

            ViewState["sReportType"] = "NDA";

            ViewState["iLocationID"] = "0";
            ViewState["sFromDT"]     = DateTime.Now.AddDays(-5).ToString("dd/MM/yyyy");
            ViewState["sToDT"]       = DateTime.Now.ToString("dd/MM/yyyy");
            ViewState["iFleetID"]    = DDLFleet.SelectedValue;


            txtfrom.Text = DateTime.Now.AddDays(-5).ToString("dd/MM/yyyy");
            txtto.Text   = DateTime.Now.ToString("dd/MM/yyyy");

            dtCPROB     = BLL_OPS_VoyageReports.OPS_Get_RecentCPROB();
            dtVesselROB = BLL_OPS_VoyageReports.Get_VoyageReportIndex("NDA", 0, 0, "1800/01/01", "1900/01/01", 0);

            BindItems();
        }

        // Bind("NDA",0,0);
    }
Ejemplo n.º 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["PortInfoReportId"] != null)
         {
             UserAccessValidation();
             _Vessel_Id        = int.Parse(Request.QueryString["VesselId"].ToString());
             _PortInfoReportId = int.Parse(Request.QueryString["PortInfoReportId"].ToString());
             _Office_Id        = int.Parse(Request.QueryString["OfficeId"].ToString());
             DataSet ds = BLL_OPS_VoyageReports.Get_PortTerminalInfoReport(_Vessel_Id, _PortInfoReportId, _Office_Id);
             BindReport(ds);
         }
     }
 }
Ejemplo n.º 16
0
 public void BindVoyageId()
 {
     try
     {
         DataTable dt = new DataTable();
         int       id = 0;
         dt = BLL_OPS_VoyageReports.Get_VoyageNo(id);
         grdVoyageId.DataSource = dt;
         grdVoyageId.DataBind();
         //  updCat.Update();
     }
     catch (Exception)
     {
         throw;
     }
 }
Ejemplo n.º 17
0
    public string getLatestNoonReport(string vessel_code)
    {
        try
        {
            DataTable dt = BLL_OPS_VoyageReports.Get_LatestNoonReport(vessel_code);

            return(GetJsArray(dt));
        }
        catch
        {
            return("");
        }
        finally
        {
        }
    }
Ejemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["BunkerReportId"] != null)
            {
                string[]  filters   = Request.QueryString["filters"].Split('~');
                DataTable dtReports = BLL_OPS_VoyageReports.Get_BunkerReportIndex(Convert.ToInt32(filters[0]), Convert.ToInt32(filters[1]), filters[2], filters[3], Convert.ToInt32(filters[4]));
                dtReports.PrimaryKey = new DataColumn[] { dtReports.Columns["BUNKER_REPORT_ID"] };
                ctlRecordNavigationReport.InitRecords(dtReports);
                DataRow dr = dtReports.Rows.Find(Int32.Parse(Request.QueryString["BunkerReportId"]));
                ctlRecordNavigationReport.CurrentIndex = dtReports.Rows.IndexOf(dr);

                BindReport(dr);
            }
        }
    }
Ejemplo n.º 19
0
    protected void BindReport(DataRow dr)
    {
        PKID = dr != null?Convert.ToInt32(dr["pkid"]) : Convert.ToInt32(Request.QueryString["id"]);

        if (PKID != 0)
        {
            // = BLL_OPS_VoyageReports.Get_DailyNoonReport(PKID);

            DataTable dtNoon = BLL_OPS_VoyageReports.Get_DailyNoonReport(PKID);
            ViewState["dtVesselROB"] = dtNoon.Copy();
            lblVessel.Text           = Convert.ToString(dtNoon.Rows[0]["vesselname"]);
            hplcrewlist.NavigateUrl  = "~/crew/CrewList_Print.aspx?vcode=" + Convert.ToString(dtNoon.Rows[0]["Vessel_Short_Name"]);

            fvnoonreport.DataSource = dtNoon;
            fvnoonreport.DataBind();
            Page.Title = dtNoon.Rows[0]["Vessel_Short_Name"].ToString() + " / NOON / " + dtNoon.Rows[0]["Report_Date"].ToString();
        }
    }
Ejemplo n.º 20
0
    protected void onView(object source, CommandEventArgs e)
    {
        string[] cmdargs = e.CommandArgument.ToString().Split(',');

        int id        = int.Parse(cmdargs[0].ToString());
        int Vessel_Id = int.Parse(cmdargs[1].ToString());

        DataSet ds = BLL_OPS_VoyageReports.Get_PilotDetailInfo(id, Vessel_Id);

        lblPilotName.Text    = ds.Tables[0].Rows[0]["Remarks"].ToString();
        lblPilotremarks.Text = ds.Tables[0].Rows[0]["Pilot_Name"].ToString();

        dgPilotDetails.DataSource = ds.Tables[1];
        dgPilotDetails.DataBind();

        string msgdivResponseShow = string.Format("showModal('divPilotInfo',false);");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgdiv", msgdivResponseShow, true);
    }
Ejemplo n.º 21
0
    protected void BindReport(DataRow dr)
    {
        int PKID = dr != null?Convert.ToInt32(dr["pkid"]) : Convert.ToInt32(Request.QueryString["id"]);

        if (PKID != 0)
        {
            // ViewState["dtVesselROB"] = BLL_OPS_VoyageReports.Get_ArrivalReport(PKID);

            DataTable dtArrival = BLL_OPS_VoyageReports.Get_ArrivalReport(PKID);
            ViewState["dtVesselROB"]    = dtArrival.Copy();
            lblVessel.Text              = Convert.ToString(dtArrival.Rows[0]["vesselname"]);
            lbtncrwlist.CommandArgument = Convert.ToString(dtArrival.Rows[0]["Vessel_Short_Name"]);


            fvarrival.DataSource = dtArrival;
            fvarrival.DataBind();
            Page.Title = dtArrival.Rows[0]["Vessel_Short_Name"].ToString() + " / ARR / " + dtArrival.Rows[0]["Report_Date"].ToString();
        }
    }
Ejemplo n.º 22
0
    protected void btnViewAttachments_Click(object sender, EventArgs e)
    {
        int Vessel_Id    = 0;
        int Page_Type_Id = 3;
        int Report_Id    = 0;

        Vessel_Id = int.Parse(Request.QueryString["VesselId"].ToString());
        Report_Id = int.Parse(Request.QueryString["PortInfoReportId"].ToString());

        DataTable dt = BLL_OPS_VoyageReports.Get_PRT_Attachment(Page_Type_Id, Report_Id, Vessel_Id);

        //grdPTR_Attachment.DataSource = dt;
        //grdPTR_Attachment.DataBind();

        string msgViewAttachments = string.Format("showModal('divViewAttachments',false);");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msgViewAttachments", msgViewAttachments, true);
        UpdatePnl.Update();
    }
Ejemplo n.º 23
0
    protected void ExptoExcel_Click(object sender, ImageClickEventArgs e)
    {
        int       Record_count = 1;
        DataTable dt           = BLL_OPS_VoyageReports.Get_PortInfoReportIndex(
            UDFLib.ConvertToInteger(ddlvessel.SelectedValue),
            UDFLib.ConvertToInteger(DDLPortFilter.SelectedValue),
            UDFLib.ConvertToInteger(ddlCountry.SelectedValue),
            UDFLib.ConvertStringToNull(txtTerminal.Text),
            UDFLib.ConvertStringToNull(txtSearch.Text),
            UDFLib.ConvertStringToNull(ViewState["Sort_Column"]),
            UDFLib.ConvertStringToNull(ViewState["Sort_Direction"]),
            UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CurrentPageIndex),
            UDFLib.ConvertIntegerToNull(ucCustomPagerItems.PageSize), ref Record_count);

        string[] HeaderCaptions   = { "Port", "Country", "Terminal", "Berth", "Latitude", "Longitude", "Vessel", "Departure Date" };
        string[] DataColumnsNames = { "Port_Name", "Country_Name", "TerminalName", "Berth", "Latitude", "Longitude", "VesselName", "Departure_Date" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsNames, "PortInfoReport", "PortInfoReport", "");
    }
Ejemplo n.º 24
0
    protected void btnView_Click(object sender, ImageClickEventArgs e)
    {
        if (ViewState["sFromDT"].ToString() == "")
        {
            ViewState["sFromDT"] = "1900/01/01";
        }

        if (ViewState["sToDT"].ToString() == "")
        {
            ViewState["sToDT"] = "1900/01/01";
        }

        DataTable dt = BLL_OPS_VoyageReports.Get_BunkerReportIndex(Convert.ToInt32(ViewState["iVesselID"]), Convert.ToInt32(ViewState["iPortID"]), ViewState["sFromDT"].ToString(), ViewState["sToDT"].ToString(), Convert.ToInt32(ViewState["iFleetID"]));

        string[] HeaderCaptions   = { "Date", "Voyage", "Port", "Commenced Bunkering", "Completed Bunkering", "Quantity Bunkered", "Grade" };
        string[] DataColumnsNames = { "REPORT_DATE", "VOYAGE", "PORT_NAME", "COMMENCED_BUNKERING", "COMPLETED_BUNKERING", "QUANTITY_BUNKERED_Fuel_Oil", "QUANTITY_BUNKERED_Fuel_Oil_Type" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsNames, "BunkerReport", "BunkerReport", "");
    }
Ejemplo n.º 25
0
    protected void ImgEdit_Click(object sender, CommandEventArgs e)
    {
        int ID = Convert.ToInt32(e.CommandArgument.ToString());

        DataTable dt = new DataTable();

        dt = BLL_OPS_VoyageReports.Get_VoyageNo(ID);

        if (dt.Rows.Count > 0)
        {
            txtValue.Text = dt.Rows[0]["Voyage_Number"].ToString();
            // ddlColor.SelectedItem.Text = ds.Tables[0].Rows[0][3].ToString();
        }
        ViewState["Mode"]       = "EDIT";
        ViewState["ID"]         = ID;
        txtValue.Visible        = true;
        btnVoyageIdSave.Visible = true;
        tdV_No.Visible          = true;
        updCat.Update();
    }
Ejemplo n.º 26
0
    protected void btnView_Click(object sender, ImageClickEventArgs e)
    {
        //MemoryStream oStream;

        if (ViewState["sFromDT"].ToString() == "")
        {
            ViewState["sFromDT"] = "1900/01/01";
        }

        if (ViewState["sToDT"].ToString() == "")
        {
            ViewState["sToDT"] = "1900/01/01";
        }

        //ReportDocument reportDocumentObj = new ReportDocument();
        //reportDocumentObj.Load(Server.MapPath("~/operations/CR_VoyageReport.rpt"));

        DataTable       dtreport = BLL_OPS_VoyageReports.Get_VoyageReport(ViewState["sReportType"].ToString(), Convert.ToInt32(ViewState["iVesselID"].ToString()), Convert.ToInt32(ViewState["iLocationID"].ToString()), ViewState["sFromDT"].ToString(), ViewState["sToDT"].ToString(), Convert.ToInt32(ViewState["iFleetID"].ToString()));
        ExcelDataExport objexp   = new ExcelDataExport();

        objexp.WriteExcell(dtreport);

        //reportDocumentObj.SetDataSource(dtreport);

        //Response.Clear();

        //Response.Buffer = true;

        //oStream = (MemoryStream)reportDocumentObj.ExportToStream(ExportFormatType.Excel);

        //Response.ContentType = "application/vnd.ms-excel";

        //Response.BinaryWrite(oStream.ToArray());

        //Response.End();



        //ResponseHelper.Redirect("CR_VoyageReportView.aspx?REPORTTYPE=" + ViewState["sReportType"].ToString() + "&VESSELID=" + ViewState["iVesselID"].ToString() + "&LOCATIONCODE=" + ViewState["iLocationID"].ToString() + "&FROMDT=" + ViewState["sFromDT"].ToString() + "&TODT=" + ViewState["sToDT"].ToString() + "&FLEETID=" + ViewState["iFleetID"].ToString(), "blank", "");
        // GridViewExportUtil.Export("NADReport"+DateTime.Now.ToShortDateString()+".xls", gvVoyageReport);
    }
Ejemplo n.º 27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["VesselId"] != null && Request.QueryString["PortInfoReportId"] != null)
        {
            _Vessel_Id        = int.Parse(Request.QueryString["VesselId"].ToString());
            _PortInfoReportId = int.Parse(Request.QueryString["PortInfoReportId"].ToString());

            DataSet ds = BLL_OPS_VoyageReports.Get_PortInfoReport(_Vessel_Id, _PortInfoReportId);
            fvPortInfoReport.DataSource = ds.Tables[0];
            fvPortInfoReport.DataBind();


            DataSet ds1 = BLL_OPS_VoyageReports.Get_PilotInfo(_Vessel_Id, _PortInfoReportId);
            gvPilotInfo.DataSource = ds1.Tables[0];
            gvPilotInfo.DataBind();

            DataTable dt = BLL_OPS_VoyageReports.Get_PRT_Attachment(1, _PortInfoReportId, _Vessel_Id);
            imgListRight.DataSource = dt;
            imgListRight.DataBind();
        }
    }
Ejemplo n.º 28
0
    protected void BindItems()
    {
        int Record_count = 0;

        ViewState["Sort_Column"]    = "";
        ViewState["Sort_Direction"] = "";

        gvPortInfoReportIndex.DataSource = BLL_OPS_VoyageReports.Get_PortInfoReportIndex(
            UDFLib.ConvertToInteger(ddlvessel.SelectedValue),
            UDFLib.ConvertToInteger(DDLPortFilter.SelectedValue),
            UDFLib.ConvertToInteger(ddlCountry.SelectedValue),
            UDFLib.ConvertStringToNull(txtTerminal.Text),
            UDFLib.ConvertStringToNull(txtSearch.Text),
            UDFLib.ConvertStringToNull(ViewState["Sort_Column"]),
            UDFLib.ConvertStringToNull(ViewState["Sort_Direction"]),
            UDFLib.ConvertIntegerToNull(ucCustomPagerItems.CurrentPageIndex),
            UDFLib.ConvertIntegerToNull(ucCustomPagerItems.PageSize), ref Record_count);
        gvPortInfoReportIndex.DataBind();

        ucCustomPagerItems.CountTotalRec = Record_count.ToString();
        ucCustomPagerItems.BuildPager();
    }
Ejemplo n.º 29
0
    protected void BindReport(int PortReportId, int Vessel_Id)
    {
        DataSet   ds        = BLL_OPS_VoyageReports.GET_PORT_REPORT(PortReportId, Vessel_Id);
        DataTable dtport    = ds.Tables[0];
        string    strExpr   = "StoppageType = 1";
        DataView  dvNonRain = ds.Tables[1].DefaultView;

        dvNonRain.RowFilter = strExpr;


        string   strExpr2 = "StoppageType = 2";
        DataView dvRain   = ds.Tables[1].Copy().DefaultView;

        dvRain.RowFilter = strExpr2;

        Session["NonRainDt"] = dvNonRain.ToTable().DefaultView.ToTable();
        Session["RainDt"]    = dvRain.ToTable().DefaultView.ToTable();



        fvportreport.DataSource = dtport;
        fvportreport.DataBind();
    }
Ejemplo n.º 30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             if (Request.QueryString["id"] != null)
             {
                 BindReport(UDFLib.ConvertToInteger(Request.QueryString["id"]), UDFLib.ConvertToInteger(Request.QueryString["VesselId"]));
             }
             int       i  = 0;
             DataTable dt = BLL_OPS_VoyageReports.Get_PortReportIndex(UDFLib.ConvertToInteger(Request.QueryString["VesselId"]), null, null,
                                                                      UDFLib.ConvertStringToNull(ViewState["Sort_Column"]), UDFLib.ConvertStringToNull(ViewState["Sort_Direction"]), null, null, ref i);
             ctlRecordNavigationReport.InitRecords(dt);
             dt.PrimaryKey = new DataColumn[] { dt.Columns["PortReportId"] };
             DataRow dr = dt.Rows.Find(Int32.Parse(Request.QueryString["id"]));
             ctlRecordNavigationReport.CurrentIndex = dt.Rows.IndexOf(dr);
         }
     }
     catch
     {
     }
 }