public static int tinhThamNienTaiTruong(HRMDB0Entities db, NhanVien nv)
 {
     return((int)LoadMethod(Library, "tinhThamNienTaiTruong")
            .Invoke(null, new object[]
     {
         db, nv
     }));
 }
 public static int tinhThamNienGiangDay(HRMDB0Entities db, int NhanVien_id)
 {
     return((int)LoadMethod(Library, "tinhThamNienGiangDay_id")
            .Invoke(null, new object[]
     {
         db, NhanVien_id
     }));
 }
 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);
 }
Exemple #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();
     }
 }
Exemple #8
0
 public static int SqlExecute(this HRMDB0Entities db, string query, params object[] parameters)
 {
     return(db.Database.SqlExecute(query, parameters));
 }
Exemple #9
0
 public static DataTable SqlQuery(this HRMDB0Entities db, string sql, params object[] parameters)
 {
     return(db.Database.SqlQuery(sql, parameters));
 }
        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));
 }
Exemple #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));
 }
Exemple #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));
        }