Exemple #1
0
    protected void grdEvaluator_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        ATTEmployeeEvaluation eval = (ATTEmployeeEvaluation)Session["EmployeeEvaluation"];

        if (this.grdEvaluator.Rows[e.RowIndex].Cells[11].Text == "A")
        {
            eval.LstEmployeeEvaluator.RemoveAt(e.RowIndex);
            this.grdEvaluator.DataSource = eval.LstEmployeeEvaluator;
            this.grdEvaluator.DataBind();
        }
        else if (this.grdEvaluator.Rows[e.RowIndex].Cells[11].Text == "N" || this.grdEvaluator.Rows[e.RowIndex].Cells[11].Text == "D")
        {
            if (((LinkButton)this.grdEvaluator.Rows[e.RowIndex].Cells[12].Controls[0]).Text == "Delete")
            {
                eval.LstEmployeeEvaluator[e.RowIndex].Action = "D";
                this.grdEvaluator.DataSource = eval.LstEmployeeEvaluator;
                this.grdEvaluator.DataBind();
                this.grdEvaluator.Rows[e.RowIndex].ForeColor = System.Drawing.Color.Red;
                ((LinkButton)this.grdEvaluator.Rows[e.RowIndex].Cells[12].Controls[0]).Text = "Undo";
            }
            else if (((LinkButton)this.grdEvaluator.Rows[e.RowIndex].Cells[12].Controls[0]).Text == "Undo")
            {
                eval.LstEmployeeEvaluator[e.RowIndex].Action = "N";
                this.grdEvaluator.DataSource = eval.LstEmployeeEvaluator;
                this.grdEvaluator.DataBind();
                this.grdEvaluator.Rows[e.RowIndex].ForeColor = System.Drawing.Color.FromName("#1D2A5B");
                ((LinkButton)this.grdEvaluator.Rows[e.RowIndex].Cells[12].Controls[0]).Text = "Delete";
            }
        }
        this.SetEvaluatorGridColor();
    }
 public static bool AddEmployeeEvaluation(ATTEmployeeEvaluation obj)
 {
     try
     {
         return(DLLEmployeeEvaluation.AddEmployeeEvaluation(obj));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public static bool AddEmployeeEvaluation(ATTEmployeeEvaluation obj)
        {
            string InsertSQL = "";

            if (obj.Action == "A")
            {
                InsertSQL = "SP_ADD_EMPLOYEE_EVALUATION";
            }
            else
            {
                InsertSQL = "SP_EDIT_EMPLOYEE_EVALUATION";
            }

            List <OracleParameter> paramArray = new List <OracleParameter>();

            paramArray.Add(Utilities.GetOraParam("P_EMP_ID", obj.EmpID, OracleDbType.Double, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_EVAL_FROM_DATE", obj.EvalFromDate, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_EVAL_TO_DATE", obj.EvalToDate, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_REG_NO", obj.RegistrationNo, OracleDbType.Double, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_ORG_NAME", obj.Organization, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_SUBMITED_DATE", obj.SubmitedDate, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_ENTRY_BY", obj.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_ENTRY_ON", obj.EntryOn, OracleDbType.Date, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_OLD_EVAL_FROM_DATE", obj.OldEvalFromDate, OracleDbType.Varchar2, ParameterDirection.Input));

            GetConnection     DBConn = new GetConnection();
            OracleTransaction Tran   = DBConn.GetDbConn(Module.PMS).BeginTransaction();

            try
            {
                SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, InsertSQL, paramArray.ToArray());

                DLLEmployeeWork.AddEmployeeWork(obj.LstEmployeeWork, Tran);

                DLLEmployeeEvaluationDetail.AddEmployeeEvaluationDetail(obj.LstEvaluationDetail, Tran);

                DLLEmployeeEvaluator.AddEmployeeEvaluator(obj.LstEmployeeEvaluator, Tran);

                Tran.Commit();
                return(true);
            }
            catch (Exception ex)
            {
                Tran.Rollback();
                throw ex;
            }
            finally
            {
                DBConn.CloseDbConn();
            }
        }
Exemple #4
0
    protected void grdEmployeeWork_SelectedIndexChanged(object sender, EventArgs e)
    {
        this.ClearWork();
        ATTEmployeeEvaluation eval = (ATTEmployeeEvaluation)Session["EmployeeEvaluation"];

        ATTEmployeeWork work = eval.LstEmployeeWork[this.grdEmployeeWork.SelectedIndex];

        this.txtWorkDesc.Text       = work.WorkDescription;
        this.txtUnit.Text           = work.Unit;
        this.txtHalfYearTarget.Text = work.HalfYearTarget;
        this.txtFullYearTarget.Text = work.FullYearTarget;
        this.txtWorkProgress.Text   = work.WorkProgress;
        this.txtRemarks.Text        = work.Remark;
        this.chkByOffice.Checked    = (work.AssignByOffice == "Y" ? true : false);
    }
        public static ObjectValidation Validate(ATTEmployeeEvaluation obj)
        {
            ObjectValidation result = new ObjectValidation();

            if (obj.EvalFromDate.Trim() == "")
            {
                result.IsValid      = false;
                result.ErrorMessage = "Evaluation from date cannot be empty.";
                return(result);
            }

            if (obj.EvalToDate.Trim() == "")
            {
                result.IsValid      = false;
                result.ErrorMessage = "Evaluation to date cannot be empty.";
                return(result);
            }

            if (obj.RegistrationNo <= 0)
            {
                result.IsValid      = false;
                result.ErrorMessage = "Registration NO cannot less then zero or equal to zero.";
                return(result);
            }

            if (obj.Organization.Trim() == "")
            {
                result.IsValid      = false;
                result.ErrorMessage = "Organization name cannot be empty.";
                return(result);
            }

            if (obj.SubmitedDate.Trim() == "")
            {
                result.IsValid      = false;
                result.ErrorMessage = "Submitted date cannot be empty.";
                return(result);
            }

            return(result);
        }
        public static List <ATTEmployeeEvaluation> GetEmployeeEvaluationList(double empID, string fromDate)
        {
            ATTEmployeeEvaluation        eval = null;
            List <ATTEmployeeEvaluation> lst  = new List <ATTEmployeeEvaluation>();

            try
            {
                DataTable tbl = DLLEmployeeEvaluation.GetEmployeeEvaluation(empID, fromDate);
                foreach (DataRow row in tbl.Rows)
                {
                    eval = new ATTEmployeeEvaluation();

                    eval.EmpID           = double.Parse(row["Emp_ID"].ToString());
                    eval.EvalFromDate    = row["Eval_from_date"].ToString();
                    eval.OldEvalFromDate = row["Eval_from_date"].ToString();
                    eval.EvalToDate      = row["Eval_to_date"].ToString();
                    eval.RegistrationNo  = double.Parse(row["Registration_no"].ToString());
                    eval.Organization    = row["Organization"].ToString();
                    eval.SubmitedDate    = row["submited_date"].ToString();
                    eval.EntryBy         = row["Entry_By"].ToString();
                    eval.EntryOn         = DateTime.Parse(row["Entry_On"].ToString());
                    eval.Action          = "E";

                    lst.Add(eval);

                    //eval.LstEmployeeWork = BLLEmployeeWork.GetEmployeeWork(empID, fromDate);
                    //eval.LstEvaluationDetail = BLLEmployeeEvaluationDetail.GetEmployeeEvaluationDetail(empID, fromDate);
                    //eval.LstEmployeeEvaluator = BLLEmployeeEvaluator.GetEmployeeEvaluationList(empID, fromDate);
                }

                return(lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #7
0
    void LoadEmployeeEvaluation(double empID, string fromDate)
    {
        try
        {
            ATTEmployeeEvaluation eval = BLLEmployeeEvaluation.GetEmployeeEvaluation(empID, fromDate);

            if (eval == null)
            {
                return;
            }

            this.txtFromDate_rdt.Text     = eval.EvalFromDate;
            this.txtToDate_rdt.Text       = eval.EvalToDate;
            this.txtRegNO_rqd.Text        = eval.RegistrationNo.ToString();
            this.txtOrganization_rqd.Text = eval.Organization;
            this.txtSubmitedDate_rdt.Text = eval.SubmitedDate;
            this.hdnOldDate.Value         = eval.OldEvalFromDate;

            this.grdEmployeeWork.DataSource = eval.LstEmployeeWork;
            this.grdEmployeeWork.DataBind();

            this.grdEvaluaitonDetail.DataSource = eval.LstEvaluationDetail;
            this.grdEvaluaitonDetail.DataBind();

            this.grdEvaluator.DataSource = eval.LstEmployeeEvaluator;
            this.grdEvaluator.DataBind();

            Session["EmployeeEvaluation"] = eval;
            this.hdnMode.Value            = "E";
            this.txtFromDate_rdt.Enabled  = false;
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
Exemple #8
0
    protected void btnAddEvaluator_Click(object sender, EventArgs e)
    {
        if (this.grdEmployee.SelectedIndex <= -1)
        {
            this.lblStatusMessage.Text = "Please select any employee from list.";
            this.programmaticModalPopup.Show();
            this.grdEmployee.Focus();
            return;
        }

        if (this.grdPerson.SelectedIndex <= -1)
        {
            this.lblStatusMessage.Text = "Please select any person from list.";
            this.programmaticModalPopup.Show();
            this.grdPerson.Focus();
            return;
        }

        if (this.ddlEvaluatorGroup.SelectedIndex == 0)
        {
            this.lblStatusMessage.Text = "Please select evaluation group.";
            this.programmaticModalPopup.Show();
            this.ddlEvaluatorGroup.Focus();
            return;
        }

        ATTEmployeeEvaluation       eval            = (ATTEmployeeEvaluation)Session["EmployeeEvaluation"];
        List <ATTEmployeeEvaluator> empEvaluatorLst = eval.LstEmployeeEvaluator;

        bool exist = empEvaluatorLst.Exists
                     (
            delegate(ATTEmployeeEvaluator at)
        {
            return
            (at.EmpID == int.Parse(this.lblEmpID.Text) &&
             at.EvalFromDate == this.txtFromDate_rdt.Text &&
             at.GroupID == int.Parse(this.ddlEvaluatorGroup.SelectedValue) &&
             at.PersonID == double.Parse(this.grdPerson.SelectedRow.Cells[0].Text));
        }
                     );

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

        string mode = "A";

        if (this.grdEvaluator.SelectedIndex > -1)
        {
            mode = this.grdEvaluator.SelectedRow.Cells[11].Text;
        }

        ATTEmployeeEvaluator evaluator = new ATTEmployeeEvaluator();

        evaluator.EmpID        = int.Parse(this.lblEmpID.Text);
        evaluator.EvalFromDate = this.txtFromDate_rdt.Text;
        evaluator.GroupID      = int.Parse(this.ddlEvaluatorGroup.SelectedValue);
        evaluator.GroupName    = this.ddlEvaluatorGroup.SelectedItem.Text;
        evaluator.PersonID     = double.Parse(this.grdPerson.SelectedRow.Cells[0].Text);
        evaluator.PersonName   = this.grdPerson.SelectedRow.Cells[4].Text;
        evaluator.Designation  = this.txtDesignation.Text;
        evaluator.SymbolNo     = double.Parse(this.txtEvaluatorSymbol.Text);
        evaluator.Date         = this.txtEvaluatorDate.Text;
        evaluator.Remark       = this.txtEvaluatorRemark.Text;
        evaluator.Action       = "A";
        evaluator.EntryBy      = ((ATTUserLogin)Session["Login_User_Detail"]).UserName;

        if (this.grdEvaluator.SelectedIndex < 0)
        {
            empEvaluatorLst.Add(evaluator);
        }
        else
        {
            if (mode == "A")
            {
                evaluator.Action = "A";
            }
            else if (mode == "N" || mode == "E")
            {
                evaluator.Action = "E";
            }

            empEvaluatorLst[this.grdEvaluator.SelectedIndex] = evaluator;
        }

        this.grdEvaluator.DataSource = empEvaluatorLst;
        this.grdEvaluator.DataBind();
        this.grdEvaluator.SelectedIndex = -1;
        this.grdPerson.SelectedIndex    = -1;
        this.ClearEvaluator();
        this.SetEvaluatorGridColor();
    }
Exemple #9
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();
    }
Exemple #10
0
    protected void btnAddWork_Click(object sender, EventArgs e)
    {
        if (this.grdEmployee.SelectedIndex < 0)
        {
            this.lblStatusMessage.Text = "Please select any employee from list.";
            this.programmaticModalPopup.Show();
            return;
        }
        ATTEmployeeEvaluation  eval       = (ATTEmployeeEvaluation)Session["EmployeeEvaluation"];
        List <ATTEmployeeWork> empWorkLst = eval.LstEmployeeWork;

        string mode = "A";

        if (this.grdEmployeeWork.SelectedIndex > -1)
        {
            mode = this.grdEmployeeWork.SelectedRow.Cells[10].Text;
        }

        ATTEmployeeWork work = new ATTEmployeeWork();

        work.EmpID        = int.Parse(this.lblEmpID.Text);
        work.EvalFromDate = this.txtFromDate_rdt.Text;
        if (mode == "A")
        {
            work.WorkID = 0;
        }
        else
        {
            work.WorkID = int.Parse(this.grdEmployeeWork.SelectedRow.Cells[2].Text);
        }
        work.WorkDescription = this.txtWorkDesc.Text;
        work.Unit            = this.txtUnit.Text;
        work.HalfYearTarget  = this.txtHalfYearTarget.Text;
        work.FullYearTarget  = this.txtFullYearTarget.Text;
        work.WorkProgress    = this.txtWorkProgress.Text;
        work.AssignByOffice  = (this.chkByOffice.Checked == true) ? "Y" : "N";
        work.Remark          = this.txtRemarks.Text;
        work.Action          = "A";
        work.EntryBy         = ((ATTUserLogin)Session["Login_User_Detail"]).UserName;

        ObjectValidation result = BLLEmployeeWork.Validate(work);

        if (result.IsValid == false)
        {
            this.lblStatusMessage.Text = result.ErrorMessage;
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.grdEmployeeWork.SelectedIndex < 0)
        {
            empWorkLst.Add(work);
        }
        else
        {
            if (mode == "A")
            {
                work.Action = "A";
            }
            else if (mode == "N" || mode == "E")
            {
                work.Action = "E";
            }

            empWorkLst[this.grdEmployeeWork.SelectedIndex] = work;
        }

        this.grdEmployeeWork.DataSource = empWorkLst;
        this.grdEmployeeWork.DataBind();
        this.grdEmployeeWork.SelectedIndex = -1;
        this.ClearWork();
    }
Exemple #11
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.grdEmployee.SelectedIndex < 0)
        {
            this.lblStatusMessage.Text = "Please select any employee from list.";
            this.programmaticModalPopup.Show();
            return;
        }
        ATTEmployeeEvaluation eval = (ATTEmployeeEvaluation)Session["EmployeeEvaluation"];

        eval.EmpID          = int.Parse(this.lblEmpID.Text);
        eval.EvalFromDate   = this.txtFromDate_rdt.Text;
        eval.EvalToDate     = this.txtToDate_rdt.Text;
        eval.RegistrationNo = double.Parse(this.txtRegNO_rqd.Text);
        eval.Organization   = this.txtOrganization_rqd.Text;
        eval.SubmitedDate   = this.txtSubmitedDate_rdt.Text;
        if (this.hdnMode.Value == "E")
        {
            eval.Action          = "E";
            eval.OldEvalFromDate = this.hdnOldDate.Value;
        }
        else
        {
            eval.Action = "A";
        }

        eval.EntryBy = ((ATTUserLogin)Session["Login_User_Detail"]).UserName;

        ObjectValidation evalResult = BLLEmployeeEvaluation.Validate(eval);

        if (evalResult.IsValid == false)
        {
            this.lblStatusMessage.Text = evalResult.ErrorMessage;
            this.programmaticModalPopup.Show();
            return;
        }

        try
        {
            BLLEmployeeEvaluation.AddEmployeeEvaluation(eval);
            //eval.LstEvaluationDetail.RemoveAll
            //                                    (
            //                                        delegate(ATTEmployeeEvaluationDetail de)
            //                                        {
            //                                            return de.Action == "D";
            //                                        }
            //                                    );
            this.ClearWork();
            this.grdEmployeeWork.SelectedIndex     = -1;
            this.grdEvaluaitonDetail.SelectedIndex = -1;
            this.grdEmployee.SelectedIndex         = -1;
            this.grdEvaluator.SelectedIndex        = -1;
            this.ClearEvaluation();
            this.EvaluationTab.ActiveTabIndex = 0;
            this.lblPersonName.Text           = "";
            this.colEmployee.Collapsed        = true;
            this.colEmployee.ClientState      = "true";

            this.lblStatusMessage.Text = "Employee Evaluation Saved Successfully.";
            this.programmaticModalPopup.Show();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
Exemple #12
0
 void SetSessionForEmployeeEvaluation()
 {
     Session["EmployeeEvaluation"] = new ATTEmployeeEvaluation();
 }