예제 #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Panther.Email.Entity.Model.EmailSendAccount model)
        {
            StringBuilder strSql = new StringBuilder();

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

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Panther.Email.Entity.Model.EmailSendAccount model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into EmailSendAccount(");
            strSql.Append("EmailSendAccountID,EmailID,EmailAccountID,EmailSendAccountCreateTime)");
            strSql.Append(" values (");
            strSql.Append("@EmailSendAccountID,@EmailID,@EmailAccountID,@EmailSendAccountCreateTime)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@EmailSendAccountID",         SqlDbType.VarChar, 40),
                new SqlParameter("@EmailID",                    SqlDbType.VarChar, 40),
                new SqlParameter("@EmailAccountID",             SqlDbType.VarChar, 40),
                new SqlParameter("@EmailSendAccountCreateTime", SqlDbType.DateTime)
            };
            parameters[0].Value = model.EmailSendAccountID;
            parameters[1].Value = model.EmailID;
            parameters[2].Value = model.EmailAccountID;
            parameters[3].Value = model.EmailSendAccountCreateTime;

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

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

            strSql.Append("select EmailSendAccountID,EmailID,EmailAccountID,EmailSendAccountCreateTime from EmailSendAccount ");
            strSql.Append(" where EmailSendAccountID=@EmailSendAccountID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@EmailSendAccountID", SqlDbType.VarChar, 40)
            };
            parameters[0].Value = EmailSendAccountID;

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

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