using HeenaTravel.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Mail; using System.Text; using System.Web; using System.Web.Mvc; namespace HeenaTravel.Controllers { public class HomeController : Controller { // // GET: /Home/ ConnectionManager cmd = new ConnectionManager(); public ActionResult Index() { return View(); } public ActionResult AboutUs() { return View(); } [HttpGet] public ActionResult ContactUs() { return View(); } [HttpPost] public ActionResult ContactUs(string name, string email, string mob, string msg) { EmailSender em = new EmailSender(); string sendto = email; string subject = "Message From V Touch Solutions"; string body = "Hello ! Name is : " + name + ", Email : "+ email +", Mobile : " + mob + ", and Msg : " + msg + ""; cmd.Command = "insert into contact values('" + name + "','" + email + "','" + mob + "','" + msg + "','" + DateTime.Now.ToString() + "')"; if (cmd.ExecuteInsertUpdateAndDelete()) { if (em.SendEmail(sendto, body, subject)) { ViewBag.res = "Thanks! for contacting."; } else { Response.Write(""); } // Response.Write(""); } else { Response.Write(""); } return View(); } public ActionResult Gallery() { return View(); } [HttpGet] public ActionResult Haj() { return View(); } [HttpPost] public ActionResult Haj(string email, string mob) { cmd.Command = "insert into cto values('" + email + "','" + mob + "','" + DateTime.Now.ToString() + "')"; if (cmd.ExecuteInsertUpdateAndDelete() == true) { ViewBag.tab = "Thanks! for Contacting"; } else { Response.Write(""); } return View(); } public ActionResult Umrah() { return View(); } public ActionResult Ziyarat() { return View(); } } }