123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using Microsoft.AspNetCore.Mvc;using WMS.BZWeb;
- using WMS.Core;
- using WMS.Core.ServiceCore;
- using WMS.Info;
- namespace WMS.BZWeb
- {
- [Area("WCSManager")]
- public class WcsDeviceInfoController : MvcControllerBase
- {
- WcsDeviceInfoService bll = new WcsDeviceInfoService();
- WcsDeviceprotocolService deviceprotocolService = new WcsDeviceprotocolService();
- #region 视图功能
- // GET: WCSManager/WcsDeviceInfo
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
- public ActionResult GenerateDeviceForm()
- {
- return View();
- }
- #endregion
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- [HttpGet]
- ////[AjaxOnly]
- public ActionResult GetSelectDeviceNameList()
- {
- return Success(bll.GetSelectDeviceNameList());
- }
- #region 获取数据
- /// <summary>
- /// 获取页面显示列表数据
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- ////[AjaxOnly]
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = InitPagination(pagination);
- var data = bll.GetPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
- /// <summary>
- /// 获取表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpGet]
- ////[AjaxOnly]
- public ActionResult GetFormData(string keyValue)
- {
- var wcsDeviceEntity = bll.GetEntity(keyValue);
- //var WCS_DEVICEPROTOCOLData = wcsdeviceinfoIBLL.GetWCS_DEVICEPROTOCOLList(WCS_DEVICEData.CODE);
- var list= deviceprotocolService.GetEntityByDevicecode(keyValue);
- var jsonData = new
- {
- WCS_DEVICE = wcsDeviceEntity,
- WCS_DEVICEPROTOCOL = list
- //WCS_DEVICEPROTOCOL = WCS_DEVICEPROTOCOLData,
- };
- return Success(jsonData);
- }
- #endregion
- #region 提交数据
- /// <summary>
- /// 删除实体数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- ////[AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- bll.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="strEntity">实体</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- ////[AjaxOnly]
- public ActionResult SaveForm(string keyValue, WcsDeviceEntity strEntity, List<WcsDeviceprotocolEntity> strwCS_DEVICEPROTOCOLList)
- {
- LoginUserInfo LoginUser = LoginBLLCore.GetLoginUser();
- bll.SaveEntity(LoginUser, keyValue, strEntity, strwCS_DEVICEPROTOCOLList);
- //bll.SaveEntity(LoginUser, keyValue, entity);
- return Success("保存成功!");
- }
- [HttpPost]
- [ValidateAntiForgeryToken]
- ////[AjaxOnly]
- public ActionResult SaveGenerateDevice(GenerateDevice entity)
- {
- LoginUserInfo LoginUser = LoginBLLCore.GetLoginUser();
- bll.SaveGenerateDevice(LoginUser, entity);
- //bll.SaveEntity(LoginUser, keyValue, entity);
- return Success("保存成功!");
- }
-
-
- #endregion
- }
- }
|