zhao
2021-06-04 c7ec496f9e41c2227103b3ef776e4a3f91bce6b2
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
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.Basic.Controllers
{
    public class OwnerController : BaseController
    {
        public ActionResult Index()
        {
            return View();
        }
 
        public ActionResult Edit(string guid)
        {
            TN_WM_B_OWNEREntity entity = new TN_WM_B_OWNEREntity();
            if (!string.IsNullOrEmpty(guid))
            {
                string result = HttpWMS_Get("api/Owner/GetById?guid=" + guid);
                OperateResult opResult = JsonConvert.DeserializeObject<OperateResult>(result);
                if (!opResult.Success)
                {
                    entity.OperateMessage = opResult.Msg;
                }
                else
                {
                    entity = opResult.GetData<TN_WM_B_OWNEREntity>();
                }
            }
            return View(entity);
        }
 
        #region 新增修改
        /// <summary>
        /// 新增修改
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [HttpPost]
        public string Edit(TN_WM_B_OWNEREntity entity)
        {
            return HttpWMS_Post("api/Owner/Edit", JsonConvert.SerializeObject(new
            {
                TokenId = ViewConstants.TokenId,
                PostData = entity
            }));
        }
        #endregion
 
        public string Delete(string guid)
        {
            return HttpWMS_Get("api/Owner/Delete?guid=" + guid);
        }
 
        public string OwnerList(string owner, int pageIndex, int pageSize)
        {
            return HttpWMS_Post("api/Owner/OwnerList", JsonConvert.SerializeObject(new
            {
                TokenId = ViewConstants.TokenId,
                PageIndex = pageIndex,
                PageSize = pageSize,
                SearchCondition = new
                {
                    owner = owner
                }
            }));
        }
    }
}