public BaoHiemXaHoi GetObjectByMaVienChuc(string mavienchuc) { VienChucRepository vienChucRepository = new VienChucRepository(_db); int idvienchuc = vienChucRepository.GetIdVienChuc(mavienchuc); return(_db.BaoHiemXaHois.Where(x => x.idVienChuc == idvienchuc).FirstOrDefault()); }
public int GetIdBaoHiemXaHoiByMaVienChuc(string maVienChuc) { VienChucRepository vienChucRepository = new VienChucRepository(_db); int idvienchuc = vienChucRepository.GetIdVienChuc(maVienChuc); return(_db.BaoHiemXaHois.Where(x => x.idVienChuc == idvienchuc).Select(y => y.idBaoHiemXaHoi).FirstOrDefault()); }
public TrangThaiVienChuc GetTrangThaiHienTai(string mavienchuc) { VienChucRepository vienChucRepository = new VienChucRepository(_db); int idvienchuc = vienChucRepository.GetIdVienChuc(mavienchuc); TrangThaiVienChuc trangThaiHienTai = _db.TrangThaiVienChucs.Where(x => x.idVienChuc == idvienchuc && !x.TrangThai.tenTrangThai.Contains("Đang làm")).OrderByDescending(y => y.idTrangThaiVienChuc).FirstOrDefault(); return(trangThaiHienTai); }
public void InsertFirstRowDefault(string mavienchuc) { VienChucRepository vienChucRepository = new VienChucRepository(_db); int idvienchuc = vienChucRepository.GetIdVienChuc(mavienchuc); TrangThaiVienChuc trangThaiVienChuc = new TrangThaiVienChuc(); trangThaiVienChuc.idVienChuc = idvienchuc; trangThaiVienChuc.idTrangThai = _db.TrangThais.Where(x => x.tenTrangThai == "Đang làm việc").Select(y => y.idTrangThai).FirstOrDefault(); _db.TrangThaiVienChucs.Add(trangThaiVienChuc); }
public bool CheckExistsAnyRow(string mavienchuc) { VienChucRepository vienChucRepository = new VienChucRepository(_db); int idvienchuc = vienChucRepository.GetIdVienChuc(mavienchuc); int idTrangThaiVienChuc = _db.TrangThaiVienChucs.Where(x => x.idVienChuc == idvienchuc).Select(y => y.idTrangThaiVienChuc).FirstOrDefault(); if (idTrangThaiVienChuc > 0) { return(true); } return(false); }
public BindingList <QuaTrinhGianDoanBaoHiemXaHoi> GetListQuaTrinhGianDoan(string maVienChuc) { BindingList <QuaTrinhGianDoanBaoHiemXaHoi> bdlist = new BindingList <QuaTrinhGianDoanBaoHiemXaHoi>(); VienChucRepository vienChucRepository = new VienChucRepository(_db); int idvienchuc = vienChucRepository.GetIdVienChuc(maVienChuc); var anonymlist = _db.QuaTrinhGianDoanBaoHiemXaHois.Where(x => x.idVienChuc == idvienchuc).Select(y => new { y.idQuaTrinhGianDoan, y.idVienChuc, y.lyDo, y.ngayBatDau, y.ngayKetThuc }).ToList(); for (int i = anonymlist.Count - 1; i >= 0; i--) { bdlist.Add(new QuaTrinhGianDoanBaoHiemXaHoi { idQuaTrinhGianDoan = anonymlist[i].idQuaTrinhGianDoan, idVienChuc = anonymlist[i].idVienChuc, lyDo = anonymlist[i].lyDo, ngayBatDau = anonymlist[i].ngayBatDau, ngayKetThuc = anonymlist[i].ngayKetThuc }); } return(bdlist); }
public List <QuaTrinhDanhGiaVienChucForView> GetListQuaTrinhDanhGia(string mavienchuc) { VienChucRepository vienChucRepository = new VienChucRepository(_db); int idvienchuc = vienChucRepository.GetIdVienChuc(mavienchuc); var anonymList = _db.QuaTrinhDanhGiaVienChucs.Where(x => x.idVienChuc == idvienchuc).Select(y => new { y.idQuaTrinhDanhGiaVienChuc, y.DanhMucThoiGian.tenDanhMucThoiGian, y.ngayBatDau, y.ngayKetThuc, y.MucDoDanhGia.tenMucDoDanhGia }).ToList(); List <QuaTrinhDanhGiaVienChucForView> listQuaTrinh = new List <QuaTrinhDanhGiaVienChucForView>(); for (int i = anonymList.Count - 1; i >= 0; i--) { listQuaTrinh.Add(new QuaTrinhDanhGiaVienChucForView { Id = anonymList[i].idQuaTrinhDanhGiaVienChuc, KhoangThoiGian = anonymList[i].tenDanhMucThoiGian, NgayBatDau = anonymList[i].ngayBatDau, NgayKetThuc = anonymList[i].ngayKetThuc, MucDoDanhGia = anonymList[i].tenMucDoDanhGia }); } return(listQuaTrinh); }
public List <QuaTrinhPhuCapThamNienNhaGiao> GetListQuaTrinhPhuCap(string mavienchuc) { VienChucRepository vienChucRepository = new VienChucRepository(_db); int idvienchuc = vienChucRepository.GetIdVienChuc(mavienchuc); var anonymList = _db.QuaTrinhPhuCapThamNienNhaGiaos.Where(x => x.idVienChuc == idvienchuc).Select(y => new { y.idQuaTrinhPhuCap, y.idVienChuc, y.heSoPhuCap, y.ngayBatDau, y.ngayNangPhuCap, y.linkVanBanDinhKem }).ToList(); List <QuaTrinhPhuCapThamNienNhaGiao> listQuaTrinh = new List <QuaTrinhPhuCapThamNienNhaGiao>(); for (int i = anonymList.Count - 1; i >= 0; i--) { listQuaTrinh.Add(new QuaTrinhPhuCapThamNienNhaGiao { idQuaTrinhPhuCap = anonymList[i].idQuaTrinhPhuCap, idVienChuc = anonymList[i].idVienChuc, heSoPhuCap = anonymList[i].heSoPhuCap, ngayBatDau = anonymList[i].ngayBatDau, ngayNangPhuCap = anonymList[i].ngayNangPhuCap, linkVanBanDinhKem = anonymList[i].linkVanBanDinhKem }); } return(listQuaTrinh); }