Пример #1
0
        protected void btnThemMoi1_Click(object sender, EventArgs e)
        {
            //lay dot danh gia truoc ra lam chuan
            int idDotDanhCopy = ConvertUtility.ToInt32(DotDanhGiaController.GetDaultDotDanhGia().Rows[0]["ID"]);

            #region Tao dot danh gia moi

            DotDanhGiaInfo infoDotDanhGia = new DotDanhGiaInfo();

            infoDotDanhGia.Ten             = txtTen.Text.Trim();
            infoDotDanhGia.ThoiGianBatDau  = ConvertUtility.ToDateTime(txtThoiGianBatDau.Text);
            infoDotDanhGia.ThoiGianKetThuc = ConvertUtility.ToDateTime(txtThoiGianKetThuc.Text);
            infoDotDanhGia.TrangThai       = ConvertUtility.ToInt32(dropTypeOf.SelectedValue);
            infoDotDanhGia.DangChay        = ConvertUtility.ToInt32(dropStatus.SelectedValue);
            infoDotDanhGia.IsDefault       = ConvertUtility.ToInt32(dropChuan.SelectedValue);

            infoDotDanhGia.Nam   = infoDotDanhGia.ThoiGianKetThuc.Year;
            infoDotDanhGia.Thang = infoDotDanhGia.ThoiGianKetThuc.Month;

            int idDotDanhGia = DotDanhGiaController.Insert(infoDotDanhGia);

            #endregion

            DataTable dtTrungTam = BoPhanController.BoPhan_GetAllActive();

            foreach (DataRow itemTrungTam in dtTrungTam.Rows)
            {
                DataTable source = QuanLyCongViecKTXVaPSController.GetAllNhanVienTheoQLVaDotDanhGia(ConvertUtility.ToInt32(itemTrungTam["ID"]), idDotDanhCopy);

                UpdateNhanVienTheoNDG(source, idDotDanhGia, ConvertUtility.ToInt32(itemTrungTam["ID"]));

                UpdateNhanVienVaoDotDanhGia(source, idDotDanhGia, ConvertUtility.ToInt32(itemTrungTam["ID"]));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            idDotDanhGia = ConvertUtility.ToInt32(Request.QueryString["id"]);
            if (!Page.IsPostBack)
            {
                DotDanhGiaInfo info = DotDanhGiaController.GetInfo(idDotDanhGia);
                if (info == null)
                {
                    this.btnAdd.Visible    = false;
                    this.btnRemove.Visible = false;
                    return;
                }
                lblDotDanhGiaName.Text = info.Ten;

                dropTrungTam.DataSource = BoPhanController.BoPhan_GetAllActive();
                dropTrungTam.DataBind();
                dropTrungTam.Items.Insert(0, new ListItem("Tất cả", "0"));

                if (!CurrentUser.IsAdmin && !CurrentUser.IsSuperAdmin)
                {
                    dropTrungTam.Enabled       = false;
                    dropTrungTam.SelectedValue = CurrentUser.IDTrungTam.ToString();
                }

                dropPortal.Items.Clear();
                PortalController.LoadPortals(dropPortal.Items);
            }
        }
 protected void dropTrungTam_SelectedIndexChanged(object sender, EventArgs e)
 {
     dropPhong.Items.Clear();
     dropPhong.DataSource = DotDanhGiaController.GetAllPhongBan(ConvertUtility.ToInt32(dropTrungTam.SelectedValue));
     dropPhong.DataBind();
     dropPhong.Items.Insert(0, new ListItem("----------Lựa chọn----------", "0"));
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            idDotDanhGia = ConvertUtility.ToInt32(Request.QueryString["id"]);
            if (!Page.IsPostBack)
            {
                dropDotDanhGia.DataSource = DotDanhGiaController.GetAll(3);
                dropDotDanhGia.DataBind();
                int idDotDanhActive = ConvertUtility.ToInt32(DotDanhGiaController.GetDaultDotDanhGia().Rows[0]["ID"]);
                dropDotDanhGia.SelectedValue = idDotDanhActive.ToString();

                dropTrungTam.DataSource = BoPhanController.BoPhan_GetAllActive();
                dropTrungTam.DataBind();
                dropTrungTam.Items.Insert(0, new ListItem("Tất cả", "0"));


                if (!CurrentUser.IsAdmin && !CurrentUser.IsSuperAdmin)
                {
                    dropTrungTam.Enabled = false;
                }
                dropTrungTam.SelectedValue = CurrentUser.IDTrungTam.ToString();

                dropNhanVien.Items.Clear();
                dropNhanVien.DataSource = DotDanhGiaController.GetAllNhanVienCapTBP_TP_PP(ConvertUtility.ToInt32(dropTrungTam.SelectedValue));
                dropNhanVien.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dropTrungTam.DataSource = BoPhanController.GetAll();
                dropTrungTam.DataBind();
                dropTrungTam.Items.Insert(0, new ListItem("----------Lựa chọn----------", "0"));

                dropDotDanhGia.DataSource = DotDanhGiaController.GetAll(1);
                dropDotDanhGia.DataBind();

                if (ConvertUtility.ToInt32(dropTrungTam.SelectedValue) > 0)
                {
                    dropPhong.DataSource = DotDanhGiaController.GetAllPhongBan(ConvertUtility.ToInt32(dropTrungTam.SelectedValue));
                    dropPhong.DataBind();
                    dropPhong.Items.Insert(0, new ListItem("----------Lựa chọn----------", "0"));
                }
                else
                {
                    dropPhong.Items.Insert(0, new ListItem("----------Lựa chọn----------", "0"));
                }

                //int userId = ConvertUtility.ToInt32(Request.QueryString["uid"]);

                //if (userId > 0)
                //{
                //    DataTable dt = DotDanhGiaController.GetTrangThaiNhanVien(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), userId, ConvertUtility.ToInt32(dropTrungTam.SelectedValue), ConvertUtility.ToInt32(dropPhong.SelectedValue));
                //    if (dt != null && dt.Rows.Count > 0)
                //    {
                //        dropTrangThai.SelectedValue = ConvertUtility.ToInt32(dt.Rows[0]["TrangThaiNhanVien"]).ToString();
                //    }
                //}
            }
        }
Пример #6
0
        protected void dtgUsers_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                ImageButton  btnImgDeleteUser     = (ImageButton)e.Row.FindControl("btnImgDeleteUser");
                ImageButton  btnImgManageProfile  = (ImageButton)e.Row.FindControl("btnImgManageProfile");
                ImageButton  btnImgManagePassword = (ImageButton)e.Row.FindControl("btnImgManagePassword");
                ImageButton  btnImgUserPermision  = (ImageButton)e.Row.FindControl("btnImgUserPermision");
                Label        lblKey    = (Label)e.Row.FindControl("lblKey");
                DropDownList dropPhong = (DropDownList)e.Row.FindControl("dropPhong");

                btnImgDeleteUser.OnClientClick    = MiscUtility.MSG_DELETE_CONFIRM;
                btnImgManageProfile.OnClientClick = "javascript:window.open('" + AppEnv.AdminUrlParams("createuser") + "&uid=" + lblKey.Text + "', target='_blank'); return false;";
                DataRowView curData = (DataRowView)e.Row.DataItem;

                //if (e.Row.RowState == DataControlRowState.Alternate)
                //{
                //    e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#EEFF00';");
                //    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#f7fff8';");
                //}
                //else
                //{
                //    e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#EEFF00';");
                //    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#eefef0';");
                //}

                dropPhong.DataSource = DotDanhGiaController.GetAllPhongBan(ConvertUtility.ToInt32(dropTrungTam.SelectedValue));
                dropPhong.DataBind();
                dropPhong.Items.Insert(0, new ListItem("----------Lựa chọn----------", "0"));
                dropPhong.SelectedValue = curData["IDPhong"].ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            idDotDanhGia = ConvertUtility.ToInt32(Request.QueryString["idDotDanhGia"]);
            idNhanVien   = ConvertUtility.ToInt32(Request.QueryString["idNhanVien"]);
            if (!IsPostBack)
            {
                dropDotDanhGia.DataSource = DotDanhGiaController.GetAll(1);
                dropDotDanhGia.DataBind();

                if (idDotDanhGia == 0)
                {
                    int idDotDanhActive = ConvertUtility.ToInt32(DotDanhGiaController.GetDaultDotDanhGia().Rows[0]["ID"]);

                    Response.Redirect(AppEnv.AdminUrlParams("danhgianhanvienhangthang") + "&idDotDanhGia=" + idDotDanhActive + "&idNhanVien=" + CurrentUser.UserID);
                }
                else
                {
                    dropDotDanhGia.SelectedValue = idDotDanhGia.ToString();
                }

                ViewState["DropDownPageItems"] = 10;

                if (CurrentUser.RoleID == (int)Constants.Role.TruongBoPhanKhoiHoTro || CurrentUser.RoleID == (int)Constants.Role.TruongBoPhanKhoiKinhDoanh || CurrentUser.RoleID == (int)Constants.Role.TruongPhong)
                {
                    btnUpdateStatus.Visible = true;
                }
                else
                {
                    btnUpdateStatus.Visible = false;
                }

                lblUpdateStatus.Text = "";
            }
        }
