Exemple #1
0
    /// <summary>
    /// Description: Method to bind the grid based on search criteria
    /// </summary>
    protected void BindKPI()
    {
        string sStartDate = UDFLib.ConvertToDefaultDt(txtStartDate.Text);
        string sEndDate   = UDFLib.ConvertToDefaultDt(txtEndDate.Text);

        //string sStartDate = txtStartDate.Text;
        //string sEndDate = txtEndDate.Text;
        try
        {
            if (sStartDate != "" && sEndDate != "")
            {
                DateTime  Startdate = Convert.ToDateTime(UDFLib.ConvertToDefaultDt(txtStartDate.Text));
                DateTime  EndDate   = Convert.ToDateTime(UDFLib.ConvertToDefaultDt(txtEndDate.Text));
                DataTable dt        = objKPI.Get_NOx_Average((DataTable)Session["Vessel_Id"], Startdate, EndDate);
                ViewState["RecCount"] = dt.Rows.Count;

                rgdItems.DataSource = dt;
                rgdItems.DataBind();
                hdnVessel_IDs.Value = null;
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }