Beispiel #1
0
    private DinhBienNhanSuInfo DinhBienNhanSuToDinhBienNhanSuInfo(DAL.DinhBienNhanSu dbns)
    {
        var re = new DinhBienNhanSuInfo();

        re.ID         = dbns.ID;
        re.Nam        = dbns.Nam;
        re.Thang1     = dbns.Thang1;
        re.Thang2     = dbns.Thang2;
        re.Thang3     = dbns.Thang3;
        re.Thang4     = dbns.Thang4;
        re.Thang5     = dbns.Thang5;
        re.Thang6     = dbns.Thang6;
        re.Thang7     = dbns.Thang7;
        re.Thang8     = dbns.Thang8;
        re.Thang9     = dbns.Thang9;
        re.Thang10    = dbns.Thang10;
        re.Thang11    = dbns.Thang11;
        re.Thang12    = dbns.Thang12;
        re.MaDonVi    = dbns.MaDonVi;
        re.MaChucVu   = dbns.MaChucVu ?? string.Empty;
        re.MaCongViec = dbns.MaCongViec ?? string.Empty;
        re.MaHopDong  = dbns.MaHopDong ?? string.Empty;
        re.TenDonVi   = dbns.DM_DONVI.TEN_DONVI ?? string.Empty;
        if (!string.IsNullOrEmpty(re.MaChucVu))
        {
            re.TenChucVu = dbns.DM_CHUCVU.TEN_CHUCVU ?? string.Empty;
        }
        if (!string.IsNullOrEmpty(re.MaCongViec))
        {
            re.TenCongViec = dbns.DM_CONGVIEC.TEN_CONGVIEC ?? string.Empty;
        }
        re.SoLuongNhanSu   = dbns.SoLuongNhanSu ?? 0;
        re.SoLuongDinhBien = dbns.SoLuongDinhBien ?? 0;
        re.SoLuongTuyenMoi = dbns.SoLuongTuyenMoi ?? 0;
        re.CreatedDate     = dbns.CreatedDate;
        re.CreatedBy       = dbns.CreatedBy;
        re.GhiChu          = dbns.GhiChu;
        re.MaChucVu        = dbns.MaChucVu;
        re.Order           = dbns.DM_DONVI.ORDER;
        re.TinhDenNgay     = dbns.TinhDenNgay;
        return(re);
    }
Beispiel #2
0
 public int Edit(DAL.DinhBienNhanSu dbns)
 {
     dataContext.DinhBienNhanSus.Attach(dbns, true);
     Save();
     return(dbns.ID);
 }
Beispiel #3
0
 public int Add(DAL.DinhBienNhanSu dbns)
 {
     dataContext.DinhBienNhanSus.InsertOnSubmit(dbns);
     Save();
     return(dbns.ID);
 }