Пример #8
0
        protected void dgrNhanVienCVTX_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "TyTrongCaNhan")
            {
                foreach (GridViewRow item in dgrNhanVienCVTX.Rows)
                {
                    Label   lblID            = (Label)item.FindControl("lblID");
                    TextBox txtTyTrongCaNhan = (TextBox)item.FindControl("txtTyTrongCaNhan");
                    double  tytong           = ConvertUtility.ToDouble(txtTyTrongCaNhan.Text);
                    double  sogio            = tytong * 176 / 100;

                    DotDanhGiaController.UpdateTyTrongCongViecNhanVienV2(ConvertUtility.ToInt32(lblID.Text), tytong, sogio);
                }

                btnUpdateCongViecVaoKeHoach1_Click(null, null);
            }

            if (e.CommandName == "GioLamViec")
            {
                foreach (GridViewRow item in dgrNhanVienCVTX.Rows)
                {
                    Label   lblID        = (Label)item.FindControl("lblID");
                    TextBox txtGLVCaNhan = (TextBox)item.FindControl("txtGLVCaNhan");

                    double sogio   = ConvertUtility.ToDouble(txtGLVCaNhan.Text);
                    double tytrong = sogio * 100 / 176;
                    DotDanhGiaController.UpdateTyTrongCongViecNhanVienV2(ConvertUtility.ToInt32(lblID.Text), tytrong, sogio);
                }

                btnUpdateCongViecVaoKeHoach1_Click(null, null);
            }
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow gv in dgrBoPhan.Rows)
            {
                int     idBoPhan            = ConvertUtility.ToInt32(((Label)gv.FindControl("lblKey")).Text);
                int     idDotDanhGia        = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                TextBox txtYTuongDoatGiai   = (TextBox)gv.FindControl("txtYTuongDoatGiai");
                TextBox txtKhongPhoiHop     = (TextBox)gv.FindControl("txtKhongPhoiHop");
                TextBox txtPhoiHopNhietTinh = (TextBox)gv.FindControl("txtPhoiHopNhietTinh");
                TextBox txtThucDayNhanVien  = (TextBox)gv.FindControl("txtThucDayNhanVien");

                int YTuongDoatGiai   = ConvertUtility.ToInt32(txtYTuongDoatGiai.Text);
                int KhongPhoiHop     = ConvertUtility.ToInt32(txtKhongPhoiHop.Text);
                int PhoiHopNhietTinh = ConvertUtility.ToInt32(txtPhoiHopNhietTinh.Text);
                int ThucDayNhanVien  = ConvertUtility.ToInt32(txtThucDayNhanVien.Text);

                UserController.UpdateBoPhanDGDiemSangTao(idBoPhan, idDotDanhGia, YTuongDoatGiai, KhongPhoiHop, PhoiHopNhietTinh, ThucDayNhanVien);
            }

            DataTable dtNhanVien = DotDanhGiaController.GetAllNhanVien(0, 0, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

            if (dtNhanVien != null && dtNhanVien.Rows.Count > 0)
            {
                foreach (DataRow item in dtNhanVien.Rows)
                {
                    DotDanhGiaController.DanhGiaThang_DGCBCNVDanhGia_TongDiemCongThucMoi(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), ConvertUtility.ToInt32(item["IDNhanVien"]));
                }
            }
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            idDotDanhGia = ConvertUtility.ToInt32(Request.QueryString["idDotDanhGia"]);
            idNhanVien   = ConvertUtility.ToInt32(Request.QueryString["idNhanVien"]);
            if (!IsPostBack)
            {
                dropDotDanhGia.DataSource = DotDanhGiaController.GetAll(1);
                dropDotDanhGia.DataBind();

                if (idDotDanhGia == 0)
                {
                    int idDotDotDanhDefault = ConvertUtility.ToInt32(DotDanhGiaController.GetDaultDotDanhGia().Rows[0]["ID"]);
                    Response.Redirect(AppEnv.AdminUrlParams("dg_danhgiald_kd") + "&idDotDanhGia=" + idDotDotDanhDefault + "&idNhanVien=" + CurrentUser.UserID);
                }
                else
                {
                    dropDotDanhGia.SelectedValue = idDotDanhGia.ToString();
                }
            }

            if (CurrentUser.RoleID == (int)Constants.Role.CEO || CurrentUser.IsAdmin || CurrentUser.IsSuperAdmin)
            {
                btnYeuCauLamLaiDanhGia.Visible = true;
            }
            else
            {
                btnYeuCauLamLaiDanhGia.Visible = false;
            }

            btnSumit.OnClientClick = "return confirm('Bạn có chắc chắn gửi đánh giá hay không ?')";
        }
