Beispiel #1
0
 ///////////
 public void delGV_HP_dal(Entity.GV_HP gvhp)
 {
     using (Context m = new Context())
     {
         Entity.GV_HP del = m.GV_HPs.Where(p => p.MSGV == gvhp.MSGV && p.MSHP == gvhp.MSHP).Select(p => p).SingleOrDefault();
         if (del != null)
         {
             m.GV_HPs.Remove(del);
             m.SaveChanges();
         }
     }
 }
Beispiel #2
0
 public void addGV_HP_dal(Entity.GV_HP gvhp)
 {
     using (Context m = new Context())
     {
         m.GV_HPs.Add(new Entity.GV_HP
         {
             MSGV = gvhp.MSGV,
             MSHP = gvhp.MSHP
         });
         m.SaveChanges();
     }
 }
Beispiel #3
0
            protected override void Seed(Context context)
            {
                Entity.GiangVien gv1 = new Entity.GiangVien();
                gv1.MSGV     = "GV001";
                gv1.TenGV    = "Nguyễn Thu Thảo";
                gv1.GioiTinh = false;
                gv1.HocHam   = "Giáo sư";
                gv1.NgaySinh = Convert.ToDateTime("1997-12-12");
                gv1.HocVi    = "Tiến sĩ";;
                gv1.Khoa     = "CNTT";

                Entity.HocPhan hp1 = new Entity.HocPhan();
                hp1.MSHP  = "HP001";
                hp1.TenHP = "Lập trình Java";

                Entity.GV_HP gv_hp1 = new Entity.GV_HP();
                gv_hp1.MSGV = "GV001";
                gv_hp1.MSHP = "HP001";

                context.GiangViens.Add(gv1);
                context.HocPhans.Add(hp1);
                context.GV_HPs.Add(gv_hp1);
                context.SaveChanges();
            }
Beispiel #4
0
 public void delGV_HP_bll(Entity.GV_HP gvhp)
 {
     dal.delGV_HP_dal(gvhp);
 }
Beispiel #5
0
 public void addGV_HP_bll(Entity.GV_HP gvhp)
 {
     dal.addGV_HP_dal(gvhp);
 }