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)
 {
     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
     {
     }
 }