public void insert() { string regin; if (drlistRegionCounty.Text != "") { regin = drlistRegionCounty.Text; } else { regin = txtregion.Text; } BAL.inmemorial objInmorial = new BAL.inmemorial(); objInmorial.name = txtname.Text; objInmorial.email = txtemail.Text; objInmorial.country = DropDownList1.Text; objInmorial.townCity = txtcitytown.Text; objInmorial.regionCounty = regin; objInmorial.mess = CKEditorControl1.Text; string kk = DAL.htmlromve.StripTagsRegexCompiled(CKEditorControl1.Text); objInmorial.pmess = kk; objInmorial.dessurname = txtdecsurname.Text; objInmorial.desname = txtdecname.Text; objInmorial.desemail = txtemaildes.Text; objInmorial.active = 0; objInmorial.img = fpi; DAL.general bjGen = new DAL.general(); bool f = bjGen.insertinmemorial(objInmorial); if (f) { string body = infoBody1(txtname.Text, "", txtdecname.Text, txtdecsurname.Text, CKEditorControl1.Text, fpi); DAL.general objGen = new DAL.general(); string mbody = "<p align='left'>Dear Sir/Madam,<br><br>Thank you for creating an In Memoriam Notice. It will be reviewed within 24 hours.<br>You will receive an email notification once the In Memoriam is published.<br><br><br> Thank You, <br>BMDnotices Team<p/>"; objGen.Send_Mail(txtemail.Text, "BMDnotices In Memoriam", mbody, ""); string bodym = "<p align='left'>A new In Memoriam Notice has been created on bmdnotices.com.<br> <a href='http://bmdnotices.com/AdminBMD/login.aspx' target='_blank'>Approve here</a></p>"; // string bodym = "<p align='left'>one more message added on In Memory Card. page.</p>"; DAL.general objGener = new DAL.general(); objGener.Send_Mail("*****@*****.**", "New In Memoriam For Approval", bodym, ""); Response.Redirect("thankyoupostin.aspx"); } else { ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "worn();", true); } }
protected void Button1_Click(object sender, EventArgs e) { string regin, fpi; if (drlistRegionCounty.Text != "") { regin = drlistRegionCounty.Text; } else { regin = txtregion.Text; } BAL.inmemorial objInmorial = new BAL.inmemorial(); objInmorial.name = txtname.Text; objInmorial.email = txtemail.Text; objInmorial.country = DropDownList1.Text; objInmorial.townCity = txtcitytown.Text; objInmorial.regionCounty = regin; string kk = DAL.htmlromve.StripTagsRegexCompiled(CKEditorControl1.Text); objInmorial.pmess = kk; objInmorial.mess = CKEditorControl1.Text; objInmorial.dessurname = txtdecsurname.Text; objInmorial.desname = txtdecname.Text; objInmorial.desemail = txtemaildes.Text; objInmorial.active = 1; if (FileUpload1.HasFile) { string path = Path.GetFileName(FileUpload1.FileName); string mm = DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString(); fpi = mm + path; FileUpload1.SaveAs(Server.MapPath("~/remembrance-garden-book/images/immemimg/") + fpi); } else { fpi = Request["flower"]; } objInmorial.img = fpi; DAL.general bjGen = new DAL.general(); bool f = bjGen.insertinmemorial(objInmorial); if (f) { ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "sucess();", true); } else { ScriptManager.RegisterClientScriptBlock(this, GetType(), "Worng", "worn();", true); } }