public void Insert() { NotificationID = Convert.ToInt32(container.Insert()); //if email notification enabled, send an email string send_notification_email = System.Configuration.ConfigurationManager.AppSettings["Email_SendNotificationEmail"]; if (!String.IsNullOrEmpty(send_notification_email)) { if (send_notification_email == "true") { qPtl_Notification notification = new qPtl_Notification(NotificationID); qPtl_User owner = new qPtl_User(notification.OwnerID); qPtl_User actor = new qPtl_User(notification.ActorID); int notification_email_id = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["Email_NotificationEmailID"]); if (!String.IsNullOrEmpty(Convert.ToString(notification_email_id))) { if (notification_email_id > 0) { try { qCom_EmailTool email = new qCom_EmailTool(notification_email_id); email.SendDatabaseMail(owner.Email, notification_email_id, owner.UserID, notification.Text, actor.UserName, "", "", "", false); } catch { // do nothing } } } } } }
public void Insert() { NotificationID = Convert.ToInt32(container.Insert()); //if email notification enabled, send an email string send_notification_email = System.Configuration.ConfigurationManager.AppSettings["Email_SendNotificationEmail"]; if (!String.IsNullOrEmpty(send_notification_email)) { if (send_notification_email == "true") { qPtl_Notification notification = new qPtl_Notification(NotificationID); qPtl_User owner = new qPtl_User(notification.OwnerID); qPtl_User actor = new qPtl_User(notification.ActorID); int notification_email_id = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["Email_NotificationEmailID"]); if (!String.IsNullOrEmpty(Convert.ToString(notification_email_id))) { if (notification_email_id > 0) { try { qCom_EmailTool email = new qCom_EmailTool(notification_email_id); email.SendDatabaseMail(owner.Email, notification_email_id, owner.UserID, notification.Text, actor.UserName, "", "", "", false); } catch { // do nothing } } } } } }