/// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Panther.Email.Entity.Model.EmailSendFailure model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update EmailSendFailure set ");
            strSql.Append("EmailID=@EmailID,");
            strSql.Append("EmailBccAccountID=@EmailBccAccountID,");
            strSql.Append("EmailAccountID=@EmailAccountID,");
            strSql.Append("EmailSendFailureSendTime=@EmailSendFailureSendTime");
            strSql.Append(" where EmailSendFailureID=@EmailSendFailureID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@EmailID",                  SqlDbType.VarChar,   40),
                new SqlParameter("@EmailBccAccountID",        SqlDbType.VarChar,   40),
                new SqlParameter("@EmailAccountID",           SqlDbType.VarChar,   40),
                new SqlParameter("@EmailSendFailureSendTime", SqlDbType.DateTime),
                new SqlParameter("@EmailSendFailureID",       SqlDbType.VarChar, 40)
            };
            parameters[0].Value = model.EmailID;
            parameters[1].Value = model.EmailBccAccountID;
            parameters[2].Value = model.EmailAccountID;
            parameters[3].Value = model.EmailSendFailureSendTime;
            parameters[4].Value = model.EmailSendFailureID;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public Panther.Email.Entity.Model.EmailSendFailure DataRowToModel(DataRow row)
 {
     Panther.Email.Entity.Model.EmailSendFailure model = new Panther.Email.Entity.Model.EmailSendFailure();
     if (row != null)
     {
         if (row["EmailSendFailureID"] != null)
         {
             model.EmailSendFailureID = row["EmailSendFailureID"].ToString();
         }
         if (row["EmailID"] != null)
         {
             model.EmailID = row["EmailID"].ToString();
         }
         if (row["EmailBccAccountID"] != null)
         {
             model.EmailBccAccountID = row["EmailBccAccountID"].ToString();
         }
         if (row["EmailAccountID"] != null)
         {
             model.EmailAccountID = row["EmailAccountID"].ToString();
         }
         if (row["EmailSendFailureSendTime"] != null && row["EmailSendFailureSendTime"].ToString() != "")
         {
             model.EmailSendFailureSendTime = DateTime.Parse(row["EmailSendFailureSendTime"].ToString());
         }
     }
     return(model);
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Panther.Email.Entity.Model.EmailSendFailure GetModel(string EmailSendFailureID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select EmailSendFailureID,EmailID,EmailBccAccountID,EmailAccountID,EmailSendFailureSendTime from EmailSendFailure ");
            strSql.Append(" where EmailSendFailureID=@EmailSendFailureID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@EmailSendFailureID", SqlDbType.VarChar, 40)
            };
            parameters[0].Value = EmailSendFailureID;

            Panther.Email.Entity.Model.EmailSendFailure model = new Panther.Email.Entity.Model.EmailSendFailure();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
示例#4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Panther.Email.Entity.Model.EmailSendFailure model)
 {
     return(dal.Update(model));
 }
示例#5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Panther.Email.Entity.Model.EmailSendFailure model)
 {
     return(dal.Add(model));
 }