예제 #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);
            }
        }