public static void LogAction(LogFileInfo info)
 {
     try
     {
         SqlHelper.ExecuteNonQuery(AppEnv.ConnectionString, "Log_Action_Trace_Insert",
                                   info.Log_Action,
                                   info.Log_Type_Object,
                                   info.Item_CatID,
                                   info.Item_ID,
                                   info.Item_Name,
                                   info.Description_Before,
                                   info.Description_After,
                                   info.UserName,
                                   info.UserID);
     }
     finally
     {
         // con.Close();
     }
 }
        public static void LogAction(LogFileInfo info)
        {
            try
            {
                SqlHelper.ExecuteNonQuery(AppEnv.ConnectionString, "Log_Action_Trace_Insert",
                    info.Log_Action,
                    info.Log_Type_Object,
                    info.Item_CatID,
                    info.Item_ID,
                    info.Item_Name,
                    info.Description_Before,
                    info.Description_After,
                    info.UserName,
                    info.UserID);

            }
            finally
            {
               // con.Close();
            }
        }
        protected void dgrCongViec_RowCommand(object source, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "delete")
            {
                try
                {
                    int id = ConvertUtility.ToInt32(e.CommandArgument);

                    QuanLyCongViecKTXVaPSInfo info = QuanLyCongViecKTXVaPSController.GetInfo(id);
                    if (info == null)
                    {
                        cmdEmpty_Click(null, null);
                        return;
                    }

                    QuanLyCongViecKTXVaPSController.Delete(id, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

                    int ParentID = ConvertUtility.ToInt32(dropCongViecKPI.SelectedValue);
                    if (ParentID > 0)
                    {
                        UpdateTyTrongCongViecCha(ParentID, info.IsKPI);

                        string oldData = GetObjectInfo(info);

                        #region Log Action

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

                        #endregion

                        UpdateCapDoCongViec();
                    }

                    lblStatusUpdate.Text = MiscUtility.MSG_UPDATE_SUCCESS;
                }
                catch (Exception ex)
                {
                    lblStatusUpdate.Text = ex.Message;
                }
            }
            Session["Nav"] = "2";
        }
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            QuanLyCongViecKTXVaPSInfo info = QuanLyCongViecKTXVaPSController.GetInfo(ConvertUtility.ToInt32(txtID.Text));
            if (info == null)
            {
                cmdEmpty_Click(null, null);
                return;
            }
            if (info.ID == ConvertUtility.ToInt32(dropCongViecKPI.SelectedValue))
            {
                lblStatusUpdate.Text = "Trung mục cha";
                return;
            }
            string oldData = GetObjectInfo(info);

            info.Ten = txtName.Text;
            info.ParentID = ConvertUtility.ToInt32(dropCongViecKPI.SelectedValue);
            info.TyTrong = ConvertUtility.ToDouble(txtTyTrong.Text);
            info.IDTrungTam = ConvertUtility.ToInt32(dropTrungTam.SelectedValue);
            info.KeHoach = txtKeHoach.Text;
            info.DonViDo = txtDonViDo.Text;
            info.IDPhongBan = 0;//ConvertUtility.ToInt32(dropPhong.SelectedValue);
            info.Loai = 2;
            info.IDDotDanhGia = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue); ;
            info.SoGio = ConvertUtility.ToDouble(txtSoGio.Text);
            info.IsKPI = ConvertUtility.ToInt32(dropKPIBoPhan.SelectedValue);
            info.NgayBatDau = ConvertUtility.ToDateTime(dtFrom.Text);
            info.NgayKetThuc = ConvertUtility.ToDateTime(dtTo.Text);
            info.IDNhomCongViec = ConvertUtility.ToInt32(dropMaNhom.SelectedValue);
            info.TrangThaiCV = ConvertUtility.ToInt32(dropTrangThai.SelectedValue);

            DateConverter objDate = new DateConverter();

            int tuanBD = objDate.GetWeekOfMonth(info.NgayBatDau);
            int tuanKT = objDate.GetWeekOfMonth(info.NgayKetThuc);

            string tuanLV = "";
            for (int i = tuanBD; i <= tuanKT; i++)
            {
                tuanLV += i + ",";
            }
            info.TuanLamViec = tuanLV.Substring(0, tuanLV.Length - 1);
            try
            {
                QuanLyCongViecKTXVaPSController.Update(info);

                lblStatusUpdate.Text = MiscUtility.MSG_UPDATE_SUCCESS;

                #region Log Action

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

                #endregion

                UpdateCapDoCongViec();
            }
            catch (Exception ex)
            {
                lblStatusUpdate.Text = ex.Message;
            }
            Session["Nav"] = "2";
        }
        protected void cmdDel_Click(object sender, EventArgs e)
        {
            try
            {
                QuanLyCongViecKTXVaPSInfo info = QuanLyCongViecKTXVaPSController.GetInfo(ConvertUtility.ToInt32(txtID.Text));
                if (info == null)
                {
                    cmdEmpty_Click(null, null);
                    return;
                }

                QuanLyCongViecKTXVaPSController.Delete(ConvertUtility.ToInt32(txtID.Text), ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

                int ParentID = ConvertUtility.ToInt32(dropCongViecKPI.SelectedValue);
                if (ParentID > 0)
                {
                    UpdateTyTrongCongViecCha(ParentID, info.IsKPI);

                    string oldData = GetObjectInfo(info);

                    #region Log Action

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

                    #endregion

                    UpdateCapDoCongViec();
                }
            }
            catch (Exception ex)
            {
                lblStatusUpdate.Text = ex.Message;
            }

            Session["Nav"] = "2";
        }
        protected void btnLayCongViecThangTruoc_Click(object sender, EventArgs e)
        {
            QuanLyCongViecKTXVaPSController.ClearAllCongViecTheoBoPhanVaDotDanhGia(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), ConvertUtility.ToInt32(dropTrungTam.SelectedValue), 2);

            #region Copy cong viec thuong xuyen cua thang truoc

            DataTable dt = new DataTable();

            dt.Columns.Add("ID", typeof(string));
            dt.Columns.Add("Ten", typeof(string));
            dt.Columns.Add("TyTrong", typeof(string));
            dt.Columns.Add("SoGio", typeof(string));
            dt.Columns.Add("ParentID", typeof(string));
            dt.Columns.Add("Priority", typeof(string));
            dt.Columns.Add("KeHoach", typeof(string));
            dt.Columns.Add("DonViDo", typeof(string));
            dt.Columns.Add("IDTrungTam", typeof(string));
            dt.Columns.Add("IDPhongBan", typeof(string));
            dt.Columns.Add("Loai", typeof(string));
            dt.Columns.Add("IDDotDanhGia", typeof(string));
            dt.Columns.Add("LevelDeep", typeof(string));
            dt.Columns.Add("NgayBatDau", typeof(string));
            dt.Columns.Add("NgayKetThuc", typeof(string));
            dt.Columns.Add("TrangThaiCV", typeof(string));
            dt.Columns.Add("TuanLamViec", typeof(string));
            dt.Columns.Add("IDNhomCongViec", typeof(string));
            DataTable source = QuanLyCongViecKTXVaPSController.LoadCongViecForCopyNew(dt, ConvertUtility.ToInt32(dropTrungTam.SelectedValue), 0, 2, ConvertUtility.ToInt32(dropDotDanhGiaCopy.SelectedValue));

            DataRow[] row = source.Select("ParentID=0");
            int parentId = 0;
            foreach (DataRow item in row)
            {
                QuanLyCongViecKTXVaPSInfo info = new QuanLyCongViecKTXVaPSInfo();

                info.Ten = ConvertUtility.ToString(item["Ten"]);
                info.TyTrong = ConvertUtility.ToDouble(item["TyTrong"]);
                info.SoGio = ConvertUtility.ToDouble(item["SoGio"]);
                info.ParentID = 0;
                info.Priority = ConvertUtility.ToInt32(item["Priority"]);
                info.KeHoach = ConvertUtility.ToString(item["KeHoach"]);
                info.DonViDo = ConvertUtility.ToString(item["DonViDo"]);
                info.IDTrungTam = ConvertUtility.ToInt32(item["IDTrungTam"]);
                info.IDPhongBan = ConvertUtility.ToInt32(item["IDPhongBan"]);
                info.Loai = ConvertUtility.ToInt32(item["Loai"]);
                info.IDDotDanhGia = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                info.LevelDeep = ConvertUtility.ToInt32(item["LevelDeep"]);
                info.NgayBatDau = ConvertUtility.ToDateTime(item["NgayBatDau"]).AddMonths(1);
                info.NgayKetThuc = ConvertUtility.ToDateTime(item["NgayKetThuc"]).AddMonths(1);
                info.TrangThaiCV = ConvertUtility.ToInt32(item["TrangThaiCV"]);
                info.TuanLamViec = ConvertUtility.ToString(item["TuanLamViec"]);
                info.IDNhomCongViec = ConvertUtility.ToInt32(item["IDNhomCongViec"]);
                info.OldID = ConvertUtility.ToInt32(item["ID"]);

                try
                {
                    parentId = QuanLyCongViecKTXVaPSController.Insert_6_11_2014(info);

                    #region Log Action

                    LogFileInfo logFileInfo = new LogFileInfo();
                    logFileInfo.Log_Action = "Add";
                    logFileInfo.Log_Type_Object = "QuanLyCongViecKPI";
                    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

                    InsertCongViecCon(source, item, parentId, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

                    lblStatusUpdate.Text = MiscUtility.MSG_UPDATE_SUCCESS;

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

            UpdateCapDoCongViec(ConvertUtility.ToInt32(dropTrungTam.SelectedValue), ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

            #endregion

            #region Lay cac nhan vien va cac cong viec duoc giao thang truoc --> thuc hien giao viec

            //lay tat ca nhan vien cua trung tam
            DataTable dtNhanVien = DotDanhGiaController.GetAllNhanVienTemp(ConvertUtility.ToInt32(dropTrungTam.SelectedValue), 0);

            foreach (DataRow item in dtNhanVien.Rows)
            {
                try
                {
                    string[] array = item["UserID"].ToString().Split('_');
                    int idNhanVien = ConvertUtility.ToInt32(array[0]);
                    int idBoPhan = ConvertUtility.ToInt32(array[2]);

                    DataSet ds = DotDanhGiaController.GetPTDG(idNhanVien, ConvertUtility.ToInt32(item["IDPhong"]));

                    DataTable dtNDG = ds.Tables[0];

                    int idNguoiDanhGia = 0;
                    if (dtNDG != null && dtNDG.Rows.Count > 0)
                    {
                        idNguoiDanhGia = ConvertUtility.ToInt32(dtNDG.Rows[0]["IDNguoiDG"]);
                    }

                    DotDanhGiaController.UpdateNhanVienVaoDotDanhGia(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), idNhanVien, ConvertUtility.ToInt32(array[2]), ConvertUtility.ToInt32(array[1]), idNguoiDanhGia, 0);

                    #region Update cong viec cho nhan vien theo thang

                    DataTable dtCongViec = DotDanhGiaController.GetAllCongViecGiaoChoNhanVienKTXVaPS_6_11_2014(idNhanVien, 2, ConvertUtility.ToInt32(dropDotDanhGiaCopy.SelectedValue));

                    if (dtCongViec != null && dtCongViec.Rows.Count > 0)
                    {
                        foreach (DataRow rowCV in dtCongViec.Rows)
                        {
                            DanhGiaThang_DGCBCNVDanhGiaTTCVInfo info = new DanhGiaThang_DGCBCNVDanhGiaTTCVInfo();

                            info.IDDotDanhGia = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                            info.IDNhanVien = idNhanVien;
                            info.TenCongViec = ConvertUtility.ToString(rowCV["Ten"]);
                            int idCongViecKPI = ConvertUtility.ToInt32(rowCV["IDCongViecKPI"]);

                            QuanLyCongViecKTXVaPSInfo infoCongViecKPI = QuanLyCongViecKTXVaPSController.GetInfoByOldID(idCongViecKPI);

                            if (infoCongViecKPI != null)
                            {
                                info.IDBoPhan = ConvertUtility.ToInt32(rowCV["IDBoPhan"]);
                                info.IDPhongBan = ConvertUtility.ToInt32(rowCV["IDPhongBan"]);
                                info.TyTrongCV = Math.Round(ConvertUtility.ToDouble(rowCV["TyTrong"]), 2);
                                info.SoGio = Math.Round(ConvertUtility.ToDouble(rowCV["SoGio"]), 2);

                                DotDanhGiaController.UpdateCongViecChoNhanVien(idNhanVien, infoCongViecKPI.ID, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), info.IDBoPhan, info.IDPhongBan, info.TyTrongCV, info.SoGio);

                                info.SoLieuCamKet = ConvertUtility.ToString(rowCV["KeHoach"]);
                                info.YeuCauHoTro = "";
                                info.Loai = 2;
                                info.IDCongViec = infoCongViecKPI.ID;
                                info.IDBoPhanHoTro = 0;
                                info.IDBoPhan = ConvertUtility.ToInt32(rowCV["IDBoPhan"]);
                                info.IDPhongBan = ConvertUtility.ToInt32(rowCV["IDPhongBan"]);
                                info.NgayBatDau = ConvertUtility.ToDateTime(rowCV["NgayBatDau"]).AddMonths(1);
                                info.NgayKetThuc = ConvertUtility.ToDateTime(rowCV["NgayKetThuc"]).AddMonths(1);

                                DanhGiaThang_DGCBCNVDanhGiaTTCVController.InsertKeHoachThang(info);
                            }
                        }
                    }

                    #endregion

                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            #endregion
            Session["Nav"] = "2";
        }
        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 cmdUpdate_Click(object sender, EventArgs e)
        {
            QuanLyCongViecBaoCaoNgayInfo info = QuanLyCongViecBaoCaoNgayController.GetInfo(ConvertUtility.ToInt32(txtID.Text));
            if (info == null)
            {
                cmdEmpty_Click(null, null);
                return;
            }
            if (info.ID == ConvertUtility.ToInt32(dropCongViecKPI.SelectedValue))
            {
                lblStatusUpdate.Text = "Trung mục cha";
                return;
            }
            string oldData = GetObjectInfo(info);

            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.Update(info);

                lblStatusUpdate.Text = MiscUtility.MSG_UPDATE_SUCCESS;

                #region Log Action

                LogFileInfo logFileInfo = new LogFileInfo();
                logFileInfo.Log_Action = "Update";
                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: " + oldData;
                logFileInfo.Description_After = "Update KPI with info: <br />" + GetObjectInfo(info);
                logFileInfo.UserName = CurrentUser.Username;
                logFileInfo.UserID = CurrentUser.UserID;
                CreateLogFile.LogAction(logFileInfo);

                #endregion

                cmdEmpty_Click(null, null);
                //Response.Redirect(AppEnv.AdminUrlParams("baocaongay"));

            }
            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;
            }
        }