Пример #1
0
        /// <summary>
        /// 添加通道池方法
        /// </summary>
        /// <returns></returns>
        public JsonResult PooLAdd(JMP.MDL.jmp_channel_pool mode)
        {
            object retJson = new { success = 0, msg = "操作失败" };

            if (mode.Id > 0)
            {
                poolModel = poolBll.GetModel(mode.Id);
                //拷贝
                var moPool = poolModel.Clone();
                poolModel.PoolName    = mode.PoolName;
                poolModel.Description = mode.Description;

                if (poolBll.Update(poolModel))
                {
                    Logger.ModifyLog("修改通道池", moPool, poolModel);
                    retJson = new { success = 1, msg = "操作成功" };
                }
            }
            else
            {
                mode.CreatedByUserId = UserInfo.UserId;
                mode.CreatedOn       = DateTime.Now;
                mode.IsEnabled       = true;

                int num = poolBll.Add(mode);
                if (num > 0)
                {
                    Logger.CreateLog("添加通道池", mode);

                    retJson = new { success = 1, msg = "操作成功" };
                }
            }
            return(Json(retJson));
        }
Пример #2
0
        /// <summary>
        /// 添加通道池管理
        /// </summary>
        /// <returns></returns>
        public ActionResult ChannelPoolAdd()
        {
            int id = string.IsNullOrEmpty(Request["id"]) ? 0 : int.Parse(Request["id"]);

            if (id > 0)
            {
                poolModel = poolBll.GetModel(id);
            }

            ViewBag.poolModel = poolModel;

            return(View());
        }