Exemple #1
0
        /// <summary>
        /// 获取渠道列表
        /// </summary>
        /// <returns></returns>
        public JsonResult drpChannelList()
        {
            DaChannel       dal      = new DaChannel();
            IList <Channel> channels = dal.getList();

            var result = new CustomJsonResult();

            result.Data = channels;
            return(result);
        }
Exemple #2
0
        /* ============ 操作 ============ */

        #region 获取渠道类别列表
        /// <summary>
        /// 获取渠道类别列表
        /// </summary>
        /// <returns></returns>
        public JsonResult Channel_getList()
        {
            DaChannel       dal      = new DaChannel();
            IList <Channel> channels = dal.getList();

            var result = new CustomJsonResult();

            result.Data = new { total = channels.Count, rows = channels };
            return(result);
        }
Exemple #3
0
        /// <summary>
        /// 删除渠道类别
        /// </summary>
        /// <param name="id">编号</param>
        /// <returns></returns>
        public JsonResult Channel_remove(string id)
        {
            Channel en = new Channel();

            en.id = Convert.ToInt32(id);

            DaChannel dal    = new DaChannel();
            var       result = new CustomJsonResult();

            result.Data = dal.delete(en);
            return(result);
        }
Exemple #4
0
        public JsonResult Channel_add(string name, string memo)
        {
            Channel en = new Channel();

            en.name = name;
            en.memo = memo;

            DaChannel dal    = new DaChannel();
            var       result = new CustomJsonResult();

            result.Data = dal.add(en);
            return(result);
        }
Exemple #5
0
        public JsonResult Channel_edit(string id, string name, string memo)
        {
            Channel en = new Channel();

            en.id   = Convert.ToInt32(id);
            en.name = name;
            en.memo = memo;

            DaChannel dal    = new DaChannel();
            var       result = new CustomJsonResult();

            result.Data = dal.update(en);
            return(result);
        }