Пример #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = BoPhanController.BoPhan_GetAllActive();

                dropTrungTam.DataSource = dt;
                dropTrungTam.DataBind();

                dropTrungTamSearch.DataSource = dt;
                dropTrungTamSearch.DataBind();

                int id = ConvertUtility.ToInt32(Request.QueryString["idTrungTam"]);
                if (id > 0)
                {
                    dropTruongPhongBan.Items.Clear();
                    dropTruongPhongBan.DataSource = DotDanhGiaController.GetAllNhanVienCapTBP_TP_PP(id);
                    dropTruongPhongBan.DataBind();

                    dropTrungTam.SelectedValue = dropTrungTamSearch.SelectedValue = id.ToString();
                }
                else
                {
                    dropTruongPhongBan.Items.Clear();
                    dropTruongPhongBan.DataSource = DotDanhGiaController.GetAllNhanVienCapTBP_TP_PP(ConvertUtility.ToInt32(dropTrungTam.SelectedValue));
                    dropTruongPhongBan.DataBind();
                }
            }
        }
Пример #12
0
        protected void dgrPhongBan_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowIndex < 0)
            {
                return;
            }

            DropDownList dropTruongPhong = (DropDownList)e.Row.FindControl("dropTruongPhong");

            dropTruongPhong.Items.Clear();

            DataRowView currData = (DataRowView)e.Row.DataItem;

            DataTable dtNhanVien = DotDanhGiaController.GetAllNhanVienCapTBP_TP_PP(ConvertUtility.ToInt32(dropTrungTamSearch.SelectedValue));

            dropTruongPhong.DataSource = dtNhanVien;
            dropTruongPhong.DataBind();

            try
            {
                dropTruongPhong.SelectedValue = currData["IDNhanVienTruongPhong"].ToString();
            }
            catch (Exception)
            {
                dropTruongPhong.SelectedIndex = -1;
            }
        }
