Exemplo n.º 1
0
 public static int tinhThamNienTaiTruong(HRMDB0Entities db, NhanVien nv)
 {
     return((int)LoadMethod(Library, "tinhThamNienTaiTruong")
            .Invoke(null, new object[]
     {
         db, nv
     }));
 }
Exemplo n.º 2
0
 public static int tinhThamNienGiangDay(HRMDB0Entities db, int NhanVien_id)
 {
     return((int)LoadMethod(Library, "tinhThamNienGiangDay_id")
            .Invoke(null, new object[]
     {
         db, NhanVien_id
     }));
 }
Exemplo n.º 3
0
 public static string getDuongDanTapTin(HttpServerUtilityBase server, HRMDB0Entities db, int TaiNguyen_id)
 {
     return(LoadMethod(Library, "getDuongDanTapTin")
            .Invoke(null, new object[]
     {
         server, db, TaiNguyen_id
     }) as string);
 }
Exemplo n.º 4
0
        public static string getDuongDanTapTin(HttpServerUtilityBase server, HRMDB0Entities db, int TaiNguyen_id)
        {
            var tn = db.TaiNguyen.Find(TaiNguyen_id);

            if (tn == null || tn.laThuMuc)
            {
                return(String.Empty);
            }
            return(Path.Combine(server.MapPath(App_Root), tn.getFolder(), tn.tepDinhKem));
        }
        public static int tinhThamNienGiangDay(HRMDB0Entities db, NhanVien nv)
        {
            var tongThoiGian = new DateRanges();

            foreach (var ct in db.nvQTLamViec.Where(ct => ct.NV_id == nv.id)
                     .Where(ct => ct.ChucDanhChucVu_id.HasValue && ct.ChucDanhChuyenMon.laDayHoc))
            {
                /*if (ct.ChucDanhChuyenMon.tenChucDanhChuyenMon.ToLower().Contains("giảng")
                || ct.ChucDanhChuyenMon.tenChucDanhChuyenMon.ToLower().Contains("giáo"))*/
                tongThoiGian.Add(ct.ThoiGianBatDau, ct.ThoiGianKetThuc);
            }
            return(tongThoiGian.ToMonths() +
                   db.NhanViens.All.Find(nv.id).nvTTMoRongs.Single().ThamNienGiangDay_Truoc);
        }
        public static int tinhThamNienTaiTruong(HRMDB0Entities db, NhanVien nv)
        {
            var tongThoiGian = new DateRanges();

            foreach (var ct in db.nvQTLamViec.Where(ct => ct.NV_id == nv.id))
            {
                tongThoiGian.Add(ct.ThoiGianBatDau, ct.ThoiGianKetThuc);
            }
            foreach (var lv in db.nvQTNghiNganHan.Where(lv => lv.CongTac.NV_id == nv.id))
            {
                tongThoiGian.Sub(lv.NgayBatDau, lv.NgayKetThuc);
            }
            return(tongThoiGian.ToMonths());
        }
 public static void SendMessage(string users, string content)
 {
     using (var db = new HRMDB0Entities())
     {
         var message = new Message
         {
             Date    = DateTime.Now,
             Content = content,
             Read    = "", Star = ""
         };
         if (users.Contains("*"))
         {
             users = String.Join(",", HRM.Services.Webpages.getUsernames());
         }
         message.Users = String.Join("", users.Split(',')
                                     .Select(u => String.Format("|{0}|", u.Trim().ToLower())).ToArray());
         db.Message.Add(message);
         db.SaveChanges();
     }
 }
Exemplo n.º 8
0
 public static int SqlExecute(this HRMDB0Entities db, string query, params object[] parameters)
 {
     return(db.Database.SqlExecute(query, parameters));
 }
Exemplo n.º 9
0
 public static DataTable SqlQuery(this HRMDB0Entities db, string sql, params object[] parameters)
 {
     return(db.Database.SqlQuery(sql, parameters));
 }
Exemplo n.º 10
0
        public static HRM.Databases.Models.DiaPhuong getNoiSinh(this nvSoYeuLyLich model, HRMDB0Entities db)
        {
            var obj = db.DiaPhuong.Find(model.NoiSinh_id);

            return(obj != null ? obj : new HRM.Databases.Models.DiaPhuong());
        }
 private static int tinhThamNienTaiTruong_nv(HRMDB0Entities db, NhanVien nv)
 {
     return(tinhThamNienTaiTruong(db, nv));
 }
Exemplo n.º 12
0
 public static string SqlCreate(this HRMDB0Entities db, string name, NameValueCollection form)
 {
     return(db.Database.SqlCreate(name, form));
 }
 private static int tinhThamNienTaiTruong_id(HRMDB0Entities db, int NhanVien_id)
 {
     return(tinhThamNienTaiTruong(db, NhanVien_id));
 }
 private static int tinhThamNienGiangDay_nv(HRMDB0Entities db, NhanVien nv)
 {
     return(tinhThamNienGiangDay(db, nv));
 }
 private static int tinhThamNienGiangDay_id(HRMDB0Entities db, int NhanVien_id)
 {
     return(tinhThamNienGiangDay(db, NhanVien_id));
 }
Exemplo n.º 16
0
 public static string SqlDelete(this HRMDB0Entities db, string name, int id)
 {
     return(db.Database.SqlDelete(name, id));
 }
        public static int tinhThamNienTaiTruong(HRMDB0Entities db, int NhanVien_id)
        {
            var nv = db.NhanViens.All.Find(NhanVien_id);

            return(tinhThamNienTaiTruong(db, nv));
        }