public static List <ATTEvaluationCriteriaGrade> GetEvaluationCriteriaGradeList(string fromDate, string Active)
        {
            List <ATTEvaluationCriteriaGrade> lst = new List <ATTEvaluationCriteriaGrade>();

            try
            {
                foreach (DataRow row in DLLEvaluationCriteriaGrade.GetEvaluationCriteriaGradeTable(fromDate, Active).Rows)
                {
                    ATTEvaluationCriteriaGrade obj = new ATTEvaluationCriteriaGrade();
                    obj.EvaluationCriteriaID = int.Parse(row["Eval_crit_id"].ToString());
                    obj.FromDate             = row["from_date"].ToString();
                    obj.EvaluationGradeID    = int.Parse(row["Eval_grade_id"].ToString());
                    obj.EvaluationGradeName  = row["eval_grade_name"].ToString();
                    obj.TotalWeight          = float.Parse(row["total_weight"].ToString());
                    obj.Active = row["active"].ToString();
                    obj.Action = "N";

                    lst.Add(obj);
                }

                return(lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
    protected void lstCriteria_SelectedIndexChanged(object sender, EventArgs e)
    {
        List <ATTEvaluationGroup> lstGrp = (List <ATTEvaluationGroup>)Session["EvaluationGroupListSetup"];
        ATTEvaluationCriteria     crit   = lstGrp[this.ddlGroup_rqd.SelectedIndex].LstEvaluationCriteria[this.lstCriteria.SelectedIndex];

        this.txtCriteria_rqd.Text    = crit.EvaluationCriteriaName;
        this.txtFromDate_rdt.Text    = crit.FromDate;
        this.txtFromDate_rdt.Enabled = false;
        this.txtToDate_rdt.Text      = crit.ToDate;
        this.chkActive.Checked       = (crit.Active == "Y") ? true : false;

        List <ATTEvaluationCriteriaGrade> tempList = new List <ATTEvaluationCriteriaGrade>();

        foreach (ATTEvaluationCriteriaGrade obj in crit.LstEvaluationCriteriaGrade)
        {
            ATTEvaluationCriteriaGrade grade = new ATTEvaluationCriteriaGrade();
            grade.EvaluationCriteriaID = obj.EvaluationCriteriaID;
            grade.FromDate             = obj.FromDate;
            grade.EvaluationGradeID    = obj.EvaluationGradeID;
            grade.EvaluationGradeName  = obj.EvaluationGradeName;
            grade.TotalWeight          = obj.TotalWeight;
            grade.Active = obj.Active;
            grade.Action = obj.Action;
            tempList.Add(grade);
        }

        ((ATTEvaluationCriteria)Session["Criteria"]).LstEvaluationCriteriaGrade = tempList;

        this.grdGrade.DataSource = tempList;
        this.grdGrade.DataBind();
    }
Ejemplo n.º 3
0
    protected void grdGrade_SelectedIndexChanged(object sender, EventArgs e)
    {
        ATTEvaluationCriteria      crit  = (ATTEvaluationCriteria)Session["Criteria"];
        ATTEvaluationCriteriaGrade grade = crit.LstEvaluationCriteriaGrade[this.grdGrade.SelectedIndex];

        this.txtGrade.Text    = grade.EvaluationGradeName;
        this.txtWeight.Text   = grade.TotalWeight.ToString();
        this.chkGrade.Checked = (grade.Active == "Y") ? true : false;
    }
        public static List <ATTEvaluationCriteria> GetEvaluationCriteriaList(int?grpID, Default defGrade, string active)
        {
            List <ATTEvaluationCriteria> lst = new List <ATTEvaluationCriteria>();

            try
            {
                List <ATTEvaluationCriteriaGrade> lstGrade = BLLEvaluationCriteriaGrade.GetEvaluationCriteriaGradeList("", active);

                foreach (DataRow row in DLLEvaluationCriteria.GetEvaluationCriteriaTable(grpID, active).Rows)
                {
                    ATTEvaluationCriteria obj = new ATTEvaluationCriteria();

                    obj.EvaluationCriteriaID = int.Parse(row["Eval_crit_id"].ToString());
                    obj.FromDate             = row["from_date"].ToString();
                    obj.GroupID = int.Parse(row["Eval_group_id"].ToString());
                    obj.EvaluationCriteriaName = row["eval_crit_name"].ToString();
                    obj.ToDate = row["to_date"].ToString();
                    obj.Active = row["active"].ToString();
                    obj.Action = "N";

                    obj.LstEvaluationCriteriaGrade = lstGrade.FindAll
                                                     (
                        delegate(ATTEvaluationCriteriaGrade grade)
                    {
                        return(grade.EvaluationCriteriaID == obj.EvaluationCriteriaID &&
                               grade.FromDate == obj.FromDate);
                    }
                                                     );

                    if (defGrade == Default.Yes)
                    {
                        ATTEvaluationCriteriaGrade defaultGrade = new ATTEvaluationCriteriaGrade();
                        defaultGrade.EvaluationGradeName = "----- भार छन्नुहोस -----";

                        obj.LstEvaluationCriteriaGrade.Insert(0, defaultGrade);
                    }

                    lst.Add(obj);
                }
                return(lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 5
0
    protected void btnAddEvalDetail_Click(object sender, EventArgs e)
    {
        if (this.grdEmployee.SelectedIndex < 0)
        {
            this.lblStatusMessage.Text = "Please select any employee from list.";
            this.programmaticModalPopup.Show();
            return;
        }
        if (this.ddlGroup.SelectedIndex <= 0)
        {
            this.lblStatusMessage.Text = "Please select group from list.";
            this.programmaticModalPopup.Show();
            this.ddlGroup.Focus();
            return;
        }

        if (this.ddlCriteria.SelectedIndex <= 0)
        {
            this.lblStatusMessage.Text = "Please select criteria from list.";
            this.programmaticModalPopup.Show();
            this.ddlGroup.Focus();
            return;
        }

        if (this.ddlGrade.SelectedIndex <= 0)
        {
            this.lblStatusMessage.Text = "Please select grade from list.";
            this.programmaticModalPopup.Show();
            this.ddlGroup.Focus();
            return;
        }

        ATTEmployeeEvaluation eval = (ATTEmployeeEvaluation)Session["EmployeeEvaluation"];

        ATTEvaluationCriteriaGrade grade = ((List <ATTEvaluationGroup>)Session["EvaluationGroupList"])[this.ddlGroup.SelectedIndex].LstEvaluationCriteria[this.ddlCriteria.SelectedIndex].LstEvaluationCriteriaGrade[this.ddlGrade.SelectedIndex];

        bool exist = eval.LstEvaluationDetail.Exists
                     (
            delegate(ATTEmployeeEvaluationDetail de)
        {
            return
            (de.EmpID == int.Parse(this.lblEmpID.Text) &&
             de.EvalFromDate == this.txtFromDate_rdt.Text.Trim() &&
             de.EvaluationCriteriaID == grade.EvaluationCriteriaID &&
             de.FromDate == grade.FromDate);
            //de.EvaluationGradeID == grade.EvaluationGradeID;
        }
                     );

        if (exist == true)
        {
            this.lblStatusMessage.Text = "This Grade has been already added for selected Group and Criteria.";
            this.programmaticModalPopup.Show();
            return;
        }

        ATTEmployeeEvaluationDetail evalDetail = new ATTEmployeeEvaluationDetail();

        evalDetail.EmpID                = int.Parse(this.lblEmpID.Text);
        evalDetail.EvalFromDate         = this.txtFromDate_rdt.Text;
        evalDetail.EvaluationCriteriaID = grade.EvaluationCriteriaID;
        evalDetail.FromDate             = grade.FromDate;
        evalDetail.EvaluationGradeID    = grade.EvaluationGradeID;
        evalDetail.Action               = "A";
        evalDetail.EntryBy              = ((ATTUserLogin)Session["Login_User_Detail"]).UserName;

        evalDetail.GroupName = this.ddlGroup.SelectedItem.Text;
        evalDetail.EvaluationCriteriaName = this.ddlCriteria.SelectedItem.Text;
        evalDetail.EvaluationGradeName    = this.ddlGrade.SelectedItem.Text;

        eval.LstEvaluationDetail.Add(evalDetail);

        this.grdEvaluaitonDetail.DataSource = eval.LstEvaluationDetail;
        this.grdEvaluaitonDetail.DataBind();
        this.SetEvaluationDetailGridColor();
    }
Ejemplo n.º 6
0
    protected void btnAddWeight_Click(object sender, EventArgs e)
    {
        if (this.ddlGroup_rqd.SelectedIndex == 0)
        {
            this.lblStatusMessage.Text = "Please select Evaluation group.";
            this.programmaticModalPopup.Show();
            this.ddlGroup_rqd.Focus();
            return;
        }

        if (this.txtCriteria_rqd.Text.Trim() == "")
        {
            this.lblStatusMessage.Text = "Please enter Criteria name.";
            this.programmaticModalPopup.Show();
            this.txtCriteria_rqd.Focus();
            return;
        }

        if (this.txtFromDate_rdt.Text.Trim() == "")
        {
            this.lblStatusMessage.Text = "Please enter From date.";
            this.programmaticModalPopup.Show();
            this.txtFromDate_rdt.Focus();
            return;
        }

        ATTEvaluationCriteria crit = (ATTEvaluationCriteria)Session["Criteria"];

        ATTEvaluationCriteriaGrade obj = new ATTEvaluationCriteriaGrade();

        if (this.grdGrade.SelectedIndex >= 0)
        {
            obj.EvaluationCriteriaID = int.Parse(this.grdGrade.SelectedRow.Cells[0].Text);
            obj.FromDate             = this.grdGrade.SelectedRow.Cells[1].Text;
            obj.EvaluationGradeID    = int.Parse(this.grdGrade.SelectedRow.Cells[2].Text);
            if (this.grdGrade.SelectedRow.Cells[6].Text == "A")
            {
                obj.Action = "A";
            }
            else
            {
                obj.Action = "E";
            }
        }
        else
        {
            obj.EvaluationCriteriaID = 0;
            obj.FromDate             = this.txtFromDate_rdt.Text;
            obj.EvaluationGradeID    = 0;
            obj.Action = "A";
        }

        obj.EvaluationGradeName = this.txtGrade.Text;
        obj.TotalWeight         = float.Parse(this.txtWeight.Text);
        obj.Active = (this.chkGrade.Checked == true ? "Y" : "N");

        if (this.grdGrade.SelectedIndex >= 0)
        {
            crit.LstEvaluationCriteriaGrade[this.grdGrade.SelectedIndex] = obj;
        }
        else
        {
            crit.LstEvaluationCriteriaGrade.Add(obj);
        }

        this.grdGrade.DataSource = crit.LstEvaluationCriteriaGrade;
        this.grdGrade.DataBind();

        this.ClearGrade();
        this.grdGrade.SelectedIndex = -1;
    }