Пример #13
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow gv in dgrBoPhan.Rows)
            {
                int     idBoPhan           = ConvertUtility.ToInt32(((Label)gv.FindControl("lblKey")).Text);
                int     idDotDanhGia       = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                TextBox txtThamGiaHDCongTy = (TextBox)gv.FindControl("txtThamGiaHDCongTy");
                TextBox txtChuyenCan       = (TextBox)gv.FindControl("txtChuyenCan");
                TextBox txtTuanThuThoiGian = (TextBox)gv.FindControl("txtTuanThuThoiGian");
                TextBox txtKhenThuong      = (TextBox)gv.FindControl("txtKhenThuong");
                TextBox txtDiemKyLuatTT    = (TextBox)gv.FindControl("txtDiemKyLuatTT");

                int ThamGiaHDCongTy = ConvertUtility.ToInt32(txtThamGiaHDCongTy.Text);
                int ChuyenCan       = ConvertUtility.ToInt32(txtChuyenCan.Text);
                int TuanThuThoiGian = ConvertUtility.ToInt32(txtTuanThuThoiGian.Text);
                int KhenThuong      = ConvertUtility.ToInt32(txtKhenThuong.Text);
                int DiemKyLuatTT    = ConvertUtility.ToInt32(txtDiemKyLuatTT.Text);

                UserController.UpdateBoPhanDGKyLuat(idBoPhan, idDotDanhGia, ThamGiaHDCongTy, ChuyenCan, TuanThuThoiGian, KhenThuong, DiemKyLuatTT);
            }

            DataTable dtNhanVien = DotDanhGiaController.GetAllNhanVien(0, 0, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

            if (dtNhanVien != null && dtNhanVien.Rows.Count > 0)
            {
                foreach (DataRow item in dtNhanVien.Rows)
                {
                    DotDanhGiaController.DanhGiaThang_DGCBCNVDanhGia_TongDiemCongThucMoi(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), ConvertUtility.ToInt32(item["IDNhanVien"]));
                }
            }
        }
Пример #14
0
    public void DisableButton()
    {
        if (hdfRecordID.Text != "")
        {
            DAL.DotDanhGia info = new DotDanhGiaController().GetByPrkey(hdfRecordID.Text);
            switch (info.HinhThucDanhGia)
            {
            case 0:         // Đánh giá cả đơn vị
            case 1:         // Đánh giá trong phòng
                btnThemCanBoDuocDanhGia.Disabled    = true;
                btnThemCanBoThamGiaDanhGia.Disabled = true;
                btnXoaCanBoThamGiaDanhGia.Disabled  = true;
                btnXoaCanBoDuocDanhGia.Disabled     = true;
                fd.Collapsed            = true;
                fd.Collapsible          = false;
                ltrColapsibleStyle.Text = "<style type='text/css'> div.x-tool-expand-south {display: none !important;}</style>";
                RM.RegisterClientScriptBlock("rlst", "Delete(#{grp_CanBoDuocDanhGia}, #{grp_CanBoDuocDanhGia_Store}); Delete(#{grp_CanBoThamGiaDanhGia}, #{grp_CanBoThamGiaDanhGia_Store});");
                break;

            case 2:         // Chỉ định cán bộ tham gia đánh giá
                fd.Collapsible = true;
                fd.Collapsed   = false;
                RM.RegisterClientScriptBlock("rlst", "grp_CanBoThamGiaDanhGia_Store.reload();grp_CanBoDuocDanhGia_Store.reload();btnThemCanBoDuocDanhGia.enable();btnThemCanBoThamGiaDanhGia.enable();btnXoaCanBoThamGiaDanhGia.enable();btnXoaCanBoDuocDanhGia.enable();");
                break;
            }
        }
    }
        protected void btnUpdateStatus_Click(object sender, EventArgs e)
        {
            DataTable dtUsers;

            if (CurrentUser.RoleID == (int)Constants.Role.TruongBoPhanKhoiHoTro || CurrentUser.RoleID == (int)Constants.Role.TruongBoPhanKhoiKinhDoanh)
            {
                dtUsers = UserController.GetUsersByNguoiDanhGiaTheoThang(txtKeyword.Text, dropSearchBy.SelectedValue, ConvertUtility.ToString(ViewState["Alphabet"]), CurrentUser.UserID, CurrentUser.IDTrungTam, idDotDanhGia, CurrentUser.RoleID, ConvertUtility.ToInt32(dropChucVu.SelectedValue));
            }
            else
            {
                dtUsers = UserController.GetUsersByNguoiDanhGiaTheoThang(txtKeyword.Text, dropSearchBy.SelectedValue, ConvertUtility.ToString(ViewState["Alphabet"]), CurrentUser.UserID, CurrentUser.IDTrungTam, idDotDanhGia, (int)Constants.Role.TruongPhong, ConvertUtility.ToInt32(dropChucVu.SelectedValue));
            }

            foreach (DataRow item in dtUsers.Rows)
            {
                if (ConvertUtility.ToInt32(item["TrangThai"]) == 6 || ConvertUtility.ToInt32(item["TrangThai"]) == 7 || ConvertUtility.ToInt32(item["TrangThai"]) == 8)
                {
                    DotDanhGiaController.GuiDanhGiaThang(idDotDanhGia, ConvertUtility.ToInt32(item["UserID"]), (int)Constants.TrangThaiDanhGiaNhanVien.ThongNhat);

                    EmailUtility.DoSendMail(item["Email"].ToString(), "", "Trưởng bộ phận đã thống nhất bảng đánh giá tháng", "Người phụ trách trực tiếp đã đánh giá công việc tháng của bạn. Đề nghị bạn đăng nhập phần mềm để xem kết quả đánh giá.");
                }
            }

            lblUpdateStatus.Text = "Bạn vừa thống nhất kết quả thành công";
        }
