Exemplo n.º 1
0
 public void Update(int _danhgiaID, int _namdanhgia, string _chucdanh, string _donvi, string _nghenghiep,
                    int _bac, decimal _hesoluong, string _ketquathuchiencongviec, string _daoducnghenghiep,
                    string _trachnhiem, string _nghiavu, string _uudiem, string _phanloai, string _ykiendonvi,
                    string _thongnhattapthe, DateTime _ngaythang)
 {
     Models.EmployeeManagementEntities db      = new EmployeeManagementEntities();
     Models.DanhGiaVienChuc            danhgia = db.DanhGiaVienChucs.FirstOrDefault(x => x.DGVCID == _danhgiaID);
     danhgia.DGVCNam        = _namdanhgia;
     danhgia.DGVCChucDanh   = _chucdanh;
     danhgia.DGVCDonVi      = _donvi;
     danhgia.DGVCNgheNghiep = _nghenghiep;
     danhgia.DGVCBac        = _bac;
     danhgia.DGVCHeSoLuong  = _hesoluong;
     danhgia.DGVCKetQua     = _ketquathuchiencongviec;
     danhgia.DGVCDaoDuc     = _daoducnghenghiep;
     danhgia.DGVCTrachNhiem = _trachnhiem;
     danhgia.DGVCNghiaVu    = _nghiavu;
     danhgia.DGVCUuDiem     = _uudiem;
     danhgia.DGVCPhanLoai   = _phanloai;
     danhgia.DGVCYKien      = _ykiendonvi;
     danhgia.DGVCThongNhat  = _thongnhattapthe;
     danhgia.DGVCNgay       = _ngaythang;
     db.SaveChanges();
     db.Dispose();
 }
Exemplo n.º 2
0
 public void Delete(int _danhgiaID)
 {
     Models.EmployeeManagementEntities db      = new EmployeeManagementEntities();
     Models.DanhGiaVienChuc            danhgia = db.DanhGiaVienChucs.FirstOrDefault(x => x.DGVCID == _danhgiaID);
     db.DanhGiaVienChucs.Remove(danhgia);
     db.SaveChanges();
     db.Dispose();
 }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Models.NhanVienEntity nvEntity = new Models.NhanVienEntity();
            if (this.Page.RouteData.Values["danhgia"] != null)
            {
                this.UpdateStatus();
                _danhgiaID = Convert.ToInt32(this.Page.RouteData.Values["danhgia"]);
                Models.DanhGiaVienChuc danhgia = _dgEntity.Find(_danhgiaID);
                _nhanvienID = danhgia.NVID;

                if (!this.Page.IsPostBack)
                {
                    dpkNgayThang.SelectedDate = danhgia.DGVCNgay;
                    txtNam.Text                = danhgia.DGVCNam.ToString();
                    txtChucDanh.Text           = danhgia.DGVCChucDanh;
                    txtDonVi.Text              = danhgia.DGVCDonVi;
                    txtNgheNghiep.Text         = danhgia.DGVCNgheNghiep;
                    txtBac.Text                = danhgia.DGVCBac.ToString();
                    txtHeSoLuong.Text          = danhgia.DGVCHeSoLuong.ToString();
                    txtKetQua.Text             = danhgia.DGVCKetQua;
                    txtDaoDuc.Text             = danhgia.DGVCDaoDuc;
                    txtTrachNhiem.Text         = danhgia.DGVCTrachNhiem;
                    txtNghiaVu.Text            = danhgia.DGVCNghiaVu;
                    txtUuDiem.Text             = danhgia.DGVCUuDiem;
                    ddlDanhGia.SelectedValue   = danhgia.DGVCUuDiem;
                    txtYKien.Text              = danhgia.DGVCYKien;
                    ddlThongNhat.SelectedValue = danhgia.DGVCThongNhat;
                }
            }
            else
            {
                this.CreateStatus();
                _nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]);
                if (!this.Page.IsPostBack)
                {
                    dpkNgayThang.SelectedDate = DateTime.Now;
                }
            }

            Models.NhanVien nhanvien = nvEntity.Find_NhanVien(_nhanvienID);
            lblHoTen.Text = nhanvien.NVTen;
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["account"] != null)
            {
                Models.AccountEntity accEntity = new Models.AccountEntity();
                string         email           = Session["account"].ToString();
                Models.Account account         = accEntity.FindByEmail(email);

                if (account == null)
                {
                    this.RedirectToIndex();
                }
                else if (account.ACCChucNang > 1)
                {
                    if (!account.ACCUpDanhGia)
                    {
                        this.RedirectToIndex();
                    }
                    else if (this.Page.RouteData.Values["danhgia"] != null)
                    {
                        try
                        {
                            int danhgiaID = Convert.ToInt32(this.Page.RouteData.Values["danhgia"]);
                            Models.DanhGiaVienChucEntity dgEntity = new Models.DanhGiaVienChucEntity();
                            Models.DanhGiaVienChuc       danhgia  = dgEntity.Find(danhgiaID);
                            if (danhgia == null)
                            {
                                this.RedirectToIndex();
                            }
                            else if (danhgia.NVID == account.NVID)
                            {
                                this.RedirectToIndex();
                            }
                            else
                            {
                                btExport.Visible = true;
                            }
                        }
                        catch
                        {
                            this.RedirectToIndex();
                        }
                    }
                    else if (this.Page.RouteData.Values["nhanvien"] != null)
                    {
                        try
                        {
                            int nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]);
                            if (nhanvienID != account.NVID)
                            {
                                this.RedirectToIndex();
                            }
                            else
                            {
                                Models.NhanVienEntity nvEntity = new Models.NhanVienEntity();
                                Models.NhanVien       nhanvien = nvEntity.Find_NhanVien(nhanvienID);
                                if (nhanvien == null)
                                {
                                    this.RedirectToIndex();
                                }
                            }
                        }
                        catch
                        {
                            this.RedirectToIndex();
                        }
                    }
                    else
                    {
                        this.RedirectToIndex();
                    }
                }
                else if (this.Page.RouteData.Values["danhgia"] != null)
                {
                    try
                    {
                        int danhgiaID = Convert.ToInt32(this.Page.RouteData.Values["danhgia"]);
                        Models.DanhGiaVienChucEntity dgEntity = new Models.DanhGiaVienChucEntity();
                        Models.DanhGiaVienChuc       danhgia  = dgEntity.Find(danhgiaID);
                        if (danhgia == null)
                        {
                            this.RedirectToIndex();
                        }
                        else
                        {
                            btExport.Visible = true;
                        }
                    }
                    catch
                    {
                        this.RedirectToIndex();
                    }
                }
                else if (this.Page.RouteData.Values["nhanvien"] != null)
                {
                    try
                    {
                        int nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"] != null);
                        Models.NhanVienEntity nvEntity = new Models.NhanVienEntity();
                        Models.NhanVien       nhanvien = nvEntity.Find_NhanVien(nhanvienID);
                        if (nhanvien == null)
                        {
                            this.RedirectToIndex();
                        }
                    }
                    catch
                    {
                        this.RedirectToIndex();
                    }
                }
                else
                {
                    this.RedirectToIndex();
                }
            }
            else
            {
                this.RedirectToIndex();
            }
        }