Example #1
0
        internal int AddUpdateMassMail(MassMailAddInfo objMassMail, string username)
        {
            List <KeyValuePair <string, object> > Param = new List <KeyValuePair <string, object> >();

            Param.Add(new KeyValuePair <string, object>("@MassMailID", objMassMail.MassMailID));
            Param.Add(new KeyValuePair <string, object>("@MessageMailTitle", objMassMail.MessageTitle));
            Param.Add(new KeyValuePair <string, object>("@FilterTypeID", objMassMail.FilterTypeID));
            Param.Add(new KeyValuePair <string, object>("@FilterValue", objMassMail.FilterValue));
            Param.Add(new KeyValuePair <string, object>("@AdditionalUser", objMassMail.AdditionalUser));
            Param.Add(new KeyValuePair <string, object>("@Subject", objMassMail.Subject));
            Param.Add(new KeyValuePair <string, object>("@MessageBody", objMassMail.MessageBody));
            Param.Add(new KeyValuePair <string, object>("@ScheduleType", objMassMail.ScheduleType));
            Param.Add(new KeyValuePair <string, object>("@ScheduledOn", objMassMail.ScheduledOn));
            Param.Add(new KeyValuePair <string, object>("@Username", username));

            SQLHandler objHandler = new SQLHandler();

            try
            {
                return(objHandler.ExecuteNonQuery("[dbo].[usp_SCAdmin_AddUpdateMassMail]", Param, "@output"));
            }
            catch (Exception ex)
            {
                return(-2);
                //base.ProcessExcetion(ex);
            }
        }
Example #2
0
        public int AddUpdateMassMail(MassMailAddInfo objMassMail, string username)
        {
            MassMailProvider objProvider = new MassMailProvider();

            if (objMassMail.ScheduleType == 1)
            {
                objMassMail.ScheduledOn = DateTime.UtcNow.ToLocalTime().ToString();
            }

            int status = objProvider.AddUpdateMassMail(objMassMail, username);

            if (status > 0)
            {
                CallAPIForMail(objMassMail.ScheduledOn);
            }
            return(status);
        }