Пример #1
0
        protected void trainingSendBtn_Click(object sender, EventArgs e)
        {
            try
            {
                UserInfo objTrainingUser = new UserInfo();
                objTrainingUser = (new UserController()).GetUser(0, UserId);

                EmployeeDetailsInfo objEmpTraining = new EmployeeDetailsInfo();
                int empTrainingID = Convert.ToInt32(TrainingEmployeeList.SelectedValue);
                objEmpTraining = (new EmployeeDetailsController()).Get(empTrainingID);

                EmployeePositionTableInfo objEmpTrainingPosition = new EmployeePositionTableInfo();
                int empTrainingPositionID = objEmpTraining.PositionHeld_FK;
                objEmpTrainingPosition = (new EmployeePositionTableController()).Get(empTrainingPositionID);


                //EmployeeDetailsInfo objEmpInfo = new EmployeeDetailsInfo();
                //int emp = Convert.ToInt32(TrainingEmployeeList.SelectedValue);
                //objEmpInfo = (new EmployeeDetailsController()).Get(emp);
                //int empPos = objEmpInfo.PositionHeld_FK;


                //EmployeePositionTableInfo objPositionInfo = new EmployeePositionTableInfo();
                //int empPosition = empPos;
                //objPositionInfo = (new EmployeePositionTableController()).Get(empPosition);


                EmployeeTrainingTableInfo objTrainingInfo = new EmployeeTrainingTableInfo();
                int empID = Convert.ToInt32(TrainingEmployeeList.SelectedValue);

                objTrainingInfo.EmployeeID_FK    = empTrainingID;
                objTrainingInfo.DepartmentID_FK  = Convert.ToInt32(this.trainingDeptList.SelectedValue);
                objTrainingInfo.PositionID_FK    = empTrainingPositionID;
                objTrainingInfo.TrainingName     = this.trainingNameList.SelectedItem.Text.Trim();
                objTrainingInfo.TrainingLocation = this.txtTrainingLocation.Text.Trim();
                objTrainingInfo.StartDate        = this.trainingStartDayList.SelectedItem.Text.Trim() + "-" + trainingStartMonthList.SelectedItem.Text.Trim() + "-" + trainingStartYearList.SelectedItem.Text.Trim();
                objTrainingInfo.EndDate          = this.trainingEndDayList.SelectedItem.Text.Trim() + "-" + trainingEndMonthList.SelectedItem.Text.Trim() + "-" + trainingEndYearList.SelectedItem.Text.Trim();
                objTrainingInfo.TrainingSentBy   = objTrainingUser.UserID;
                //this.LbTrainingSentBy.Text.Trim();

                int TrainingID = (new EmployeeTrainingTableController()).Add(objTrainingInfo);

                if (TrainingID > 0)
                {
                    LbTrainingRequestSentBy.Visible = true;
                    LbTrainingRequestSentBy.Text    = "Training request successfully sent, you can now wait for HR Approval";
                }

                else
                {
                    LbTrainingRequestSentBy.Visible = true;
                    LbTrainingRequestSentBy.Text    = "Training request NOT successfully sent, Please Re-Try";
                }
            }

            catch { }
        }
Пример #2
0
        protected void TrainingEmployeeList_SelectedIndexChanged(object sender, EventArgs e)
        {
            UserInfo objTrainingUser = new UserInfo();

            objTrainingUser = (new UserController()).GetUser(0, UserId);

            EmployeeDetailsInfo objEmpTraining = new EmployeeDetailsInfo();
            int empTrainingID = Convert.ToInt32(TrainingEmployeeList.SelectedValue);

            objEmpTraining = (new EmployeeDetailsController()).Get(empTrainingID);

            EmployeePositionTableInfo objEmpTrainingPosition = new EmployeePositionTableInfo();
            int empTrainingPositionID = objEmpTraining.PositionHeld_FK;

            objEmpTrainingPosition = (new EmployeePositionTableController()).Get(empTrainingPositionID);


            LbTrainingEmpPosition.Text    = objEmpTrainingPosition.PositionName;
            LbTrainingEmpPosition.Visible = true;
            LbTrainingSentBy.Text         = objTrainingUser.DisplayName;
            LbTrainingSentBy.Visible      = true;

            //EmployeeDetailsInfo objEmpInfo = new EmployeeDetailsInfo();
            //int emp = Convert.ToInt32(TrainingEmployeeList.SelectedValue);
            // objEmpInfo = (new EmployeeDetailsController()).Get(emp);
            // int empPos = objEmpInfo.PositionHeld_FK;

            //EmployeePositionTableInfo objPositionInfo = new EmployeePositionTableInfo();
            //int empPosition = empPos;
            //objPositionInfo = (new EmployeePositionTableController()).Get(empPosition);

            //objEmpInfo.EmployeeID = emp;
            //objEmpInfo.PositionHeld_FK = empPos;

            //LbTrainingEmpPosition.Text = objPositionInfo.PositionName;
            //LbTrainingEmpPosition.Visible = true;

            //LbTrainingEmpPosition0.Text = objEmpInfo.PositionName;
            //LbTrainingEmpPosition0.Visible = true;
        }