| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Http; |
| | | using System.Web; |
| | | using System.Web.Http; |
| | | using VueWebApi.DLL.BLL; |
| | | using VueWebApi.Tools; |
| | | |
| | | namespace VueWebApi.Controllers |
| | | { |
| | | [RoutePrefix(prefix: "api/BasicSetting")] |
| | | [ControllerGroup("设å¤ç®¡ç", "å¨çº¿æ¥å£")] |
| | | public class DeviceManagerController : ApiController |
| | | { |
| | | //å®ä¹å
¨å±ä¿¡æ¯è¿ååé |
| | | ToMessage mes = new ToMessage(); |
| | | RedisHelper redis = new RedisHelper(); |
| | | |
| | | #region[设å¤ç±»åæ¥è¯¢] |
| | | /// <summary> |
| | | /// 设å¤ç±»åæ¥è¯¢ |
| | | /// </summary> |
| | | /// <param name="page">页ç </param> |
| | | /// <param name="rows">æ¯é¡µæ¾ç¤ºæ¡æ°</param> |
| | | /// <param name="prop">æåºå段</param> |
| | | /// <param name="order">æåºè§å</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceTypeSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceTypeSearch(int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //èµ·å§è®°å½rowNum |
| | | int endNum = rows * page; //ç»æè®°å½ rowNum |
| | | mes = DeviceManagerBLL.DeviceTypeSearch(startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设å¤ç±»åæ°å¢] |
| | | /// <summary> |
| | | /// 设å¤ç±»åæ°å¢ |
| | | /// </summary> |
| | | /// <param name="obj">æäº¤æ°æ®å¯¹è±¡</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateDeviceType")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateDeviceType([FromBody] JObject obj) |
| | | { |
| | | //string deviceid = obj["id"].ToString(); //设å¤ç±»åid(主é®) |
| | | string devicetypecode = obj["devicetypecode"].ToString(); //设å¤ç±»åç¼ç |
| | | string devicetypename = obj["devicetypename"].ToString(); //设å¤ç±»ååç§° |
| | | string devicetypedescipt = obj["devicetypedescipt"].ToString(); //设å¤ç±»åæè¿° |
| | | var usercode = HttpContext.Current.Request.Cookies["navTabId"].Value.ToString(); |
| | | mes = DeviceManagerBLL.AddUpdateDeviceType(devicetypecode, devicetypename, devicetypedescipt, usercode); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设å¤ç±»åå é¤] |
| | | /// <summary> |
| | | /// 设å¤ç±»åå é¤ |
| | | /// </summary> |
| | | /// <param name="devicetypeid">设å¤ç±»åID</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteDeviceType")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteDeviceType(string devicetypeid) |
| | | { |
| | | mes = DeviceManagerBLL.DeleteDeviceType(devicetypeid); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region[è®¾å¤æ¸
åæ¥è¯¢] |
| | | /// <summary> |
| | | /// è®¾å¤æ¸
åæ¥è¯¢ |
| | | /// </summary> |
| | | /// <param name="DeviceCode">设å¤ç¼ç </param> |
| | | /// <param name="DeviceName">设å¤åç§°</param> |
| | | /// <param name="Status">使ç¨ç¶æ</param> |
| | | /// <param name="WorkShop">æå±è½¦é´</param> |
| | | /// <param name="DeviceType">设å¤ç±»å</param> |
| | | /// <param name="DeviceGroup">设å¤ç»</param> |
| | | /// <param name="page">页ç </param> |
| | | /// <param name="rows">æ¯é¡µæ¾ç¤ºæ¡æ°</param> |
| | | /// <param name="prop">æåºå段</param> |
| | | /// <param name="order">æåºè§å</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeviceMangerSearch")] |
| | | [HttpGet] |
| | | public HttpResponseMessage DeviceMangerSearch(string DeviceCode = null, string DeviceName = null, string Status = null, string WorkShop = null,string DeviceType=null,string DeviceGroup=null,int page = 0, int rows = 0, string prop = null, string order = null) |
| | | { |
| | | int startNum = rows * (page - 1) + 1; //èµ·å§è®°å½rowNum |
| | | int endNum = rows * page; //ç»æè®°å½ rowNum |
| | | mes = DeviceManagerBLL.DeviceMangerSearch(DeviceCode, DeviceName, Status, WorkShop, DeviceType, DeviceGroup, startNum, endNum, prop, order); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[è®¾å¤æ¸
åæ°å¢ç¼è¾] |
| | | /// <summary> |
| | | /// è®¾å¤æ¸
åæ°å¢ç¼è¾ |
| | | /// </summary> |
| | | /// <param name="obj">æäº¤æ°æ®å¯¹è±¡</param> |
| | | /// <returns></returns> |
| | | [Route(template: "AddUpdateDeviceManger")] |
| | | [HttpPost] |
| | | public HttpResponseMessage AddUpdateDeviceManger([FromBody] JObject obj) |
| | | { |
| | | string deviceid = obj["id"].ToString(); //è®¾å¤æ¸
åid(主é®) |
| | | string devicecode = obj["devicecode"].ToString(); //设å¤ç¼ç |
| | | string devicename = obj["devicename"].ToString(); //设å¤åç§° |
| | | string devicetype = obj["devicetype"].ToString(); //设å¤ç±»å |
| | | string devicegroup = obj["devicegroup"].ToString(); //设å¤ç» |
| | | string importdate = obj["importdate"].ToString(); //æå
¥æ¥æ |
| | | string workshop = obj["workshop"].ToString(); //æå±è½¦é´ |
| | | string status = obj["status"].ToString(); //使ç¨ç¶æ |
| | | string ratio = obj["ratio"].ToString(); //稼å¨ç |
| | | var usercode = HttpContext.Current.Request.Cookies["navTabId"].Value.ToString(); |
| | | string OperType = obj["OperType"].ToString(); //æä½ç±»å |
| | | mes = DeviceManagerBLL.AddUpdateDeviceManger(deviceid, devicecode, devicename, devicetype, devicegroup, importdate, workshop, status, ratio, usercode, OperType); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[è®¾å¤æ¸
åå é¤] |
| | | /// <summary> |
| | | /// è®¾å¤æ¸
åå é¤ |
| | | /// </summary> |
| | | /// <param name="deviceid">设å¤ID</param> |
| | | /// <returns></returns> |
| | | [Route(template: "DeleteDeviceManger")] |
| | | [HttpPost] |
| | | public HttpResponseMessage DeleteDeviceManger(string deviceid) |
| | | { |
| | | mes = DeviceManagerBLL.DeleteDeviceManger(deviceid); |
| | | return TJson.toJson(mes); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | using VueWebApi.DLL.DAL; |
| | | using VueWebApi.Tools; |
| | | |
| | | namespace VueWebApi.DLL.BLL |
| | | { |
| | | public class DeviceManagerBLL |
| | | { |
| | | #region[设å¤ç±»åæ¥è¯¢] |
| | | public static ToMessage DeviceTypeSearch(int startNum, int endNum, string prop, string order) |
| | | { |
| | | return DeviceManagerDAL.DeviceTypeSearch(startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设å¤ç±»åæ°å¢] |
| | | public static ToMessage AddUpdateDeviceType(string devicetypecode, string devicetypename, string devicetypedescipt, string usercode) |
| | | { |
| | | return DeviceManagerDAL.AddUpdateDeviceType(devicetypecode, devicetypename, devicetypedescipt, usercode); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设å¤ç±»åå é¤] |
| | | public static ToMessage DeleteDeviceType(string devicetypeid) |
| | | { |
| | | return DeviceManagerDAL.DeleteDeviceType(devicetypeid); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region [è®¾å¤æ¸
åæ¥è¯¢] |
| | | public static ToMessage DeviceMangerSearch(string deviceCode, string deviceName, string status, string workShop, string deviceType, string deviceGroup, int startNum, int endNum, string prop, string order) |
| | | { |
| | | return DeviceManagerDAL.DeviceMangerSearch(deviceCode, deviceName, status, workShop, deviceType, deviceGroup, startNum, endNum, prop, order); |
| | | } |
| | | #endregion |
| | | |
| | | #region[è®¾å¤æ¸
åæ°å¢ç¼è¾] |
| | | public static ToMessage AddUpdateDeviceManger(string deviceid, string devicecode, string devicename, string devicetype, string devicegroup, string importdate, string workshop, string status, string ratio, string usercode, string operType) |
| | | { |
| | | return DeviceManagerDAL.AddUpdateDeviceManger(deviceid, devicecode, devicename, devicetype, devicegroup, importdate, workshop, status, ratio, usercode, operType); |
| | | } |
| | | #endregion |
| | | |
| | | #region[è®¾å¤æ¸
åå é¤] |
| | | public static ToMessage DeleteDeviceManger(string deviceid) |
| | | { |
| | | return DeviceManagerDAL.DeleteDeviceManger(deviceid); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | using VueWebApi.Tools; |
| | | |
| | | namespace VueWebApi.DLL.DAL |
| | | { |
| | | public class DeviceManagerDAL |
| | | { |
| | | #region[设å¤ç±»åæ¥è¯¢] |
| | | public static ToMessage DeviceTypeSearch(int startNum, int endNum, string prop, string order) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设å¤ç±»åæ°å¢] |
| | | public static ToMessage AddUpdateDeviceType(string devicetypecode, string devicetypename, string devicetypedescipt, string usercode) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | #endregion |
| | | |
| | | #region[设å¤ç±»åå é¤] |
| | | public static ToMessage DeleteDeviceType(string devicetypeid) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region [è®¾å¤æ¸
åæ¥è¯¢] |
| | | public static ToMessage DeviceMangerSearch(string deviceCode, string deviceName, string status, string workShop, string deviceType, string deviceGroup, int startNum, int endNum, string prop, string order) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | #endregion |
| | | |
| | | #region[è®¾å¤æ¸
åæ°å¢ç¼è¾] |
| | | public static ToMessage AddUpdateDeviceManger(string deviceid, string devicecode, string devicename, string devicetype, string devicegroup, string importdate, string workshop, string status, string ratio, string usercode, string operType) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | #endregion |
| | | |
| | | #region[è®¾å¤æ¸
åå é¤] |
| | | public static ToMessage DeleteDeviceManger(string deviceid) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | <Compile Include="Areas\HelpPage\SampleGeneration\TextSample.cs" /> |
| | | <Compile Include="Areas\HelpPage\XmlDocumentationProvider.cs" /> |
| | | <Compile Include="Controllers\BasicSettingController.cs" /> |
| | | <Compile Include="Controllers\DeviceManagerController.cs" /> |
| | | <Compile Include="Controllers\ImportExcelController.cs" /> |
| | | <Compile Include="Controllers\LoginController.cs" /> |
| | | <Compile Include="Controllers\SystemSettingController.cs" /> |
| | | <Compile Include="Controllers\ValuesController.cs" /> |
| | | <Compile Include="DLL\BLL\BasicSettingBLL.cs" /> |
| | | <Compile Include="DLL\BLL\DeviceManagerBLL.cs" /> |
| | | <Compile Include="DLL\BLL\ExcelCheckBLL.cs" /> |
| | | <Compile Include="DLL\BLL\LoginBLL.cs" /> |
| | | <Compile Include="DLL\BLL\SystemSettingBLL.cs" /> |
| | | <Compile Include="DLL\BLL\UserDataBLL.cs" /> |
| | | <Compile Include="DLL\DAL\BasicSettingDAL.cs" /> |
| | | <Compile Include="DLL\DAL\DeviceManagerDAL.cs" /> |
| | | <Compile Include="DLL\DAL\ExcelCheckDAL.cs" /> |
| | | <Compile Include="DLL\DAL\LoginDAL.cs" /> |
| | | <Compile Include="DLL\DAL\SystemSettingDAL.cs" /> |
| | |
| | | <IISExpressWindowsAuthentication /> |
| | | <IISExpressUseClassicPipelineMode /> |
| | | <UseGlobalApplicationHostFile /> |
| | | <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig> |
| | | <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> |
| | | <NameOfLastUsedPublishProfile>D:\æ°å¯è¿ªMES\VueWebApi\VueWebApi\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <ProjectView>ShowAllFiles</ProjectView> |
| | | <Controller_SelectedScaffolderID>ApiControllerEmptyScaffolder</Controller_SelectedScaffolderID> |