示例#1
0
    protected void Bind_CrewEvaluationResults()
    {
        int CrewID = 0;

        if (Request.QueryString["CrewID"] != null)
        {
            CrewID = UDFLib.ConvertToInteger(Request.QueryString["CrewID"].ToString());
        }
        int Year = DateTime.Today.Year;

        DataTable dt = BLL_Crew_Evaluation.Get_CrewEvaluationResults(CrewID, Year);

        DataView dataView = new DataView(dt);

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

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

        Enable_Evaluation();
    }
示例#2
0
 protected void Load_EvaluatorRank(int CrewID)
 {
     try
     {
         GridView_Evaluation.DataSource = BLL_Crew_Evaluation.Get_Assigned_EvaluatorRank_ForCrew(UDFLib.ConvertToInteger(Request.QueryString["CrewID"]));
         GridView_Evaluation.DataBind();
     }
     catch (Exception ex)
     {
         UDFLib.WriteExceptionLog(ex);
     }
 }
    protected void Bind_Evaluations()
    {
        DataTable dt = BLL_Crew_Evaluation.Get_Evaluations(txtfilter.Text != "" ? txtfilter.Text : null);

        DataView dataView = new DataView(dt);

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

        GridView_Evaluation.DataSource = dataView;
        GridView_Evaluation.DataBind();
    }
示例#4
0
    protected void Bind_EvaluationSchedules()
    {
        if (hdnStartMonth.Value == "")
        {
            hdnStartMonth.Value = "-5";
        }

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

        int VesselID = UDFLib.ConvertToInteger(ddlVessel.SelectedValue);

        int Eva_Type = 0; // UDFLib.ConvertToInteger(ddlEvaluationType.SelectedValue);

        DataTable     dt      = objInsp.Get_InspectionScheduleByVessel(VesselID, StartMonth, Eva_Type, "");
        DataTable     dtCopy  = dt.Copy();
        List <string> lVessel = new List <string>();

        foreach (DataRow item in dt.Rows)
        {
            if (!lVessel.Contains(item["Vessel"].ToString()))
            {
                lVessel.Add(item["Vessel"].ToString());
            }
            else
            {
                DataRow lRemRow = dtCopy.Select("Id = " + item["ID"].ToString())[0];
                dtCopy.Rows.Remove(lRemRow);
            }
        }


        DataView dataView = new DataView(dtCopy);

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

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

        lblSelection.Text = DateTime.Today.AddMonths(StartMonth).ToString("MMM/yyyy") + " to " + DateTime.Today.AddMonths(StartMonth + 11).ToString("MMM/yyyy");

        //string js = "FindAndReplace('Overdue','Pending');";
        //ScriptManager.RegisterStartupScript(this, this.GetType(), "jsFindAndReplace", js, true);
    }
    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)));
    }
    protected void Load_CrewEvaluationResults(int CrewID)
    {
        int Year = DateTime.Today.Year;

        DataTable dt = BLL_Crew_Evaluation.Get_CrewEvaluationResults(CrewID, Year);

        DataView dataView = new DataView(dt);

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

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

        Enable_Evaluation();
    }