Пример #16
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            btnUpdate1_Click(null, null);
            btnUpdate2_Click(null, null);
            btnUpdate3_Click(null, null);
            btnUpdate4_Click(null, null);
            btnUpdate5_Click(null, null);
            btnUpdate6_Click(null, null);
            btnUpdate7_Click(null, null);
            btnUpdate8_Click(null, null);
            btnUpdate14_Click(null, null);
            btnUpdate15_Click(null, null);
            btnUpdate16_Click(null, null);
            btnUpdate17_Click(null, null);
            btnUpdate18_Click(null, null);

            DataTable dtNhanVien = DotDanhGiaController.GetAllNhanVien(0, 0, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

            if (dtNhanVien != null && dtNhanVien.Rows.Count > 0)
            {
                foreach (DataRow item in dtNhanVien.Rows)
                {
                    DotDanhGiaController.DanhGiaThang_DGCBCNVDanhGia_TongDiemCongThucMoi(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), ConvertUtility.ToInt32(item["IDNhanVien"]));
                }
            }
        }
Пример #17
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            int id = ConvertUtility.ToInt32(Request.QueryString["id"]);

            if (id > 0)
            {
                DotDanhGiaInfo info = DotDanhGiaController.GetInfo(id);

                if (info != null)
                {
                    txtTen.Text              = info.Ten.ToString();
                    txtThoiGianBatDau.Text   = info.ThoiGianBatDau.ToShortDateString();
                    txtThoiGianKetThuc.Text  = info.ThoiGianKetThuc.ToShortDateString();
                    dropStatus.SelectedValue = info.DangChay.ToString();
                    dropTypeOf.SelectedValue = info.TrangThai.ToString();
                    dropChuan.SelectedValue  = ConvertUtility.ToInt32(info.IsDefault).ToString();
                }
            }
            else
            {
                btnUpdate.Visible = false;
            }

            dgrDotDanhGia.DataSource = DotDanhGiaController.GetAll();
            dgrDotDanhGia.DataBind();
        }
Пример #18
0
        protected void btnSumit_Click(object sender, EventArgs e)
        {
            DataTable dt = DotDanhGiaController.checkDanhGiaThang(idDotDanhGia, idNhanVien);

            if (dt != null && dt.Rows.Count > 0)
            {
                if (ConvertUtility.ToInt32(dt.Rows[0]["TrangThai"]) == (int)Constants.TrangThaiDanhGiaNhanVien.LapKeHoach)
                {
                    UserInfo userInfo = UserController.GetUser(idNhanVien);
                    if (userInfo == null)
                    {
                        Response.Redirect(AppEnv.AdminUrlParams("accessdeny"));
                    }

                    if (userInfo.IDPhong > 0)
                    {
                        DotDanhGiaController.GuiDanhGiaThang(idDotDanhGia, idNhanVien, (int)Constants.TrangThaiDanhGiaNhanVien.DaGuiKeHoachChoTruongPhong);
                    }
                    else
                    {
                        DotDanhGiaController.GuiDanhGiaThang(idDotDanhGia, idNhanVien, (int)Constants.TrangThaiDanhGiaNhanVien.DaGuiKeHoachChoTBP);
                    }
                }
                //else
                //{
                //    DotDanhGiaController.GuiDanhGiaThang(idDotDanhGia, idNhanVien, (int)Constants.TrangThaiDanhGiaNhanVien.DaGuiKeHoachChoTBP);
                //}
            }
        }
