Ejemplo n.º 1
0
    protected void Bind_EvaluationSchedules()
    {
        if (hdnStartMonth.Value == "")
        {
            hdnStartMonth.Value = "-5";
        }

        int StartMonth = UDFLib.ConvertToInteger(hdnStartMonth.Value);

        int VesselID = UDFLib.ConvertToInteger(ddlVessel.SelectedValue);
        int RankID   = UDFLib.ConvertToInteger(ddlRank.SelectedValue);
        int Eva_Type = 0; // UDFLib.ConvertToInteger(ddlEvaluationType.SelectedValue);

        DataTable dt = BLL_Crew_Evaluation.Get_EvaluationScheduleByVessel(VesselID, RankID, StartMonth, Eva_Type, txtfilter.Text);

        DataView dataView = new DataView(dt);

        try
        {
            if (ViewState["sortExpression"] != null)
            {
                dataView.Sort = ViewState["sortExpression"].ToString();
            }
        }
        catch { }

        //GridView_Evaluation.DataSource = dataView;
        //GridView_Evaluation.DataBind();

        if (dataView.Count > 0)
        {
            tdNavigator.Visible            = true;
            GridView_Evaluation.DataSource = dataView;
            GridView_Evaluation.DataBind();
        }
        else
        {
            tdNavigator.Visible            = false;
            GridView_Evaluation.DataSource = null;
            GridView_Evaluation.DataBind();
        }
        // lblSelection.Text = DateTime.Today.AddMonths(StartMonth).ToString("MMM/yyyy") + " to " + DateTime.Today.AddMonths(StartMonth + 11).ToString("MMM/yyyy");
        lblSelection.Text = UDFLib.ConvertUserDateFormat(Convert.ToString(DateTime.Today.AddMonths(StartMonth))) + " to " + UDFLib.ConvertUserDateFormat(Convert.ToString(DateTime.Today.AddMonths(StartMonth + 11)));
    }