public void SoundPlay(string pathShort) { clsNet clsNet = new clsNet(); string strBrowser = clsNet.BrowserGet(); if (strBrowser != "IE6" && strBrowser != "IE7") { System.Web.UI.Page currentPage; currentPage = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; if (!currentPage.ClientScript.IsStartupScriptRegistered(currentPage.GetType(), "SoundPlay_Regis")) { System.Text.StringBuilder strScript = new System.Text.StringBuilder(); strScript.Append("var soundObject = null;"); strScript.Append("function PlaySound() {"); strScript.Append("if (soundObject != null) {"); strScript.Append("document.body.removeChild(soundObject);"); strScript.Append("soundObject.removed = true;"); strScript.Append("soundObject = null;"); strScript.Append("}"); strScript.Append("soundObject = document.createElement('embed');"); strScript.Append("soundObject.setAttribute('src', '" + pathShort + "');"); strScript.Append("soundObject.setAttribute('hidden', true);"); strScript.Append("soundObject.setAttribute('autostart', true);"); strScript.Append("document.body.appendChild(soundObject);"); strScript.Append("}"); currentPage.ClientScript.RegisterClientScriptBlock(currentPage.GetType(), "SoundPlay_Regis", strScript.ToString(), true); } if (!currentPage.ClientScript.IsStartupScriptRegistered(currentPage.GetType(), "SoundPlay_Call")) { currentPage.ClientScript.RegisterStartupScript(currentPage.GetType(), "SoundPlay_Call", "PlaySound();", true); } } }
/// <summary> /// บันทึก Log การส่งอีเมล์จากระบบ Template /// </summary> /// <param name="UID">EmailTemplateUID</param> /// <param name="From">จากเมล์</param> /// <param name="To">ถึงเมล์</param> /// <param name="Cc">แนบเมล์</param> /// <param name="Bcc">ไม่เปิดเผยเมล์</param> /// <param name="Result">ผลการส่ง</param> /// <returns>true=บันทึกสำเร็จ , false=บันทึกไม่สำเร็จ</returns> private bool SendTemplateLog(string UID, string From, string To, string Cc, string Bcc, string Result) { #region Variable bool rtnValue = false; clsSQL clsSQL = new clsSQL(); clsSecurity clsSecurity = new clsSecurity(); clsNet clsNet = new clsNet(); string outSQL; #endregion #region SQL Query if (clsSQL.Insert( "EmailTemplateLog", new string[, ] { { "UID", clsSQL.GetNewID("UID", "EmailTemplateLog", "", dbType, cs).ToString() }, { "EmailTemplateUID", UID }, { "EmailFrom", "'" + clsSQL.CodeFilter(From) + "'" }, { "EmailTo", "'" + clsSQL.CodeFilter(To) + "'" }, { "EmailCc", "'" + clsSQL.CodeFilter(Cc) + "'" }, { "EmailBcc", "'" + clsSQL.CodeFilter(Bcc) + "'" }, { "Result", "'" + clsSQL.CodeFilter(Result) + "'" }, { "CWhen", "GETDATE()" }, { "CUser", "0" }, { "CIP", "'" + clsNet.IPGet() + "'" }, { "CHostname", "'" + clsNet.ComNameGet() + "'" } }, new string[, ] { {} }, dbType, cs, out outSQL)) { rtnValue = true; } #endregion return(rtnValue); }
public void SoundPlay(string pathShort) { clsNet clsNet = new clsNet(); string strBrowser=clsNet.BrowserGet(); if (strBrowser != "IE6" && strBrowser != "IE7") { System.Web.UI.Page currentPage; currentPage = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler; if (!currentPage.ClientScript.IsStartupScriptRegistered(currentPage.GetType(), "SoundPlay_Regis")) { System.Text.StringBuilder strScript = new System.Text.StringBuilder(); strScript.Append("var soundObject = null;"); strScript.Append("function PlaySound() {"); strScript.Append("if (soundObject != null) {"); strScript.Append("document.body.removeChild(soundObject);"); strScript.Append("soundObject.removed = true;"); strScript.Append("soundObject = null;"); strScript.Append("}"); strScript.Append("soundObject = document.createElement('embed');"); strScript.Append("soundObject.setAttribute('src', '" + pathShort + "');"); strScript.Append("soundObject.setAttribute('hidden', true);"); strScript.Append("soundObject.setAttribute('autostart', true);"); strScript.Append("document.body.appendChild(soundObject);"); strScript.Append("}"); currentPage.ClientScript.RegisterClientScriptBlock(currentPage.GetType(), "SoundPlay_Regis", strScript.ToString(), true); } if (!currentPage.ClientScript.IsStartupScriptRegistered(currentPage.GetType(), "SoundPlay_Call")) { currentPage.ClientScript.RegisterStartupScript(currentPage.GetType(), "SoundPlay_Call", "PlaySound();", true); } } }
/// <summary> /// บันทึก Log การส่งอีเมล์จากระบบ Template /// </summary> /// <param name="UID">EmailTemplateUID</param> /// <param name="From">จากเมล์</param> /// <param name="To">ถึงเมล์</param> /// <param name="Cc">แนบเมล์</param> /// <param name="Bcc">ไม่เปิดเผยเมล์</param> /// <param name="Result">ผลการส่ง</param> /// <returns>true=บันทึกสำเร็จ , false=บันทึกไม่สำเร็จ</returns> private bool SendTemplateLog(string UID, string From, string To, string Cc, string Bcc, string Result) { #region Variable bool rtnValue = false; clsSQL clsSQL = new clsSQL(); clsSecurity clsSecurity=new clsSecurity(); clsNet clsNet = new clsNet(); string outSQL; #endregion #region SQL Query if(clsSQL.Insert( "EmailTemplateLog", new string[,]{ {"UID",clsSQL.GetNewID("UID","EmailTemplateLog","",dbType,cs).ToString()}, {"EmailTemplateUID",UID}, {"EmailFrom","'"+clsSQL.CodeFilter(From)+"'"}, {"EmailTo","'"+clsSQL.CodeFilter(To)+"'"}, {"EmailCc","'"+clsSQL.CodeFilter(Cc)+"'"}, {"EmailBcc","'"+clsSQL.CodeFilter(Bcc)+"'"}, {"Result","'"+clsSQL.CodeFilter(Result)+"'"}, {"CWhen","GETDATE()"}, {"CUser","0"}, {"CIP","'"+clsNet.IPGet()+"'"}, {"CHostname","'"+clsNet.ComNameGet()+"'"}}, new string[,]{{}}, dbType, cs, out outSQL)) { rtnValue = true; } #endregion return rtnValue; }