コード例 #1
0
 public void Update(int _thamgiaID, int _tochucID, string _chucvu, DateTime _tungay, string _noidung)
 {
     Models.EmployeeManagementEntities db      = new EmployeeManagementEntities();
     Models.ThamGiaChinhTriXaHois      thamgia = db.ThamGiaChinhTriXaHois.FirstOrDefault(x => x.TGCTXHID == _thamgiaID);
     thamgia.CTXHID        = _tochucID;
     thamgia.TGCTXHChucVu  = _chucvu;
     thamgia.TGCTXHTuNgay  = _tungay;
     thamgia.TGCTXHNoiDung = _noidung;
     db.SaveChanges();
     db.Dispose();
 }
コード例 #2
0
 public bool IsOfNhanVien(int _ctxhID, int _nhanvienID)
 {
     Models.EmployeeManagementEntities db     = new EmployeeManagementEntities();
     Models.ThamGiaChinhTriXaHois      tgctxh = db.ThamGiaChinhTriXaHois.FirstOrDefault(x => x.CTXHID == _ctxhID && x.NVID == _nhanvienID);
     if (tgctxh == null)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Page.RouteData.Values["ctxh"] != null)
     {
         try
         {
             int thamgiaID = Convert.ToInt32(this.Page.RouteData.Values["ctxh"]);
             Models.ThamGiaChinhTriXaHoiEntity thamgiaEntity = new Models.ThamGiaChinhTriXaHoiEntity();
             Models.ThamGiaChinhTriXaHois      thamgia       = thamgiaEntity.Find(thamgiaID);
             if (thamgia == null)
             {
                 Response.Redirect("~/NhanSu");
             }
             else
             {
                 lblNhanVien.Text = thamgia.NhanVien.NVTen;
             }
         }
         catch (Exception)
         {
             Response.Redirect("~/NhanSu");
         }
     }
     else if (this.Page.RouteData.Values["nhanvien"] != null)
     {
         try
         {
             int nhanvienID = nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]);
             Models.NhanVienEntity nhanvienEntity = new Models.NhanVienEntity();
             Models.NhanVien       nhanvien       = nhanvienEntity.Find_NhanVien(nhanvienID);
             if (nhanvien == null)
             {
                 Response.Redirect("~/NhanSu");
             }
             else
             {
                 lblNhanVien.Text = nhanvien.NVTen;
             }
         }
         catch (Exception) { }
     }
     else
     {
         Response.Redirect("~/NhanSu");
     }
 }
コード例 #4
0
 public Models.ThamGiaChinhTriXaHois Find(int _thamgiatochucID)
 {
     Models.EmployeeManagementEntities db        = new EmployeeManagementEntities();
     Models.ThamGiaChinhTriXaHois      thamgiaTC = db.ThamGiaChinhTriXaHois.FirstOrDefault(x => x.TGCTXHID == _thamgiatochucID);
     return(thamgiaTC);
 }