Пример #19
0
        void rptCongViec_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }

            DataList dl = (DataList)e.Item.FindControl("dlNhanVien");

            DataRowView crr = (DataRowView)e.Item.DataItem;

            int idCongViec = ConvertUtility.ToInt32(crr["ID"]);

            DataSet ds = DotDanhGiaController.GetAllNhanVienTheoIDCongViec(idTrungTam, idCongViec, idDotDanhGia);

            DataTable dt = ds.Tables[0].Clone();

            foreach (DataRow item in ds.Tables[0].Rows)
            {
                DataRow row = dt.NewRow();
                row["HoTen"]   = item["HoTen"];
                row["TyTrong"] = Math.Round(ConvertUtility.ToDouble(item["TyTrong"]), 2);
                row["SoGio"]   = Math.Round(ConvertUtility.ToDouble(item["SoGio"]), 2);
                dt.Rows.Add(row);
            }
            dl.DataSource = dt;
            dl.DataBind();
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow gv in dgrBoPhan.Rows)
            {
                int     idBoPhan     = ConvertUtility.ToInt32(((Label)gv.FindControl("lblKey")).Text);
                int     idDotDanhGia = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                TextBox txtMatXanh   = (TextBox)gv.FindControl("txtMatXanh");
                TextBox txtMatMeu    = (TextBox)gv.FindControl("txtMatMeu");
                TextBox txtMatNau    = (TextBox)gv.FindControl("txtMatNau");
                TextBox txtOther     = (TextBox)gv.FindControl("txtOther");
                TextBox txtNote      = (TextBox)gv.FindControl("txtNote");
                TextBox txtGhiChu    = (TextBox)gv.FindControl("txtGhiChu");

                int    MatXanh = ConvertUtility.ToInt32(txtMatXanh.Text);
                int    MatMeu  = ConvertUtility.ToInt32(txtMatMeu.Text);
                int    MatNau  = ConvertUtility.ToInt32(txtMatNau.Text);
                int    Other   = ConvertUtility.ToInt32(txtOther.Text);
                string note    = txtNote.Text;
                string note1   = txtGhiChu.Text;

                UserController.UpdateBoPhanDiemKyLuat5S(idBoPhan, idDotDanhGia, MatXanh, MatMeu, MatNau, Other, note, note1);
            }

            DataTable dtNhanVien = DotDanhGiaController.GetAllNhanVien(0, 0, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

            if (dtNhanVien != null && dtNhanVien.Rows.Count > 0)
            {
                foreach (DataRow item in dtNhanVien.Rows)
                {
                    DotDanhGiaController.DanhGiaThang_DGCBCNVDanhGia_TongDiemCongThucMoi(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), ConvertUtility.ToInt32(item["IDNhanVien"]));
                }
            }
        }
Пример #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ViewState["DropDownPageItems"] = 10;

                dropTrungTam.DataSource = BoPhanController.BoPhan_GetAllActive();
                dropTrungTam.DataBind();

                if (!CurrentUser.IsAdmin && !CurrentUser.IsSuperAdmin)
                {
                    dropTrungTam.Enabled = false;
                }
                dropTrungTam.SelectedValue = CurrentUser.IDTrungTam.ToString();
                dropYear.SelectedValue     = DateTime.Now.Year.ToString();
                dropMonth.SelectedValue    = DateTime.Now.Month.ToString();
                BindDay();
                dropDay.SelectedValue = DateTime.Now.Day.ToString();

                dropDotDanhGia.DataSource = DotDanhGiaController.GetAll(1);
                dropDotDanhGia.DataBind();

                BindUser();
            }
        }
Пример #22
0
    public void BindData(string maDotDanhGia, string maDonVi)
    {
        try
        {
            ReportController controller = new ReportController();
            xrLabel1.Text = controller.GetCompanyName(maDonVi);

            DAL.DotDanhGia ddg = new DotDanhGiaController().GetByPrkey(maDotDanhGia);
            if (ddg != null)
            {
                xrLabel2.Text = "BÁO CÁO KẾT QUẢ ĐỢT ĐÁNH GIÁ " + ddg.TenDotDanhGia.ToUpper();
                DataTable table = DataController.DataHandler.GetInstance().ExecuteDataTable("sp_DanhGia_TongHopDiemKetQuaDanhGia", "@MaDotDanhGia", "@TuDanhGia", "@QuanLyDG", "@NguoiKhacDG",
                                                                                            maDotDanhGia, ddg.TL_TuDanhGia, ddg.TL_QuanLyDanhGia, ddg.TL_NguoiKhacDanhGia);
                DataSource = table;
                xrTableCell10.DataBindings.Add("Text", DataSource, "MA_CB");
                xrTableCell11.DataBindings.Add("Text", DataSource, "HO_TEN");
                xrTableCell12.DataBindings.Add("Text", DataSource, "TEN_CHUCVU");
                xrTableCell13.DataBindings.Add("Text", DataSource, "NGAY_TUYEN_CHINHTHUC", "{0:dd/MM/yyyy}");
                xrTableCell14.DataBindings.Add("Text", DataSource, "TrungBinh", "{0:n2}");

                this.GroupHeader1.GroupFields.AddRange(new DevExpress.XtraReports.UI.GroupField[] {
                    new DevExpress.XtraReports.UI.GroupField("ChuoiSX", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending)
                });
                xrt_phongban.DataBindings.Add("Text", DataSource, "TEN_PHONG");
            }
            else
            {
                Dialog.ShowError("Không tìm thấy đợt đánh giá");
            }
        }
        catch (Exception ex)
        {
            Dialog.ShowError("Có lỗi xảy ra: " + ex.Message);
        }
    }
