public static qCom_EmailPreference GetEmailPreferences()
        {
            qCom_EmailPreference preferences = new qCom_EmailPreference();

            preferences.container.Select("MarkAsDelete = 0 AND Available = 'Yes'");

            return(preferences);
        }
        public static qCom_EmailPreference GetEmailPreferencesByScopeID(Int32 scopeID)
        {
            qCom_EmailPreference preferences = new qCom_EmailPreference();

            preferences.container.Select("MarkAsDelete = 0 AND Available = 'Yes' AND ScopeID = " + scopeID);

            return(preferences);
        }
        public static qCom_EmailPreference GetEmailPreferencesByScopeID(Int32 scopeID)
        {
            qCom_EmailPreference preferences = new qCom_EmailPreference();

            preferences.container.Select("MarkAsDelete = 0 AND Available = 'Yes' AND ScopeID = " + scopeID);

            return preferences;
        }
        public static qCom_EmailPreference GetEmailPreferences()
        {
            qCom_EmailPreference preferences = new qCom_EmailPreference();

            preferences.container.Select("MarkAsDelete = 0 AND Available = 'Yes'");

            return preferences;
        }
        protected void SendTaskEmail(int task_type_id, int created_by, int reference_id, string description)
        {
            string request_task_emails = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["TaskEmailList"]);
            qCom_EmailPreference preferences = new qCom_EmailPreference();
            string system_from = preferences.FromName;
            string system_email_address = preferences.FromEmailAddress;
            int curr_email_id = 0;

            qPtl_User curr_user = new qPtl_User(created_by);

            if (!String.IsNullOrEmpty(request_task_emails))
            {
                switch (task_type_id)
                {
                    case 1:     // review blog
                        curr_email_id = Convert.ToInt32(Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["report_blog_EmailID"]));
                        break;
                    case 2:     // approve image
                        curr_email_id = Convert.ToInt32(Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["report_newpic_EmailID"]));
                        break;
                    case 3:     // approve video
                        curr_email_id = Convert.ToInt32(Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["report_video_EmailID"]));
                        break;
                    case 4:     // review site report
                        curr_email_id = Convert.ToInt32(Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["report_issue_EmailID"]));
                        break;
                    case 5:     // review reported message
                        curr_email_id = Convert.ToInt32(Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["report_message_EmailID"]));
                        break;
                    case 6:     // review banned word
                        curr_email_id = Convert.ToInt32(Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["report_banned_word_EmailID"]));
                        break;
                }

                qCom_EmailItem email = new qCom_EmailItem(curr_email_id);

                ArrayList addresses = new ArrayList();
                q_Helper helper = new q_Helper();
                addresses = helper.optionsToArrayList(request_task_emails);

                qCom_EmailTool email_send = new qCom_EmailTool();
                int sent_email_log_id = 0;

                foreach (string address in addresses)
                {
                    try
                    {
                        sent_email_log_id = email_send.SendDatabaseMail(address, curr_email_id, created_by, curr_user.UserName, Convert.ToString(reference_id), description, "", "", false);
                    }
                    catch
                    {
                        // email failure
                    }
                }
            }
        }