private void btnDel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int SelectedRow = gridItemDetail.FocusedRowHandle;

            if (SelectedRow >= 0)
            {
                DataRow drow   = gridItemDetail.GetDataRow(SelectedRow);
                string  _value = drow["TrainingID"].ToString();
                if (Class.App.ConfirmDeletion() == DialogResult.No)
                {
                    return;
                }

                Class.QuaTrinhLamViec_DaoTao dt = new Class.QuaTrinhLamViec_DaoTao();
                dt.TrainingID = _value;
                if (dt.Delete())
                {
                    Class.App.DeleteSuccessfully();
                    CT_PROCESS_TRAINING_GetListByEmployee();
                }
                else
                {
                    Class.App.DeleteNotSuccessfully();
                }
            }
        }
        private void call_info(string Form_name, string code)
        {
            Class.QuaTrinhLamViec_DaoTao dtao = new Class.QuaTrinhLamViec_DaoTao();
            dtao.TrainingID = code;
            DataTable dt = dtao.CT_PROCESS_TRAINING_Get();

            txtTrainingID.Text     = code;
            txtTrainingName.Text   = dt.Rows[0]["TrainingName"].ToString();
            txtReason.Text         = dt.Rows[0]["Reason"].ToString();
            txtForm.Text           = dt.Rows[0]["Form"].ToString();
            txtTime.Text           = dt.Rows[0]["Time"].ToString();
            dateBeginDate.DateTime = (DateTime)dt.Rows[0]["BeginDate"];
            dateDate.DateTime      = (DateTime)dt.Rows[0]["Date"];
            txtDecideNumber.Text   = dt.Rows[0]["DecideNumber"].ToString();
            txtPerson.Text         = dt.Rows[0]["Person"].ToString();
        }
        private void Update_DaoTao()
        {
            Class.QuaTrinhLamViec_DaoTao dtao = new Class.QuaTrinhLamViec_DaoTao();
            dtao.TrainingID   = txtTrainingID.Text;
            dtao.EmployeeCode = Class.App._manv;
            dtao.TrainingName = txtTrainingName.Text;
            dtao.Reason       = txtReason.Text;
            dtao.Form         = txtForm.Text;
            dtao.Time         = txtTime.Text;
            dtao.BeginDate    = dateBeginDate.DateTime;
            dtao.DecideNumber = txtDecideNumber.Text;
            dtao.Date         = dateDate.DateTime;
            dtao.Person       = txtPerson.Text;

            if (txtTrainingID.Enabled == true)
            {
                if (dtao.Insert())
                {
                    Class.App.SaveSuccessfully();
                }
                else
                {
                    Class.App.SaveNotSuccessfully();
                }
            }
            else
            {
                if (dtao.Update())
                {
                    Class.App.SaveSuccessfully();
                }
                else
                {
                    Class.App.SaveNotSuccessfully();
                }
            }
            (this.Owner as frmQuaTrinhLamViec_DaoTao).CT_PROCESS_TRAINING_GetListByEmployee();
        }
 public void CT_PROCESS_TRAINING_GetListByEmployee()
 {
     Class.QuaTrinhLamViec_DaoTao dt = new Class.QuaTrinhLamViec_DaoTao();
     gridItem.DataSource = dt.CT_PROCESS_TRAINING_GetListByEmployee();
     gridItemDetail.OptionsView.ColumnAutoWidth = false;
 }