Example #1
0
        public override SqlParameter[] GetParameters()
        {
            M_EMail_Item model = this;

            if (model.CDate <= DateTime.MinValue)
            {
                model.CDate = DateTime.Now;
            }
            SqlParameter[] sp = GetSP();
            sp[0].Value  = model.ID;
            sp[1].Value  = model.Priority;
            sp[2].Value  = model.FromName;
            sp[3].Value  = model.FromEmail;
            sp[4].Value  = model.ReplyTo;
            sp[5].Value  = model.CCAddress;
            sp[6].Value  = model.ToAddress;
            sp[7].Value  = model.BCCAddress;
            sp[8].Value  = model.Subject;
            sp[9].Value  = model.MailBody;
            sp[10].Value = model.Attachment;
            sp[11].Value = model.SaveSendLog;
            sp[12].Value = model.CDate;
            sp[13].Value = model.Result;
            sp[14].Value = model.Error;
            return(sp);
        }
Example #2
0
        public M_EMail_Item GetModelFromReader(DbDataReader rdr)
        {
            M_EMail_Item model = new M_EMail_Item();

            model.ID          = Convert.ToInt32(rdr["ID"]);
            model.Priority    = ConvertToInt(rdr["Priority"]);
            model.FromName    = ConverToStr(rdr["FromName"]);
            model.FromEmail   = ConverToStr(rdr["FromEmail"]);
            model.ReplyTo     = ConverToStr(rdr["ReplyTo"]);
            model.CCAddress   = ConverToStr(rdr["CCAddress"]);
            model.ToAddress   = ConverToStr(rdr["ToAddress"]);
            model.BCCAddress  = ConverToStr(rdr["BCCAddress"]);
            model.Subject     = ConverToStr(rdr["Subject"]);
            model.MailBody    = ConverToStr(rdr["MailBody"]);
            model.Attachment  = ConverToStr(rdr["Attachment"]);
            model.SaveSendLog = ConvertToInt(rdr["SaveSendLog"]);
            model.CDate       = ConvertToDate(rdr["CDate"]);
            model.Result      = ConvertToInt(rdr["Result"]);
            model.Error       = ConverToStr(rdr["Error"]);
            rdr.Close();
            return(model);
        }