public NguoiDung(NGUOIDUNG nd) : this() { MaSoNguoiDung = nd.masonguoidung; TenNguoiDung = nd.tennguoidung; MatKhau = nd.matkhau; TenDayDu = nd.tendaydu; Email = nd.email; PhanQuyen = nd.phanquyen; TrangThai = nd.trangthai; }
public static int add(NguoiDung nguoidung) { try { using (EntitiesDataContext db = new EntitiesDataContext()) { var s = new NGUOIDUNG(); s.tennguoidung = nguoidung.TenNguoiDung; s.matkhau = nguoidung.MatKhau; s.tendaydu = nguoidung.TenDayDu; s.email = nguoidung.Email; s.phanquyen = nguoidung.PhanQuyen; s.trangthai = nguoidung.TrangThai; db.NGUOIDUNGs.InsertOnSubmit(s); db.SubmitChanges(); return s.masonguoidung; } } catch (Exception ex) { Console.WriteLine(ex.Message); return 0; } }
partial void DeleteNGUOIDUNG(NGUOIDUNG instance);
partial void UpdateNGUOIDUNG(NGUOIDUNG instance);
partial void InsertNGUOIDUNG(NGUOIDUNG instance);
public NguoiDung(NGUOIDUNG nd, DAILY dl) : this(nd) { MaSoDaiLy = dl.masodaily; DaiLy = new DaiLy(dl); }