Exemplo n.º 1
0
    protected void GridView_UnAssignedCriteria_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int ID         = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Grading_Type").ToString());
                int Grade_Type = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Grade_Type").ToString());

                CheckBoxList rdo = (CheckBoxList)e.Row.FindControl("chkOptions");
                DataTable    dt  = BLL_Crew_Evaluation.Get_GradingOptions(ID);


                rdo.DataSource = dt;
                rdo.DataBind();

                if (Grade_Type == 2)
                {
                    TextBox txtAnswer = new TextBox();
                    txtAnswer.Text    = "Subjective Type";
                    txtAnswer.Enabled = false;
                    e.Row.Cells[3].Controls.Add(txtAnswer);
                }
            }
        }
        catch
        {
        }
    }
Exemplo n.º 2
0
    protected void ddlGradingType_SelectedIndexChanged(object sender, EventArgs e)
    {
        int       Grade_ID = UDFLib.ConvertToInteger(ddlGradingType.SelectedValue);
        DataTable dt       = BLL_Crew_Evaluation.Get_GradingOptions(Grade_ID);

        rdoGradings.DataSource = dt;
        rdoGradings.DataBind();
    }
Exemplo n.º 3
0
    protected void GridView_Grading_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int ID = UDFLib.ConvertToInteger(GridView_Grading.DataKeys[e.Row.RowIndex].Value.ToString());

                RadioButtonList rdo = (RadioButtonList)e.Row.FindControl("rdoOptions");
                DataTable       dt  = BLL_Crew_Evaluation.Get_GradingOptions(ID);

                rdo.DataSource = dt;
                rdo.DataBind();
            }
        }
        catch
        {
        }
    }
Exemplo n.º 4
0
    protected void GridView_AssignedCriteria_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int ID         = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Grading_Type").ToString());
                int Grade_Type = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Grade_Type").ToString());

                CheckBoxList rdo = (CheckBoxList)e.Row.FindControl("chkOptions");
                DataTable    dt  = BLL_Crew_Evaluation.Get_GradingOptions(ID);

                rdo.DataSource = dt;
                rdo.DataBind();
                int       Evaluation_ID = UDFLib.ConvertToInteger(Request.QueryString["EID"].ToString());
                int       Criteria_ID   = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Criteria_ID").ToString());
                DataTable dtOptions     = BLL_Crew_Evaluation.Get_MandatoryGrades(Evaluation_ID, Criteria_ID);

                foreach (ListItem chki in rdo.Items)
                {
                    dtOptions.DefaultView.RowFilter = "OptionText= '" + chki.Text + "'";
                    if (dtOptions.DefaultView.Count > 0)
                    {
                        chki.Selected = true;
                    }
                }
                if (Grade_Type == 2)
                {
                    TextBox txtAnswer = new TextBox();
                    txtAnswer.Text    = "Subjective Type";
                    txtAnswer.Enabled = false;
                    e.Row.Cells[3].Controls.Add(txtAnswer);
                }
            }
        }
        catch
        {
        }
    }
Exemplo n.º 5
0
    protected void GridView_Criteria_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int ID         = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Grading_Type").ToString());
                int Grade_Type = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Grade_Type").ToString());

                RadioButtonList rdo = (RadioButtonList)e.Row.FindControl("rdoOptions");
                DataTable       dt  = BLL_Crew_Evaluation.Get_GradingOptions(ID);

                DropDownList ddlCategory_Name = (DropDownList)e.Row.FindControl("ddlCategory_Name");
                if (ddlCategory_Name != null)
                {
                    DataTable dtCat = BLL_Crew_Evaluation.Get_CategoryList("");
                    ddlCategory_Name.DataSource = dtCat;
                    ddlCategory_Name.DataBind();
                    ddlCategory_Name.SelectedValue = DataBinder.Eval(e.Row.DataItem, "Category_ID").ToString();
                }

                if (Grade_Type == 2)
                {
                    TextBox txtAnswer = new TextBox();
                    txtAnswer.Text    = "Subjective Type";
                    txtAnswer.Enabled = false;
                    e.Row.Cells[3].Controls.Add(txtAnswer);
                }
                rdo.DataSource = dt;
                rdo.DataBind();
            }
        }
        catch
        {
        }
    }
Exemplo n.º 6
0
    protected void GridView_AssignedCriteria_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int Grading_ID = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Grading_Type").ToString());
                int Grade_Type = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "Grade_Type").ToString());

                int    UserAnswer = 0;
                string TextAnswer = "";
                string Remarks    = "";


                RadioButtonList rdo        = (RadioButtonList)e.Row.FindControl("rdoOptions");
                TextBox         txtAnswer  = (TextBox)e.Row.FindControl("txtAnswer");
                TextBox         txtRemarks = (TextBox)e.Row.FindControl("txtRemarks");

                DataTable dt = BLL_Crew_Evaluation.Get_GradingOptions(Grading_ID);
                rdo.DataSource = dt;
                rdo.DataBind();

                int    Evaluation_ID = UDFLib.ConvertToInteger(Request.QueryString["EID"].ToString());
                string Remark        = "";
                foreach (DataRow row in dt.Rows)
                {
                    DataTable dtremark = BLL_Crew_Evaluation.Get_MandatoryRemark(UDFLib.ConvertToInteger(row["ID"].ToString()), Evaluation_ID, UDFLib.ConvertToInteger(GridView_AssignedCriteria.DataKeys[e.Row.RowIndex].Value.ToString()));
                    if (dtremark.Rows.Count > 0)
                    {
                        if (dtremark.Rows[0]["OptionText"].ToString() == row["OptionText"].ToString())
                        {
                            Remark = Remark + row["ID"].ToString() + ";";
                        }
                    }
                }
                HiddenField hdnRemark = (HiddenField)e.Row.FindControl("hdnRemark");
                hdnRemark.Value = Remark;
                if (Grade_Type == 2)
                {
                    txtAnswer.Visible = true;
                }

                if (Request.QueryString["DtlID"] != null)
                {
                    UserAnswer = UDFLib.ConvertToInteger(DataBinder.Eval(e.Row.DataItem, "UserAnswer").ToString());
                    TextAnswer = DataBinder.Eval(e.Row.DataItem, "TextAnswer").ToString();
                    Remarks    = DataBinder.Eval(e.Row.DataItem, "Remarks").ToString();


                    rdo.SelectedValue = UserAnswer.ToString();
                    rdo.Enabled       = false;
                    txtAnswer.Text    = TextAnswer;

                    if (TextAnswer.Length > 100)
                    {
                        txtAnswer.Rows = (TextAnswer.Length / 40);
                    }

                    txtAnswer.ReadOnly  = true;
                    txtRemarks.Text     = Remarks;
                    txtRemarks.ReadOnly = true;
                    ((CheckBox)e.Row.FindControl("chkNA")).Enabled = false;
                }
            }
        }
        catch
        {
        }
    }