示例#1
0
 private void btnXoa_Click(object sender, EventArgs e)
 {
     using (CUAHANGTIENLOI db = new CUAHANGTIENLOI())
     {
         NHACUNGCAP ncc = db.NHACUNGCAPs.Where(p => p.MANCC.ToString() == txtMaNCC.Text).FirstOrDefault();
         db.NHACUNGCAPs.Remove(ncc);
         db.SaveChanges();
     }
     loadDL();
 }
示例#2
0
 private void btnSua_Click(object sender, EventArgs e)
 {
     using (CUAHANGTIENLOI db = new CUAHANGTIENLOI())
     {
         NHACUNGCAP ncc = db.NHACUNGCAPs.Where(p => p.MANCC.ToString() == txtMaNCC.Text).FirstOrDefault();
         ncc.TENNCC = txtTenNCC.Text;
         ncc.SDT    = txtSDT.Text;
         ncc.GMAIL  = txtGmail.Text;
         ncc.DIACHI = txtDiaChi.Text;
         db.SaveChanges();
     }
     loadDL();
 }
示例#3
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     using (CUAHANGTIENLOI db = new CUAHANGTIENLOI())
     {
         NHACUNGCAP ncc = new NHACUNGCAP();
         ncc.TENNCC = txtTenNCC.Text;
         ncc.SDT    = txtSDT.Text;
         ncc.GMAIL  = txtGmail.Text;
         ncc.DIACHI = txtDiaChi.Text;
         db.NHACUNGCAPs.Add(ncc);
         db.SaveChanges();
     }
     loadDL();
 }