zhao
2021-06-24 02ca96debc6056275d58e55d97f7885a195542d0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using HH.WMS.Entitys;
using HH.WMS.WebUI.Controllers;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
 
namespace HH.WMS.WebUI.Areas.Sys.Controllers
{
    public class PageSetController : BaseController
    {
        public ActionResult Index()
        {
            return View();
        }
 
        public ActionResult Edit(string id, string power)
        {
            TN_WM_POWER_ENABLED_DTLEntity entity = new TN_WM_POWER_ENABLED_DTLEntity()
            {
                CN_S_PARENTID = power
            };
            if (!string.IsNullOrEmpty(id))
            {
                string result = HttpWMS_Get("api/PageSet/GetById?id=" + id);
                var resultEntity = JsonConvert.DeserializeObject<OperateResult>(result);
                entity = resultEntity.GetData<TN_WM_POWER_ENABLED_DTLEntity>();
            }
            return View(entity);
        }
 
        [HttpPost]
        public string Edit(TN_WM_POWER_ENABLED_DTLEntity entity)
        {
            var data = new
            {
                TokenId = ViewConstants.TokenId,
                PostData = entity
            };
            return HttpWMS_Post("api/PageSet/Edit", JsonConvert.SerializeObject(data));
        }
 
        public string Delete(string id)
        {
            return HttpWMS_Get("api/PageSet/Delete?id=" + id);
        }
 
        public string GetPowerEnabled(string power, string code, string name)
        {
            return HttpWMS_Get("api/PageSet/GetPowerEnabled?power=" + power + "&code=" + code + "&name=" + name);
        }
 
        public string SetEnabled(TN_WM_POWER_ENABLED_DTLEntity entity)
        {
            var data = new
            {
                TokenId = ViewConstants.TokenId,
                PostData = entity
            };
            return HttpWMS_Post("api/PageSet/SetEnabled", JsonConvert.SerializeObject(data));
        }
 
        public string GetPageSetList()
        {
            return HttpWMS_Get("api/PageSet/GetPageSetList");
        }
 
        public string GetPowerType()
        {
            return HttpWMS_Get("api/PageSet/GetPowerType");
        }
    }
}