123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- using PMS.BusinessModels.Account;
- using PMS.EntityModels.Channel;
- using PMS.Interface;
- using PMS.Interface.Channel;
- using QWPlatform.SystemLibrary.Utils;
- using QWPlatform.SystemLibrary.Web;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace PMS.WebUI.Controllers
- {
- /// <summary>
- /// 创建者:冉利
- /// 创建日期:2018/12/10
- /// 功能描述:渠道信息的新增
- /// </summary>
- public class ChannelController : BaseController
- {
- IChannel Channel = InterfaceFactory.CreateBusinessInstance<IChannel>();
- #region 查询获取所有渠道信息
- public ActionResult ChannelManage()
- {
- return View();
- }
- /// <summary>
- /// 获取所有渠道信息(不分页)
- /// </summary>
- /// <returns></returns>
- public ActionResult ModuleInfos(string search, string CurrrentID, int page, int rows)
- {//todo:需要获取用户信息
- AuthDatsInfo AuthDatas = this.GetAuthDats();
- string result= Channel.ChannelDataGridsM(AuthDatas.Channel, page,rows);
- return Content(result, "application/json");
- }
- #endregion
- #region 新增修改渠道信息
- public ActionResult ModulePopWindows(string id)
- {
- ViewBag.id = id;
- return View();
- }
- [HttpPost]
- public ActionResult SaveModulePopWindows(ChannelModel model)
- {
- /// <summary>
- /// 编辑类型 0新增 1修改
- /// </summary>
- int EditType = 0;
- string s;
- //修改
- if (model.ID != null)
- {
- EditType = 1;
- s = Channel.EditChannel(model, EditType);
- }
- else {
- //调用接口处理数据(新增)
- model.ID = "";
- s = Channel.AddChannel(model, EditType);
- }
- string[] str = s.Split('|');
- foreach (string i in str)
- {
- if (i == "1")
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "保存成功");
- }
- }
- //保存失败
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "违反完整性约束");
- }
- #endregion
- #region 查询渠道信息
- public ActionResult GetChannelInfo(string id)
- {
- DataTable dt = Channel.GetChannelInfo(id);
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "读取成功", dt);
- }
- #endregion
- #region 查询渠道性质
- public ActionResult GetChannelnature()
- {
- string nature = Channel.GetChannelnature();
- return Content(nature, "application/json");
- }
- #endregion
- //删除渠道信息
- public ActionResult DelChannelInfo(string id,int type)
- {
- // Id_In In 渠道信息.Id % Type,
- // 标记类型_In In Number, --0、删除 1、终止 2、撤消
- //Resultstr_Out Out Varchar2
- string result = Channel.DelChannelInfo(id,type);
- string[] str = result.Split('|');
-
- if (str[1]== "成功")
- {
- return this.ResponseJson(System.Net.HttpStatusCode.OK, "保存成功");
- }
- //保存失败
- return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "保存失败");
- }
- //查询渠道信息
- public ActionResult SearchModuleInfos(string search, int page, int rows)
- {
- var user = GetCurrentUser();
- string dt = Channel.SearchModuleInfos(search, user.PersonID,page,rows);
- return Content(dt, "application/json");
- }
- public ActionResult GetChannelIdName()
- {
- string json = Channel.GetChannelIdName();
- return Content(json, "application/json");
- }
- /// <summary>
- /// 获取渠道项目combotree :valueField: 'id', textField: '名称'
- /// </summary>
- /// <returns></returns>
- public ActionResult GetChannelProjectTree()
- {
- string json = Channel.GetChannelProjectTree();
- return Content(json, "application/json");
- }
- /// <summary>
- /// 查询渠道编码
- /// </summary>
- /// <returns></returns>
- //string ChannelCode();
- public ActionResult ChannelCode()
- {
- return Content(Channel.ChannelCode(), "application/json");
- }
- /// <summary>
- /// 查询渠道名称
- /// </summary>
- /// <returns></returns>
- public string ChannelName(string Name)
- {
- string para= Channel.ChannelName(Name);
- string [] result= para.Split('|');
- if (result[0]!="1")
- {
- return "true";
- }
- return "false";
- }
- /// <summary>
- /// 根据渠道id查询人员信息
- /// </summary>
- /// <param name="channelid"></param>
- /// <returns></returns>
- public ActionResult Channelbusiness(string channelid)
- {
- string bussinessinfo = Channel.Channelbusiness(channelid);
- return Content(bussinessinfo, "application/json");
-
- }
- }
- }
|