Пример #23
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            foreach (GridViewRow gv in dgrBoPhan.Rows)
            {
                int     idBoPhan            = ConvertUtility.ToInt32(((Label)gv.FindControl("lblKey")).Text);
                int     idDotDanhGia        = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
                TextBox txtYTuongThang      = (TextBox)gv.FindControl("txtYTuongThang");
                TextBox txtYTuongMoi        = (TextBox)gv.FindControl("txtYTuongMoi");
                TextBox txtSoNhanVienGui    = (TextBox)gv.FindControl("txtSoNhanVienGui");
                TextBox txtSoYTuongDuocChon = (TextBox)gv.FindControl("txtSoYTuongDuocChon");
                TextBox txtSoNhanVien       = (TextBox)gv.FindControl("txtSoNhanVien");

                int ytuongthang    = ConvertUtility.ToInt32(txtYTuongThang.Text);
                int ytuongmoi      = ConvertUtility.ToInt32(txtYTuongMoi.Text);
                int sonhanviengui  = ConvertUtility.ToInt32(txtSoNhanVienGui.Text);
                int ytuongduocchon = ConvertUtility.ToInt32(txtSoYTuongDuocChon.Text);
                int sonhanvien     = ConvertUtility.ToInt32(txtSoNhanVien.Text);

                UserController.UpdateBoPhanDiemSangTao(idBoPhan, idDotDanhGia, ytuongthang, ytuongmoi, sonhanviengui, ytuongduocchon, sonhanvien);
            }

            DataTable dtNhanVien = DotDanhGiaController.GetAllNhanVien(0, 0, ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));

            if (dtNhanVien != null && dtNhanVien.Rows.Count > 0)
            {
                foreach (DataRow item in dtNhanVien.Rows)
                {
                    DotDanhGiaController.DanhGiaThang_DGCBCNVDanhGia_TongDiemCongThucMoi(ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue), ConvertUtility.ToInt32(item["IDNhanVien"]));
                }
            }
        }
Пример #24
0
        protected void dgrDotDanhGia_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "edit")
            {
                int id = ConvertUtility.ToInt32(e.CommandArgument);

                Response.Redirect(AppEnv.AdminUrlParams("dotdanhgia") + "&id=" + id);
            }

            if (e.CommandName == "detail")
            {
                int id = ConvertUtility.ToInt32(e.CommandArgument);

                Response.Redirect(AppEnv.AdminUrlParams("dotdanhgiachitiet") + "&id=" + id);
            }
            if (e.CommandName == "tbp")
            {
                int id = ConvertUtility.ToInt32(e.CommandArgument);

                Response.Redirect(AppEnv.AdminUrlParams("dotdanhgiatruongbophan") + "&id=" + id);
            }

            if (e.CommandName == "ndgnhanvien")
            {
                int id = ConvertUtility.ToInt32(e.CommandArgument);

                Response.Redirect(AppEnv.AdminUrlParams("dotdanhgiachonNDG") + "&id=" + id);
            }

            if (e.CommandName == "ndgtruongphong")
            {
                int id = ConvertUtility.ToInt32(e.CommandArgument);

                Response.Redirect(AppEnv.AdminUrlParams("dotdanhgiachonNDGTruongPhong") + "&id=" + id);
            }

            if (e.CommandName == "bophan")
            {
                int id = ConvertUtility.ToInt32(e.CommandArgument);

                Response.Redirect(AppEnv.AdminUrlParams("chonbophanvaodotdanhgia") + "&id=" + id);
            }

            if (e.CommandName == "delete")
            {
                try
                {
                    int id = ConvertUtility.ToInt32(e.CommandArgument);

                    DotDanhGiaController.Delete(id);

                    lblStatusUpdate.Text = MiscUtility.MSG_UPDATE_SUCCESS;
                }
                catch (Exception ex)
                {
                    lblStatusUpdate.Text = ex.Message;
                }
            }
        }
