public ActionResult Detail(FormCollection form, int id) { tblInquiry Inq = dc.tblInquiries.SingleOrDefault(ob => ob.InquiryId == id); Inq.RepliedText = form["txtReply"]; Inq.RepliedBy = Convert.ToInt32(Session["LogID"]); Inq.IsReplied = true; dc.SaveChanges(); // Email Code MailMessage Msg = new MailMessage("*****@*****.**", Inq.EmailId); Msg.Subject = "Reply of Your Inquiry"; Msg.Body = form["txtReply"]; Msg.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.UseDefaultCredentials = false; smtp.EnableSsl = true; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; NetworkCredential MyCredentials = new NetworkCredential("*****@*****.**", "nkp12345"); smtp.Credentials = MyCredentials; smtp.Send(Msg); return(RedirectToAction("Index", "Inquiry")); }
protected void rptin_ItemCommand(object source, RepeaterCommandEventArgs e) { try { var DC = new DataClassesDataContext(); if (e.CommandName == "Notify") { tblInquiry result = (from u in DC.tblInquiries where u.InquiryID == Convert.ToInt32(e.CommandArgument) select u).Single(); if (result.IsNotify == false) { //Session["InquiryID"] = result.InquiryID; //Response.Redirect("ReplyInquiry.aspx"); } else { result.IsNotify = false; } DC.SubmitChanges(); } binddata(); } catch (Exception ex) { int session = Convert.ToInt32(Session["AdminID"].ToString()); string PageName = System.IO.Path.GetFileName(Request.Url.AbsolutePath); string MACAddress = GetMacAddress(); AddErrorLog(ref ex, PageName, "Admin", 0, session, MACAddress); ClientScript.RegisterStartupScript(GetType(), "abc", "alert('Something went wrong! Try again');", true); } }
public ActionResult SaveInquiry(tblInquiry model) { if (ModelState.IsValid) { using (StudioCraftEntities context = CustomRepository.GetDbContext()) { context.tblInquiry.Add(model); context.SaveChanges(); } string bodyTemplate = System.IO.File.ReadAllText(Server.MapPath("~/Template/InquiryTemplate.html")); bodyTemplate = bodyTemplate.Replace("[@NAME]", model.Name); bodyTemplate = bodyTemplate.Replace("[@EMAIL]", model.Email); bodyTemplate = bodyTemplate.Replace("[@BUDGET]", model.Budget); bodyTemplate = bodyTemplate.Replace("[@MESSAGE]", model.Message); bodyTemplate = bodyTemplate.Replace("[@REGARDING]", model.Regarding); Task task = new Task(() => EmailHelper.SendMail("Studio Craft - New Inquiry", bodyTemplate, true)); task.Start(); return(RedirectToAction("ThankYou")); } return(View("Index")); }
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if ((e.Item) is GridDataItem) { if (string.IsNullOrEmpty(_DateTimeFormat)) { _DateTimeFormat = ConfigurationManager.AppSettings["DateTimeFormat"].ToString(); } tblInquiry ent = (tblInquiry)e.Item.DataItem; GridDataItem item = (GridDataItem)e.Item; HyperLink link = (HyperLink)item["Subject"].FindControl("lnkSubject"); Label time = (Label)item["Time"].FindControl("lblTime"); Label email = (Label)item["Email"].FindControl("lblEmail"); Label phone = (Label)item["Phone"].FindControl("lblPhone"); if (link != null && !string.IsNullOrEmpty(ent.ID.ToString())) { link.NavigateUrl = link.NavigateUrl + ent.ID.ToString(); } if (time != null && !string.IsNullOrEmpty(ent.TimeStamp.ToString())) { time.Text = ent.TimeStamp.ToString(_DateTimeFormat); } if (!ent.IsRead) { time.CssClass = _TEXTBOX; email.CssClass = _TEXTBOX; phone.CssClass = _TEXTBOX; } } }
public bool Save() { tblInquiry objInquiry = new tblInquiry(); objInquiry.AddNew(); objInquiry.s_AppName = txtName.Text; objInquiry.s_AppEmail = txtEmail.Text; objInquiry.s_AppMobile = txtMobile.Text; objInquiry.s_AppMessage = txtMessage.Text; objInquiry.s_AppProductDetailID = hdnProductDetailId.Value; objInquiry.Save(); objInquiry = null; clsCommon objCommon = new clsCommon(); string StrBody = ""; string strSubject = "Inquiry"; StrBody = objCommon.readFile(Server.MapPath("~/EmailTemplates/Inquiry.html")); StrBody = StrBody.Replace("`name`", txtName.Text); StrBody = StrBody.Replace("`mobileno`", txtMobile.Text); StrBody = StrBody.Replace("`email`", txtEmail.Text); StrBody = StrBody.Replace("`message`", txtMessage.Text); objCommon.SendMail("", strSubject, StrBody); objCommon = null; return(true); }
public void DeleteSelected() { bool isNeedSubmit = false; List <tblInquiry> inquiries = new List <tblInquiry>(); foreach (GridDataItem item in RadGrid1.MasterTableView.Items) { if (item.Selected) { string strID = ((Telerik.Web.UI.GridEditableItem)(item)).KeyValues.Split(new char[] { '"' })[1]; if (!string.IsNullOrEmpty(strID)) { tblInquiry inq = GoProGoDC.ProfileDC.tblInquiries.Where(a => a.ID == int.Parse(strID)).SingleOrDefault <tblInquiry>(); if (inq != null) { inquiries.Add(inq); } isNeedSubmit = true; } } } if (isNeedSubmit) { GoProGoDC.ProfileDC.tblInquiries.DeleteAllOnSubmit(inquiries); GoProGoDC.ProfileDC.SubmitChanges(); PopulateControl(true); } }
public ActionResult DeleteConfirmed(int id) { tblInquiry tblInquiry = db.tblInquiries.Find(id); db.tblInquiries.Remove(tblInquiry); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "IDInquiry,InquiryDate,Codep,ContactNo,Prospect,Details,FollowupOn,IDInquiryStatus")] tblInquiry tblInquiry) { if (ModelState.IsValid) { db.Entry(tblInquiry).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblInquiry)); }
public ActionResult Create([Bind(Include = "IDInquiry,InquiryDate,Codep,ContactNo,Prospect,Details,FollowupOn,IDInquiryStatus")] tblInquiry tblInquiry) { if (ModelState.IsValid) { db.tblInquiries.Add(tblInquiry); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tblInquiry)); }
protected void btnInqSubmit_Click(object sender, EventArgs e) { if (CheckForInternetConnection() == true) { try { objPostOroject.AddInquiry(txtFName.Text + " " + txtLName.Text, txtInqEmail.Text, txtInqMNO.Text, txtProjInq.Text); //ClientScript.RegisterClientScriptBlock(GetType(), "Javascript", "<script>alert('Inquiry Successfully Submitted');window.location ='Default.aspx'</script>"); //EmailSend To User var DC = new DataClassesDataContext(); //IList<string> vc; tblInquiry InquiryID = (from obj in DC.tblInquiries orderby obj.InquiryID descending select obj).First(); tblInquiry Client = (from obj in DC.tblInquiries where obj.EmailID == InquiryID.EmailID select obj).Single(); DateTime now = DateTime.Now; MailMessage Msg = new MailMessage("*****@*****.**", InquiryID.EmailID); Msg.Subject = "Inquiry"; //Msg.Body = "<html><head></head><body><table><tr><td>Your E-Mail :</td><td>" + InquiryID.EmailID + "</td><br></tr><tr><p><td>" + "Your inquiry Successfull recieved and inquiry under process" + "</td></p></tr></table></body></html>"; Msg.Body = "<!DOCTYPE html><html><head><title>Track My Work</title> <meta charset=\"utf - 8\"><meta name=\"viewport\" content=\"width = device - width, initial - scale = 1\"><meta http-equiv=\"X - UA - Compatible\" content=\"IE = edge\" /><style type=\"text / css\"> /* CLIENT-SPECIFIC STYLES */ body, table, td, a{-webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;} /* Prevent WebKit and Windows mobile changing default text sizes */ table, td{mso-table-lspace: 0pt; mso-table-rspace: 0pt;} /* Remove spacing between tables in Outlook 2007 and up */ img{-ms-interpolation-mode: bicubic;} /* Allow smoother rendering of resized image in Internet Explorer */ /* RESET STYLES */ img{border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none;} table{border-collapse: collapse !important;} body{height: 100% !important; margin: 0 !important; padding: 0 !important; width: 100% !important;} /* iOS BLUE LINKS */ a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; font-size: inherit !important; font-family: inherit !important; font-weight: inherit !important; line-height: inherit !important; } /* MOBILE STYLES */ @media screen and (max-width: 525px) { /* ALLOWS FOR FLUID TABLES */ .wrapper { width: 100% !important; max-width: 100% !important; } /* ADJUSTS LAYOUT OF LOGO IMAGE */ .logo img { margin: 0 auto !important; } /* USE THESE CLASSES TO HIDE CONTENT ON MOBILE */ .mobile-hide { display: none !important; } .img-max { max-width: 100% !important; width: 100% !important; height: auto !important; } /* FULL-WIDTH TABLES */ .responsive-table { width: 100% !important; } /* UTILITY CLASSES FOR ADJUSTING PADDING ON MOBILE */ .padding { padding: 10px 5% 15px 5% !important; } .padding-meta { padding: 30px 5% 0px 5% !important; text-align: center; } .no-padding { padding: 0 !important; } .section-padding { padding: 50px 15px 50px 15px !important; } /* ADJUST BUTTONS ON MOBILE */ .mobile-button-container { margin: 0 auto; width: 100% !important; } .mobile-button { padding: 15px !important; border: 0 !important; font-size: 16px !important; display: block !important; } } /* ANDROID CENTER FIX */ div[style*=\"margin: 16px 0; \"] { margin: 0 !important; }</style></head><body style=\"margin: 0 !important; padding: 0 !important; \"><!-- HIDDEN PREHEADER TEXT --><div style=\"display: none; font - size: 1px; color: #fefefe; line-height: 1px; font-family: Helvetica, Arial, sans-serif; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden;\"> Entice the open with some amazing preheader text. Use a little mystery and get those subscribers to read through...</div><!-- HEADER --><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"> <tr> <td align=\"center\" style=\" background:#008bff;\"> <!--[if (gte mso 9)|(IE)]> <table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"500\"> <tr> <td align=\"center\" valign=\"top\" width=\"500\"> <![endif]--> <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"max-width: 500px;\" class=\"wrapper\"> <tr style=\" background:#008bff;\"> <td align=\"center\" valign=\"top\" style=\"padding: 15px 0;\" class=\"logo\"> <h1 style=\"color:white; background:#008bff; font-family:calibri; font-size:40px;\">Track My Work</h1> </td> </tr> </table> <!--[if (gte mso 9)|(IE)]> </td> </tr> </table> <![endif]--> </td> </tr> <tr> <td bgcolor=\"#ffffff\" align=\"center\" style=\"padding: 70px 15px 70px 15px;\" class=\"section-padding\"> <!--[if (gte mso 9)|(IE)]> <table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"500\"> <tr> <td align=\"center\" valign=\"top\" width=\"500\"> <![endif]--> <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"max-width: 500px;\" class=\"responsive-table\"> <tr> <td> <!-- HERO IMAGE --> <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td> <!-- COPY --> <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td align=\"center\" style=\"font-size: 25px; font-family: Helvetica, Arial, sans-serif; color: #333333; padding-top: 30px;\" class=\"padding\">Your Email id is</td> </tr> <tr> <td align=\"center\" style=\"padding: 20px 0 0 0; font-size: 16px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #666666;\" class=\"padding\">"+ InquiryID.EmailID +"</td> </tr> <tr> <td align=\"center\" style=\"font-size: 25px; font-family: Helvetica, Arial, sans-serif; color: #333333; padding-top: 30px;\" class=\"padding\">Your Inquiry Successfully Submitted</td> </tr> <tr> <td align=\"center\" style=\"padding: 20px 0 0 0; font-size: 16px; line-height: 25px; font-family: Helvetica, Arial, sans-serif; color: #666666;\" class=\"padding\"></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <!--[if (gte mso 9)|(IE)]> </td> </tr> </table> <![endif]--> </td> </tr> <tr> <td align=\"center\" style=\"padding: 20px 0px; background:#424242; color:white;\"> <!--[if (gte mso 9)|(IE)]> <table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"500\"> <tr> <td align=\"center\" valign=\"top\" width=\"500\"> <![endif]--> <!-- UNSUBSCRIBE COPY --> <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"max-width: 500px;\" class=\"responsive-table\"> <tr> <td align=\"center\" style=\"font-size: 12px; line-height: 18px; font-family: Helvetica, Arial, sans-serif; color:white;\"> <b>Track My Work</b> by:- Renown Infosys <span style=\"font-family: Arial, sans-serif; font-size: 12px; color:white;\"> </span> </td> </tr> </table> <!--[if (gte mso 9)|(IE)]> </td> </tr> </table> <![endif]--> </td> </tr></table></body></html>"; Msg.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.UseDefaultCredentials = false; smtp.EnableSsl = true; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; NetworkCredential MyCredentials = new NetworkCredential("*****@*****.**", "TMW2016open"); smtp.Credentials = MyCredentials; smtp.Send(Msg); //vc = new string[] { Admin.Password }; Response.Redirect("Default.aspx"); } catch (Exception ex) { //int session = Convert.ToInt32(Session["ClientID"].ToString()); string PageName = System.IO.Path.GetFileName(Request.Url.AbsolutePath); string MACAddress = GetMacAddress(); AddErrorLog(ref ex, PageName, "Client", 0, 0, MACAddress); ClientScript.RegisterStartupScript(GetType(), "abc", "alert('Something went wrong! Try again');", true); } } else { ClientScript.RegisterStartupScript(GetType(), "abc", "alert('Please Check your Internet Connection');", true); } }
protected void Page_Load(object sender, EventArgs e) { try { //Response.Write(Session["AdminID"]); if (Session["AdminID"] == null) { Response.Redirect("Login.aspx"); } var DC = new DataClassesDataContext(); tblAdmin AdminData = DC.tblAdmins.Single(ob => ob.AdminID == Convert.ToInt32(Session["AdminID"])); if (AdminData.IsUpdate == false) { divPage.Visible = false; divPage.Visible = true; } else if (AdminData.IsInsert == false) { divPage.Visible = false; divPage.Visible = true; } if (!IsPostBack) { BindData(); FillCountryDropDown(); } else { //txtPassword.Text = ViewState["txtPassword"].ToString(); } if (Request.QueryString["InquiryID"] != null) { var dc = new DataClassesDataContext(); tblInquiry Data = (from obj in dc.tblInquiries where obj.InquiryID == Convert.ToInt32(Request.QueryString["InquiryID"]) select obj).Single(); txtname.Text = Data.Name; txtCNO.Text = Data.ContactNo; txtEmail.Text = Data.EmailID; } } catch (Exception ex) { int session = Convert.ToInt32(Session["AdminID"].ToString()); string PageName = System.IO.Path.GetFileName(Request.Url.AbsolutePath); string MACAddress = GetMacAddress(); AddErrorLog(ref ex, PageName, "Admin", 0, session, MACAddress); ClientScript.RegisterStartupScript(GetType(), "abc", "alert('Something went wrong! Try again');", true); } }
private bool Delete(int intPKID) { bool retval = false; objInquiry = new tblInquiry(); if (objInquiry.LoadByPrimaryKey(intPKID)) { objInquiry.MarkAsDeleted(); objInquiry.Save(); } retval = true; objInquiry = null; return(retval); }
// GET: Inquiries/Details/5 public ActionResult Details(int?IDInquiry) { if (IDInquiry == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblInquiry tblInquiry = db.tblInquiries.Find(IDInquiry); if (tblInquiry == null) { return(HttpNotFound()); } return(View(tblInquiry)); }
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataItem = (GridDataItem)e.Item; String id = dataItem.GetDataKeyValue("ID").ToString(); tblInquiry fav = GoProGoDC.ProfileDC.tblInquiries.Where(a => a.ID == int.Parse(id)).SingleOrDefault <tblInquiry>(); GoProGoDC.ProfileDC.tblInquiries.DeleteOnSubmit(fav); GoProGoDC.ProfileDC.SubmitChanges(); PopulateControl(true); } }
// GET: Inquiries/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblInquiry tblInquiry = db.tblInquiries.Find(id); if (tblInquiry == null) { return(HttpNotFound()); } return(View(tblInquiry)); }
public ActionResult Index(FormCollection form) { tblInquiry inquiry = new tblInquiry(); inquiry.FirstName = form["txtName"]; inquiry.EmailId = form["txtEmail"]; inquiry.ContactNo = form["txtContact"]; inquiry.Subject = form["txtSubject"]; inquiry.Desc = form["txtMessage"]; inquiry.CreatedOn = DateTime.Now; inquiry.IsReplied = false; dc.tblInquiries.Add(inquiry); dc.SaveChanges(); return(RedirectToAction("Blank", "Home")); }
public JsonResult Active(int id) { tblInquiry com = dc.tblInquiries.SingleOrDefault(ob => ob.InquiryId == id); if (com.IsReplied == true) { com.IsReplied = false; } else { com.IsReplied = true; } dc.SaveChanges(); return(Json(com.IsReplied, JsonRequestBehavior.AllowGet)); }
public ActionResult Index(FormCollection form) { tblInquiry Inq = new tblInquiry(); Inq.FirstName = form["txtFname"]; Inq.LastName = form["txtLname"]; Inq.ContactNo = form["txtContactNo"]; Inq.EmailId = form["txtEmail"]; Inq.Subject = form["txtSubject"]; Inq.Desc = form["txtDesc"]; Inq.CreatedOn = DateTime.Now; dc.tblInquiries.Add(Inq); dc.SaveChanges(); return(RedirectToAction("Index", "Home")); }
private void LoadDataGrid(bool IsResetPageIndex, bool IsSort, string strFieldName = "", string strFieldValue = "") { objInquiry = new tblInquiry(); objDataTable = objInquiry.LoadGridData(ddlFields.SelectedValue, txtSearch.Text.Trim()); //'Reset PageIndex of gridviews if (IsResetPageIndex) { if (dgvGridView.PageCount > 0) { dgvGridView.PageIndex = 0; } } dgvGridView.DataSource = null; dgvGridView.DataBind(); lblCount.Text = 0.ToString(); hdnSelectedIDs.Value = ""; //'Check for data into datatable if (objDataTable.Rows.Count <= 0) { DInfo.ShowMessage("No data found", Enums.MessageType.Information); return; } else { if (ddlPerPage.SelectedItem.Text.ToLower() == "all") { dgvGridView.AllowPaging = false; } else { dgvGridView.AllowPaging = true; dgvGridView.PageSize = Convert.ToInt32(ddlPerPage.SelectedItem.Text); } lblCount.Text = objDataTable.Rows.Count.ToString(); objDataTable = SortDatatable(objDataTable, ViewState["SortColumn"].ToString(), (appFunctions.Enum_SortOrderBy)ViewState["SortOrder"], IsSort); dgvGridView.DataSource = objDataTable; dgvGridView.DataBind(); } objInquiry = null; }
protected void dgvGridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { if (e.CommandName == "View") { objInquiry = new tblInquiry(); if (objInquiry.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()))) { divTitle.InnerHtml = objInquiry.AppName; divDescription.InnerHtml = objInquiry.AppMessage; mpeview.Show(); } objInquiry = null; } } }
protected void btnsend_Click(object sender, EventArgs e) { try { var dc = new DataClassesDataContext(); tblInquiry ob = new tblInquiry(); ob.Email = txtEmail.Text; ob.ContactNO = txtContactNo.Text; ob.Discription = txtDescription.Text; ob.Createdon = DateTime.Now; ob.IsNotify = false; dc.tblInquiries.InsertOnSubmit(ob); dc.SubmitChanges(); clear(); } catch (Exception ex) { int session = Convert.ToInt32(Session["ClientID"].ToString()); string PageName = System.IO.Path.GetFileName(Request.Url.AbsolutePath); string MACAddress = GetMacAddress(); AddErrorLog(ref ex, PageName, "User", session, 0, MACAddress); ClientScript.RegisterStartupScript(GetType(), "abc", "alert('Something went wrong! Try again');", true); } }
public ActionResult Detail(int id) { tblInquiry inquirie = dc.tblInquiries.SingleOrDefault(ob => ob.InquiryId == id); return(View(inquirie)); }