protected void btnImport_Click(object sender, EventArgs e)
        {
            if (fileImport.HasFile)
            {
                if (!Directory.Exists(Server.MapPath("/UpLoad/Temp/" + CurrentUser.UserID + "/")))
                {
                    Directory.CreateDirectory(Server.MapPath("/UpLoad/Temp/" + CurrentUser.UserID + "/"));
                }

                string ext = ".xls";

                if (fileImport.FileName.IndexOf(".xlsx") > 0)
                {
                    ext = ".xlsx";
                }
                fileImport.PostedFile.SaveAs(Server.MapPath("/UpLoad/Temp/" + CurrentUser.UserID + "/") + fileImport.FileName.Replace(ext, "") + "_Temp" + ext);

                string path = Server.MapPath("/UpLoad/Temp/" + CurrentUser.UserID + "/") + fileImport.FileName.Replace(ext, "") + "_Temp" + ext;

                if (File.Exists(path))
                {
                    DataTable returnTable = ImportExcelToDataTable.ImportExcel(path);

                    if (returnTable != null && returnTable.Rows.Count > 0)
                    {
                        if (chkDeleteAll.Checked)
                        {
                            QuanLyCongViecKTXVaPSController.DeleteAll(ConvertUtility.ToInt32(dropTrungTam.SelectedValue), 1, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));
                        }

                        for (int i = 0; i < returnTable.Rows.Count; i++)
                        {
                            try
                            {
                                DataRow row = returnTable.Rows[i];

                                #region Import

                                QuanLyCongViecKTXVaPSInfo info = new QuanLyCongViecKTXVaPSInfo();
                                info.Ten            = row[0].ToString();
                                info.ParentID       = 0;
                                info.TyTrong        = 0;
                                info.KeHoach        = "";
                                info.IDTrungTam     = ConvertUtility.ToInt32(dropTrungTam.SelectedValue);
                                info.DonViDo        = "";
                                info.IDPhongBan     = 0;//ConvertUtility.ToInt32(dropPhong.SelectedValue);
                                info.Loai           = 1;
                                info.IDDotDanhGia   = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                                info.SoGio          = 0;
                                info.IsKPI          = 1;
                                info.NgayBatDau     = DateTime.Now;
                                info.NgayKetThuc    = DateTime.Now;
                                info.IDNhomCongViec = 1;
                                info.TrangThaiCV    = 2;
                                info.TuanLamViec    = "1,2,3,4,5";

                                QuanLyCongViecKTXVaPSController.Insert(info);

                                info     = new QuanLyCongViecKTXVaPSInfo();
                                info.Ten = row[1].ToString();
                                int parentID = GetParentID(row[0].ToString(), ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), ConvertUtility.ToInt32(dropTrungTam.SelectedValue));
                                info.ParentID       = parentID;
                                info.TyTrong        = 0;
                                info.KeHoach        = ConvertUtility.ToString(row[3].ToString());
                                info.IDTrungTam     = ConvertUtility.ToInt32(dropTrungTam.SelectedValue);
                                info.DonViDo        = "";
                                info.IDPhongBan     = 0;//ConvertUtility.ToInt32(dropPhong.SelectedValue);
                                info.Loai           = 1;
                                info.IDDotDanhGia   = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                                info.SoGio          = ConvertUtility.ToDouble(row[2].ToString());
                                info.IsKPI          = 1;
                                info.NgayBatDau     = DateTime.Now;
                                info.NgayKetThuc    = DateTime.Now;
                                info.IDNhomCongViec = 1;
                                info.TrangThaiCV    = 2;
                                info.TuanLamViec    = ConvertUtility.ToString(row[4].ToString());

                                QuanLyCongViecKTXVaPSController.Insert(info);

                                if (info.ParentID > 0)
                                {
                                    UpdateCapDoCongViec();
                                }

                                #endregion
                            }
                            catch
                            {
                                continue;
                            }
                        }
                    }
                }
                else
                {
                    lblStatusUpdate.Text = GetLocalResourceObject("lblUpdateStatusResource4.Text").ToString();
                }
            }
            Session["Nav"] = "1";
        }
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     QuanLyCongViecKTXVaPSController.DeleteAll(ConvertUtility.ToInt32(dropTrungTam.SelectedValue), 1, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));
     Session["Nav"] = "1";
 }