コード例 #1
0
 public int VideoCate_UpdateByc_id(VideoCate obj)
 {
     using (VideosAccess access = new VideosAccess())
     {
         return(access.VideoCate_UpdateByc_id(obj));
     }
 }
コード例 #2
0
 public int VideoCate_Insert(VideoCate obj)
 {
     using (VideosAccess access = new VideosAccess())
     {
         return(access.VideoCate_Insert(obj));
     }
 }
コード例 #3
0
        public List <VideoCate> VideoCate_SelectPage(string cloumns, int pageIndex, int pageSize, string orderBy, string where, out int rowCount)
        {
            DbCommand dbCmd = db.GetStoredProcCommand("Proc_VideoCate_SelectPage");

            db.AddOutParameter(dbCmd, "@rowCount", DbType.Int32, 4);
            db.AddInParameter(dbCmd, "@cloumns", DbType.String, cloumns);
            db.AddInParameter(dbCmd, "@pageIndex", DbType.Int32, pageIndex);
            db.AddInParameter(dbCmd, "@pageSize", DbType.Int32, pageSize);
            db.AddInParameter(dbCmd, "@orderBy", DbType.String, orderBy);
            db.AddInParameter(dbCmd, "@where", DbType.String, where);
            List <VideoCate> list = new List <VideoCate>();

            try
            {
                using (IDataReader reader = db.ExecuteReader(dbCmd))
                {
                    while (reader.Read())
                    {
                        VideoCate obj = Obj2Model <VideoCate>(reader);

                        list.Add(obj);
                    }
                    reader.NextResult();
                }
                rowCount = (int)dbCmd.Parameters["@rowCount"].Value;
                return(list);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
コード例 #4
0
        public static int VideoCate_UpdateByc_id(VideoCate obj)
        {
            IVideosService channel = Entity.CreateChannel <IVideosService>(SiteEnum.SiteService.VideoService);
            var            result  = channel.VideoCate_UpdateByc_id(obj);

            (channel as IDisposable).Dispose();
            return(result);
        }
コード例 #5
0
        public int VideoCate_UpdateByc_id(VideoCate obj)
        {
            DbCommand dbCmd = db.GetStoredProcCommand("Proc_VideoCate_UpdateByc_id");

            db.AddInParameter(dbCmd, "@c_id", DbType.Int32, obj.c_id);
            db.AddInParameter(dbCmd, "@c_name", DbType.String, obj.c_name);
            try
            {
                int returnValue = db.ExecuteNonQuery(dbCmd);
                return(returnValue);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
コード例 #6
0
        public int VideoCate_Insert(VideoCate obj)
        {
            DbCommand dbCmd = db.GetStoredProcCommand("Proc_VideoCate_Insert");

            db.AddInParameter(dbCmd, "@c_name", DbType.String, obj.c_name);
            try
            {
                int returnValue = db.ExecuteNonQuery(dbCmd);
                int c_id        = (int)dbCmd.Parameters["@c_id"].Value;
                return(returnValue);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
コード例 #7
0
        public VideoCate VideoCate_SelectByc_id(int c_id)
        {
            DbCommand dbCmd = db.GetStoredProcCommand("Proc_VideoCate_SelectByc_id");

            db.AddInParameter(dbCmd, "@c_id", DbType.Int32, c_id);
            VideoCate obj = null;

            try
            {
                using (IDataReader reader = db.ExecuteReader(dbCmd))
                {
                    while (reader.Read())
                    {
                        obj = Obj2Model <VideoCate>(reader);
                    }
                }
                return(obj);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }