private static EAD_Project.Models.reply_form FillDTO(SqlDataReader reader) { //name,email,website,message var dto = new EAD_Project.Models.reply_form(); dto.name = reader.GetString(0); dto.email = reader.GetString(1); dto.website = reader.GetString(2); dto.message = reader.GetString(3); return(dto); }
public static int Save(EAD_Project.Models.reply_form dto) { String sqlQuery = ""; sqlQuery = String.Format("INSERT INTO dbo.reply_form(name,email,website,message) VALUES('{0}','{1}','{2}','{3}')", dto.name, dto.email, dto.website, dto.message); using (DBHelper helper = new DBHelper()) { return(helper.ExecuteQuery(sqlQuery)); } }
public ActionResult reply_form(EAD_Project.Models.reply_form u) { ViewBag.Message = "Your application description page."; u = new Models.reply_form(); u.name = Request["name"]; u.email = Request["email"]; u.website = Request["website"]; u.message = Request["message"]; var obj = BAL.reply_form.Save(u); if (obj > 0) { return(Content("<script language='javascript' type='text/javascript'>alert('Thanks for Registering!');</script>")); } else { return(View()); } }