protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Approved") { BAL.inmemorial objrem = new BAL.inmemorial(); objrem.cid =Convert.ToInt32( e.CommandArgument); objrem.active = 0; DAL.general objGen = new DAL.general(); objGen.updateinmomoriyamstatus(objrem); } else if (e.CommandName == "Pending") { BAL.inmemorial objrem = new BAL.inmemorial(); objrem.cid = Convert.ToInt32(e.CommandArgument); objrem.active = 1; DAL.general objGen = new DAL.general(); bool f= objGen.updateinmomoriyamstatus(objrem); DataSet ds = objGen.getdataset("select * from inmemorialcardtdl where cid=" + Convert.ToInt32(e.CommandArgument) + ""); if(f) { try { string link= "http://bmdnotices.com/remembrance-garden-book/viewinmemoriam.aspx?cid=" + Convert.ToString(e.CommandArgument); string postNewInMemoriumLink = " <a href='http://www.bmdnotices.com/remembrance-garden-book/Post-inmemorial-card.aspx'>click here</a>."; string mail = "<p align='left'>Dear Sir/Madam,<br><br>The In Memoriam Notice you created has now been approved and is ready for you to view on bmdnotices.com website.<br>You are welcome to send as many In Memoriams as you like.<br>Please note that you can also add your messages, tributes and in memoriams to existing Pages in our Remembrance Garden Book. <br>If you would like to create such a Page, please"+postNewInMemoriumLink +"<br>You can view your In Memoriam Notice here: " + link + "<br><br><br> Thank You, <br>BMDnotices Team</p>"; // string mail = "<p align='left'>Dear Sir / Madam,<br><br>Your Card has now been approved and is ready for you to view on bmdnotices.com website.<br>You are welcome to send as many Cards as you like.<br>Please note that you can also add your messages, tributes and in memorials to existing Pages in our Remembrance Garden Book. <br>If you would like to create such a Page, please clik here.<br> You can view your Card here:" + link + "<br><br><br> Thank You, <br>BMDnotices Team"; objGen.Send_Mail(Convert.ToString(ds.Tables[0].Rows[0]["email"]), "BMDnotices In Memoriam Approved", mail, ""); string body = infoBody1(Convert.ToString(ds.Tables[0].Rows[0]["name"]), "", Convert.ToString(ds.Tables[0].Rows[0]["desname"]), Convert.ToString(ds.Tables[0].Rows[0]["dessurname"]), Convert.ToString(ds.Tables[0].Rows[0]["mess"]), Convert.ToString(ds.Tables[0].Rows[0]["img"])); string[] words = Convert.ToString(ds.Tables[0].Rows[0]["desemail"]).Split(','); foreach (string word in words) { objGen.Send_Mail(word, "BMDnotices In Memoriam Notice has been shared with you", body, ""); } } catch (Exception) { } } } else if (e.CommandName == "Delete") { BAL.inmemorial objrem = new BAL.inmemorial(); objrem.cid = Convert.ToInt32(e.CommandArgument); DAL.general objGen = new DAL.general(); objGen.deleteinmomoriyamstatus(objrem); } else { if (e.CommandName == ViewState["Column"].ToString()) { if (ViewState["Sortorder"].ToString() == "ASC") ViewState["Sortorder"] = "DESC"; else ViewState["Sortorder"] = "ASC"; } else { ViewState["Column"] = e.CommandName; ViewState["Sortorder"] = "ASC"; } } bindData1(); }