public IActionResult Contact(ContactViewModal model) { if (ModelState.IsValid) { _mailService.SendMail(Startup.Configuration["AppSettings:SiteEmailAddress"], model.Email, $"sub from {model.Name}", model.Message); ModelState.Clear(); ViewBag.Message = "Mail Sent Thanks"; } return(View()); }
public ContactViewModal GetaAllContactsByAdminId(int adminId) { ContactViewModal _item = new ContactViewModal(); Global _global = new Database.Global(); CRMClassDataContext _idc = new Database.CRMClassDataContext(_global.con); try { var item = _idc.tblcontacts.Where(a => a.AdminId == adminId && a.IsActive == true).ToList(); _item.Contacts = item; } catch (Exception ex) { } finally { _idc.Dispose(); } return(_item); }
public IActionResult Contact() { var m = new ContactViewModal(); return(View(m)); }