public virtual MailingMgrLog UpdateMailingMgrLog(MailingMgrLog entity)
        {
            if (entity.IsTransient())
            {
                return(entity);
            }
            MailingMgrLog other = GetMailingMgrLog(entity.MailingMgrLogId);

            if (entity.Equals(other))
            {
                return(entity);
            }
            string sql = @"Update MailingMgrLog set  [MailingMgrLogGUID]=@MailingMgrLogGUID
							, [SentOn]=@SentOn
							, [ToEmail]=@ToEmail
							, [FromEmail]=@FromEmail
							, [Subject]=@Subject
							, [Body]=@Body 
							 where MailingMgrLogID=@MailingMgrLogID"                            ;

            SqlParameter[] parameterArray = new SqlParameter[] {
                new SqlParameter("@MailingMgrLogID", entity.MailingMgrLogId)
                , new SqlParameter("@MailingMgrLogGUID", entity.MailingMgrLogGuid)
                , new SqlParameter("@SentOn", entity.SentOn)
                , new SqlParameter("@ToEmail", entity.ToEmail)
                , new SqlParameter("@FromEmail", entity.FromEmail)
                , new SqlParameter("@Subject", entity.Subject ?? (object)DBNull.Value)
                , new SqlParameter("@Body", entity.Body ?? (object)DBNull.Value)
            };
            SqlHelper.ExecuteNonQuery(this.ConnectionString, CommandType.Text, sql, parameterArray);
            return(GetMailingMgrLog(entity.MailingMgrLogId));
        }
        public virtual MailingMgrLog MailingMgrLogFromDataRow(DataRow dr)
        {
            if (dr == null)
            {
                return(null);
            }
            MailingMgrLog entity = new MailingMgrLog();

            entity.MailingMgrLogId   = (System.Int32)dr["MailingMgrLogID"];
            entity.MailingMgrLogGuid = (System.Guid)dr["MailingMgrLogGUID"];
            entity.SentOn            = (System.DateTime)dr["SentOn"];
            entity.ToEmail           = dr["ToEmail"].ToString();
            entity.FromEmail         = dr["FromEmail"].ToString();
            entity.Subject           = dr["Subject"].ToString();
            entity.Body = dr["Body"].ToString();
            return(entity);
        }
        public virtual MailingMgrLog InsertMailingMgrLog(MailingMgrLog entity)
        {
            MailingMgrLog other = new MailingMgrLog();

            other = entity;
            if (entity.IsTransient())
            {
                string         sql            = @"Insert into MailingMgrLog ( [MailingMgrLogGUID]
				,[SentOn]
				,[ToEmail]
				,[FromEmail]
				,[Subject]
				,[Body] )
				Values
				( @MailingMgrLogGUID
				, @SentOn
				, @ToEmail
				, @FromEmail
				, @Subject
				, @Body );
				Select scope_identity()"                ;
                SqlParameter[] parameterArray = new SqlParameter[] {
                    new SqlParameter("@MailingMgrLogID", entity.MailingMgrLogId)
                    , new SqlParameter("@MailingMgrLogGUID", entity.MailingMgrLogGuid)
                    , new SqlParameter("@SentOn", entity.SentOn)
                    , new SqlParameter("@ToEmail", entity.ToEmail)
                    , new SqlParameter("@FromEmail", entity.FromEmail)
                    , new SqlParameter("@Subject", entity.Subject ?? (object)DBNull.Value)
                    , new SqlParameter("@Body", entity.Body ?? (object)DBNull.Value)
                };
                var identity = SqlHelper.ExecuteScalar(this.ConnectionString, CommandType.Text, sql, parameterArray);
                if (identity == DBNull.Value)
                {
                    throw new DataException("Identity column was null as a result of the insert operation.");
                }
                return(GetMailingMgrLog(Convert.ToInt32(identity)));
            }
            return(entity);
        }
 public virtual MailingMgrLog DeleteMailingMgrLog(MailingMgrLog entity)
 {
     this.DeleteMailingMgrLog(entity.MailingMgrLogId);
     return(entity);
 }
예제 #5
0
 public MailingMgrLog InsertMailingMgrLog(MailingMgrLog entity)
 {
     return(_iMailingMgrLogRepository.InsertMailingMgrLog(entity));
 }
예제 #6
0
 public MailingMgrLog UpdateMailingMgrLog(MailingMgrLog entity)
 {
     return(_iMailingMgrLogRepository.UpdateMailingMgrLog(entity));
 }