public IActionResult LienHe(LienHeViewModel lh) { if (ModelState.IsValid) { this._lienHeService.LienHe(lh); return(View("/Views/Home/GuiThanhCong.cshtml")); } return(View()); }
public LienHe(LienHeViewModel lh) { this.ID = lh.ID; this.LoaiThongTin = lh.LoaiThongTin; this.HoTen = lh.HoTen; this.Email = lh.Email; this.Sdt = lh.Sdt; this.TenCongTy = lh.TenCongTy; this.SoKhach = lh.SoKhach; this.TieuDe = lh.TieuDe; this.NoiDung = lh.NoiDung; this.XacNhan = lh.XacNhan; }
public void LienHe(LienHeViewModel lh) { var newLH = new LienHeViewModel { LoaiThongTin = lh.LoaiThongTin, HoTen = lh.HoTen, Email = lh.Email, Sdt = lh.Sdt, TenCongTy = lh.TenCongTy, SoKhach = lh.SoKhach, TieuDe = lh.TieuDe, NoiDung = lh.NoiDung, XacNhan = 0 }; var newLienHe = new LienHe(newLH); _db.LienHes.Add(newLienHe); _db.SaveChanges(); }