Пример #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dropDotDanhGia.DataSource = DotDanhGiaController.GetAll(1);
                dropDotDanhGia.DataBind();

                //DataTable dt = DotDanhGiaController.GetAllMucDoanhThuLoiNhuan();
                //dropDoanhThuIT.DataSource = dropLoiNhuanIT.DataSource = dt;
                //dropDoanhThuIT.DataBind();
                //dropLoiNhuanIT.DataBind();

                //dropDoanhThuNSHC.DataSource = dropLoiNhuanNSHC.DataSource = dt;
                //dropDoanhThuNSHC.DataBind();
                //dropLoiNhuanNSHC.DataBind();

                //dropDoanhThuTCKT.DataSource = dropLoiNhuanTCKT.DataSource = dt;
                //dropDoanhThuTCKT.DataBind();
                //dropLoiNhuanTCKT.DataBind();

                //dropDoanhThuPTKD.DataSource = dropLoiNhuanPTKD.DataSource = dt;
                //dropDoanhThuPTKD.DataBind();
                //dropLoiNhuanPTKD.DataBind();

                //dropDoanhThuPTND.DataSource = dropLoiNhuanPTND.DataSource = dt;
                //dropDoanhThuPTND.DataBind();
                //dropLoiNhuanPTND.DataBind();

                //dropDoanhThuLUCKYFONE.DataSource = dropLoiNhuanLUCKYFONE.DataSource = dt;
                //dropDoanhThuLUCKYFONE.DataBind();
                //dropLoiNhuanLUCKYFONE.DataBind();

                //dropDoanhThuBANQUYEN.DataSource = dropLoiNhuanBANQUYEN.DataSource = dt;
                //dropDoanhThuBANQUYEN.DataBind();
                //dropLoiNhuanBANQUYEN.DataBind();

                //dropDoanhThuDVKH.DataSource = dropLoiNhuanDVKH.DataSource = dt;
                //dropDoanhThuDVKH.DataBind();
                //dropLoiNhuanDVKH.DataBind();

                //dropDoanhThuLINGO.DataSource = dropLoiNhuanLINGO.DataSource = dt;
                //dropDoanhThuLINGO.DataBind();
                //dropLoiNhuanLINGO.DataBind();

                //dropDoanhThuPTDV.DataSource = dropLoiNhuanPTDV.DataSource = dt;
                //dropDoanhThuPTDV.DataBind();
                //dropLoiNhuanPTDV.DataBind();

                //dropDoanhThuTIEPTHISO.DataSource = dropLoiNhuanTIEPTHISO.DataSource = dt;
                //dropDoanhThuTIEPTHISO.DataBind();
                //dropLoiNhuanTIEPTHISO.DataBind();

                //dropDoanhThuDSTC.DataSource = dropLoiNhuanDSTC.DataSource = dt;
                //dropDoanhThuDSTC.DataBind();
                //dropLoiNhuanDSTC.DataBind();
            }
        }
Пример #26
0
        protected void btnUpdate18_Click(object sender, EventArgs e)
        {
            DotDanhGiaTLHTCVInfo info = new DotDanhGiaTLHTCVInfo();

            info.IDDotDanhGia = ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue);
            info.TLHTCongViec = ConvertUtility.ToDouble(txtTLHTCongViecQCS.Text);
            info.IDTrungTam   = 18;

            DotDanhGiaController.UpdateTLHTCongViec(info);
        }
Пример #27
0
        private void UpdateNhanVienTheoNDG(DataTable source, int idDotDanhGia, int idTrungTam)
        {
            foreach (DataRow _item in source.Rows)
            {
                int idNhanVien = ConvertUtility.ToInt32(_item["IDNhanVien"]);
                int IDNguoiDG  = ConvertUtility.ToInt32(_item["IDNguoiDG"]);

                DotDanhGiaController.UpdateNhanVienTheoNDG(idNhanVien, idTrungTam, IDNguoiDG, idDotDanhGia);
            }
        }
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     foreach (ListItem item in lstNhanVien.Items)
     {
         if (item.Selected)
         {
             DotDanhGiaController.UpdateNhanVienTheoNDG(ConvertUtility.ToInt32(item.Value), ConvertUtility.ToInt32(dropTrungTam.SelectedValue), ConvertUtility.ToInt32(dropNhanVien.SelectedValue), ConvertUtility.ToInt32(dropDotDanhGia.SelectedValue));
         }
     }
 }
Пример #29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         dropDotDanhGia.DataSource = DotDanhGiaController.GetAll(1);
         dropDotDanhGia.DataBind();
         int idDotDanhActive = ConvertUtility.ToInt32(DotDanhGiaController.GetDaultDotDanhGia().Rows[0]["ID"]);
         dropDotDanhGia.SelectedValue = idDotDanhActive.ToString();
     }
 }
Пример #30
0
 protected void btnRemove_Click(object sender, EventArgs e)
 {
     foreach (ListItem item in lstNhanVienInDotDanhGia.Items)
     {
         if (item.Selected)
         {
             DotDanhGiaController.UpdateNhanVienVaoNhom(ConvertUtility.ToInt32(item.Value), ConvertUtility.ToInt32(dropTrungTam.SelectedValue), 0);
         }
     }
 }