protected void btnCapNhatCVHomTruoc_Click(object sender, EventArgs e)
        {
            DateTime  dtTime    = new DateTime(ConvertUtility.ToInt32(dropYearCopy.SelectedValue), ConvertUtility.ToInt32(dropMonthCopy.SelectedValue), ConvertUtility.ToInt32(dropDayCopy.SelectedValue));
            DateTime  dtTimeNow = new DateTime(ConvertUtility.ToInt32(dropYear.SelectedValue), ConvertUtility.ToInt32(dropMonth.SelectedValue), ConvertUtility.ToInt32(dropDay.SelectedValue));
            DataTable dt        = QuanLyCongViecBaoCaoNgayController.GetAllByUserID(ConvertUtility.ToInt32(dropTrungTam.SelectedValue), 0, dtTime, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), CurrentUser.UserID);

            foreach (DataRow item in dt.Rows)
            {
                QuanLyCongViecBaoCaoNgayInfo info = new QuanLyCongViecBaoCaoNgayInfo();
                info.IDCongViecKPI = ConvertUtility.ToInt32(item["IDCongViecKPI"]);
                info.Ten           = item["Ten"].ToString();
                info.KeHoach       = item["KeHoach"].ToString();
                info.ParentID      = item["ParentID"].ToString();
                info.TyTrong       = ConvertUtility.ToDouble(item["TyTrong"].ToString());
                info.KetQua        = item["KetQua"].ToString();
                info.TyLeHoanThanh = item["TyLeHoanThanh"].ToString();
                info.IDTrungTam    = ConvertUtility.ToInt32(item["IDTrungTam"].ToString());
                info.IDPhongBan    = ConvertUtility.ToInt32(item["IDPhongBan"].ToString());
                info.IDDotDanhGia  = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                info.SoGio         = ConvertUtility.ToDouble(item["SoGio"].ToString());
                info.CreateBy      = CurrentUser.UserID;
                info.LyDo          = item["LyDo"].ToString();
                info.DeXuat        = item["DeXuat"].ToString();
                info.CreatedOn     = dtTimeNow;
                try
                {
                    QuanLyCongViecBaoCaoNgayController.Insert(info);

                    #region Log Action

                    LogFileInfo logFileInfo = new LogFileInfo();
                    logFileInfo.Log_Action         = "Add";
                    logFileInfo.Log_Type_Object    = "QuanLyCongViecKPITheoNgay";
                    logFileInfo.Item_CatID         = "Cong Viec Thuong Xuyen";
                    logFileInfo.Item_ID            = info.ID.ToString();
                    logFileInfo.Item_Name          = info.Ten;
                    logFileInfo.Description_Before = "Old Data: ";
                    logFileInfo.Description_After  = "Add KPI with info: <br />" + GetObjectInfo(info);
                    logFileInfo.UserName           = CurrentUser.Username;
                    logFileInfo.UserID             = CurrentUser.UserID;
                    CreateLogFile.LogAction(logFileInfo);

                    #endregion
                }
                catch (Exception ex)
                {
                    lblStatusUpdate.Text = ex.Message;
                }
            }
        }
        protected void cmdAdd_Click(object sender, EventArgs e)
        {
            QuanLyCongViecBaoCaoNgayInfo info = new QuanLyCongViecBaoCaoNgayInfo();

            info.IDCongViecKPI = ConvertUtility.ToInt32(dropCongViecKPI.SelectedValue);
            info.Ten           = txtName.Text;
            info.KeHoach       = txtKeHoach.Text;
            info.ParentID      = txtCongViecLon.Text;
            info.TyTrong       = 0;// ConvertUtility.ToDouble(txtTyTrong.Text);
            info.KetQua        = txtKetqua.Text;
            info.TyLeHoanThanh = dropTyLeHoanThanh.SelectedValue;
            info.IDTrungTam    = CurrentUser.IDTrungTam;
            info.IDPhongBan    = CurrentUser.IDPhong;
            info.IDDotDanhGia  = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
            info.SoGio         = ConvertUtility.ToDouble(txtSoGio.Text);
            info.CreateBy      = CurrentUser.UserID;
            info.LyDo          = txtLyDo.Text;
            info.DeXuat        = txtDeXuat.Text;
            info.CreatedOn     = new DateTime(ConvertUtility.ToInt32(dropYear.SelectedValue), ConvertUtility.ToInt32(dropMonth.SelectedValue), ConvertUtility.ToInt32(dropDay.SelectedValue));
            try
            {
                QuanLyCongViecBaoCaoNgayController.Insert(info);

                #region Log Action

                LogFileInfo logFileInfo = new LogFileInfo();
                logFileInfo.Log_Action         = "Add";
                logFileInfo.Log_Type_Object    = "QuanLyCongViecKPITheoNgay";
                logFileInfo.Item_CatID         = "Cong Viec Thuong Xuyen";
                logFileInfo.Item_ID            = info.ID.ToString();
                logFileInfo.Item_Name          = info.Ten;
                logFileInfo.Description_Before = "Old Data: ";
                logFileInfo.Description_After  = "Add KPI with info: <br />" + GetObjectInfo(info);
                logFileInfo.UserName           = CurrentUser.Username;
                logFileInfo.UserID             = CurrentUser.UserID;
                CreateLogFile.LogAction(logFileInfo);

                #endregion

                lblStatusUpdate.Text = MiscUtility.MSG_UPDATE_SUCCESS;

                if (ConvertUtility.ToInt32(dropCongViecKPI.SelectedValue) == 0)
                {
                    //them vao cong viec phat sinh
                    DanhGiaThang_DGCBCNVDanhGiaTTCVInfo infoCVPhatSinh = new DanhGiaThang_DGCBCNVDanhGiaTTCVInfo();

                    infoCVPhatSinh.IDDotDanhGia = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                    infoCVPhatSinh.IDNhanVien   = CurrentUser.UserID;
                    infoCVPhatSinh.TenCongViec  = txtName.Text;
                    infoCVPhatSinh.TyTrongCV    = 0;// ConvertUtility.ToDouble(txtTyTrong.Text);
                    infoCVPhatSinh.SoLieuCamKet = txtKeHoach.Text;
                    infoCVPhatSinh.SoLieuThucHienThucTeTrongThang = txtKetqua.Text;
                    infoCVPhatSinh.NhanVienDanhGiaTyLeHoanThanh   = ConvertUtility.ToDouble(dropTyLeHoanThanh.SelectedValue);
                    if (infoCVPhatSinh.NhanVienDanhGiaTyLeHoanThanh > 100)
                    {
                        infoCVPhatSinh.NhanVienDanhGiaTyLeHoanThanh = 100;
                    }

                    if (infoCVPhatSinh.NhanVienDanhGiaTyLeHoanThanh < 0)
                    {
                        infoCVPhatSinh.NhanVienDanhGiaTyLeHoanThanh = 0;
                    }
                    infoCVPhatSinh.YeuCauHoTro      = "";
                    infoCVPhatSinh.YKienCuaNhanVien = "";
                    infoCVPhatSinh.YKienCuaTBP      = "";
                    infoCVPhatSinh.Loai             = 3;
                    infoCVPhatSinh.SoGio            = ConvertUtility.ToDouble(txtSoGio.Text);

                    DanhGiaThang_DGCBCNVDanhGiaTTCVController.Insert(infoCVPhatSinh);
                }
            }
            catch (Exception ex)
            {
                lblStatusUpdate.Text = ex.Message;
            }
        }