示例#1
0
        public void Delete(Core.Business.Sendsms sendsms)
        {
            MySqlUtility sql = new MySqlUtility();

            sql.AddParameter("@Id", MySqlDbType.Int64, sendsms.Id);
            sql.ExecuteSql(SqlDeleteSendsms);
        }
示例#2
0
        public Core.Business.Sendsms Select(Int64 id)
        {
            MySqlUtility sql = new MySqlUtility();

            sql.AddParameter("@Id", MySqlDbType.Int64, id);

            MySqlDataReader reader = sql.ExecuteSqlReader(SqlSelectSendsms);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.Sendsms sendsms = new Core.Business.Sendsms();

                if (!reader.IsDBNull(0)) sendsms.Id = reader.GetInt64(0);
                if (!reader.IsDBNull(1)) sendsms.StatusTime = reader.GetDateTime(1);
                if (!reader.IsDBNull(2)) sendsms.Content = reader.GetString(2);
                if (!reader.IsDBNull(3)) sendsms.Phone = reader.GetString(3);
                if (!reader.IsDBNull(4)) sendsms.ReturnFlag = reader.GetString(4);

                reader.Close();
                return sendsms;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
示例#3
0
        public void Update(Core.Business.Sendsms sendsms)
        {
            MySqlUtility sql = new MySqlUtility();

            sql.AddParameter("@StatusTime", MySqlDbType.DateTime, sendsms.StatusTime);
            sql.AddParameter("@Content", MySqlDbType.VarChar, sendsms.Content);
            sql.AddParameter("@Phone", MySqlDbType.VarChar, sendsms.Phone);
            sql.AddParameter("@ReturnFlag", MySqlDbType.VarChar, sendsms.ReturnFlag);
            sql.AddParameter("@Id", MySqlDbType.Int64, sendsms.Id);
            sql.ExecuteSql(SqlUpdateSendsms);
        }