wxw
2025-05-12 c2dc3bd2569f8398e2710aca2685bb3115c77eb0
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
using System.Collections.Generic;
using System.Linq;
using Common;
using Model;
using Lib;
using BLL;
using System.Web.Mvc;
using System;
 
namespace wms
 
{
    public class HomeController : MasterPage
    {
        // GET: Home
        [LoginFilter]
        public ActionResult Index()
        {
            return View();
        }
 
        public ActionResult LoginOut()
        {
            //return Redirect("/Login/Login");
            return Redirect("/Login/Login");
        }
 
        [LoginFilter]
        public ActionResult UserList()
        {
            ViewBag.DepartList = LocalHelper.GetDepartList(string.Empty);
            ViewBag.RoleList = LocalHelper.GetRoleList(string.Empty);
            return View();
        }
 
        [LoginFilter]
        public ActionResult AddUser()
        {
            string userCode = Request.QueryString.Get("UserCode");
            if (userCode.IsEmpty())
            {
                ViewBag.DepartList = LocalHelper.GetDepartList(string.Empty);
                ViewBag.RoleList = LocalHelper.GetRoleList(string.Empty);
                ViewBag.Admin = new UserInfo();
 
            }
            else
            {
                IDALUserInfo provider = new DALUserInfo();
                UserInfo entity = provider.GetModel(userCode);
                entity = entity == null ? new UserInfo() : entity;
                ViewBag.RoleList = LocalHelper.GetRoleList(entity.RoleName);
                ViewBag.DepartList = LocalHelper.GetDepartList(entity.DepartName);
                ViewBag.Admin = entity;
 
            }
            return View();
        }
 
        [LoginFilter]
        public ActionResult AdminPass()
        {
            return View();
        }
        [LoginFilter]
        public ActionResult ChangePass()
        {
            return View();
        }
 
        [LoginFilter]
        public ActionResult RoleList()
        {
            return View();
        }
 
        [LoginFilter]
        public ActionResult AddRole()
        {
            string RoleNum = Request.QueryString.Get("RoleNum");
            if (RoleNum.IsEmpty())
            {
                ViewBag.Role = new Roles();
            }
            else
            {
                IDALRoles provider = new DALRoles();
                Roles entity = provider.GetModel(RoleNum);
                entity = entity == null ? new Roles() : entity;
                ViewBag.Role = entity;
 
            }
            return View();
 
        }
 
        [LoginFilter]
        public ActionResult DepartMentList()
        {
            return View();
        }
 
        [LoginFilter]
        public ActionResult AddDepartMent()
        {
            string DepartNum = Request.QueryString.Get("DepartNum");
            if (DepartNum.IsEmpty())
            {
                ViewBag.Depart = new DepartMent();
            }
            else
            {
                IDALDepartMent provider = new DALDepartMent();
                DepartMent entity = provider.GetModel(DepartNum);
                entity = entity == null ? new DepartMent() : entity;
                ViewBag.Depart = entity;
 
            }
            return View();
        }
 
        [LoginFilter]
        public ActionResult ResMenuList()
        {
            return View();
        }
        [LoginFilter]
        public ActionResult AddResMenu()
        {
            string ResNum = Request.QueryString.Get("ResNum");
            if (ResNum.IsEmpty())
            {
                ViewBag.ResParentMenu = LocalHelper.GetResMenuList(string.Empty);
                ViewBag.ResMenu = new ResMenu();
 
            }
            else
            {
                IDALResMenu provider = new DALResMenu();
                ResMenu entity = provider.GetModel(ResNum);
                entity = entity == null ? new ResMenu() : entity;
                ViewBag.ResParentMenu = LocalHelper.GetResMenuList(entity.ParentName);
                ViewBag.ResMenu = entity;
 
            }
            return View();
        }
 
        public ActionResult RolePermisson()
        {
            return View();
        }
 
        public ActionResult GetBtn()
        {
            var dd = Request["UserCode"];
            var dd2 = Request["Title"];
            if (UserBtn != null)
            {
                // if (dd.ToString() == UserBtn.UserCode && !(dd2.ToString()).IsEmpty())
                if (!(dd2.ToString()).IsEmpty())
                {
                    List<GetBtn> btns = UserBtn.Btns.Where(a => a.PrantName == dd2.ToString()).ToList<GetBtn>();
 
                    if (btns == null) return Content(null);
 
                    List<PriBtns> lbts = new List<PriBtns>();
 
                    //Hashtable ht = new Hashtable();
                    PriBtns pbts = new PriBtns();
                    pbts.Name = "add";
                    pbts.Css = btns[0].Add;
                    lbts.Add(pbts);
 
                    PriBtns pbts1 = new PriBtns();
                    pbts1.Name = "edit";
                    pbts1.Css = btns[0].Edit;
                    lbts.Add(pbts1);
 
                    PriBtns pbts2 = new PriBtns();
                    pbts2.Name = "del";
                    pbts2.Css = btns[0].Del;
                    lbts.Add(pbts2);
 
                    PriBtns pbts3 = new PriBtns();
                    pbts3.Name = "audit";
                    pbts3.Css = btns[0].Audit;
                    lbts.Add(pbts3);
 
                    PriBtns pbts4 = new PriBtns();
                    pbts4.Name = "delete";
                    pbts4.Css = btns[0].Del;
                    lbts.Add(pbts4);
 
                    PriBtns pbts5 = new PriBtns();
                    pbts5.Name = "print";
                    pbts5.Css = btns[0].Print;
                    lbts.Add(pbts5);
 
                    PriBtns pbts6 = new PriBtns();
                    pbts6.Name = "reset";
                    pbts6.Css = btns[0].Reset;
                    lbts.Add(pbts6);
 
                    PriBtns pbts7 = new PriBtns();
                    pbts7.Name = "permission";
                    pbts7.Css = btns[0].Permission;
                    lbts.Add(pbts7);
 
 
                    PriBtns pbts8 = new PriBtns();
                    pbts8.Name = "input";
                    pbts8.Css = btns[0].Input;
                    lbts.Add(pbts8);
 
                    PriBtns pbts9 = new PriBtns();
                    pbts9.Name = "output";
                    pbts9.Css = btns[0].Output;
                    lbts.Add(pbts9);
 
                    PriBtns pbts10 = new PriBtns();
                    pbts10.Name = "stocktaking";
                    pbts10.Css = btns[0].Stocktaking;
                    lbts.Add(pbts10);
 
                    PriBtns pbts11 = new PriBtns();
                    pbts11.Name = "buildtask";
                    pbts11.Css = btns[0].Buildtask;
                    lbts.Add(pbts11);
 
                    PriBtns pbts12 = new PriBtns();
                    pbts12.Name = "setstock";
                    pbts12.Css = btns[0].Setstock;
                    lbts.Add(pbts12);
 
                    PriBtns pbts13 = new PriBtns();
                    pbts13.Name = "out";
                    pbts13.Css = btns[0].Out;
                    lbts.Add(pbts13);
 
                    PriBtns pbts14 = new PriBtns();
                    pbts14.Name = "send";
                    pbts14.Css = btns[0].Send;
                    lbts.Add(pbts14);
 
                    PriBtns pbts15 = new PriBtns();
                    pbts15.Name = "complete";
                    pbts15.Css = btns[0].Complete;
                    lbts.Add(pbts15);
 
                    PriBtns pbts16 = new PriBtns();
                    pbts16.Name = "cancel";
                    pbts16.Css = btns[0].Cancel;
                    lbts.Add(pbts16);
 
                    PriBtns pbts17 = new PriBtns();
                    pbts17.Name = "jiePi";
                    pbts17.Css = btns[0].jiePi;
                    lbts.Add(pbts17);
 
                    PriBtns pbts18 = new PriBtns();
                    pbts18.Name = "run";
                    pbts18.Css = btns[0].run;
                    lbts.Add(pbts18);
 
                    string json = JsonHelper.IListToJson(lbts, "List");
 
                    return Content(json);
                }
            }
 
 
            return Content(null);
        }
        /// <summary>
        /// 判断密码使用时间是否大于30
        /// </summary>
        /// <returns></returns>
        public ActionResult IsPasswordExpired()
        {
            string json = "False";
            if (LoginUser != null)
            {
                var UpdateTime = LoginUser.UpdateTime;
                var NowTime = DateTime.Now;
                TimeSpan span = NowTime.Subtract(UpdateTime);
                if (span.Days + 1 > 30)
                {
                    json = "True";
                }
            }
 
            return Content(json);
        }
 
        public ActionResult Top()
        {
            return View();
        }
        public ActionResult Left()
        {
            return View();
        }
        public ActionResult Right()
        {
            return View();
        }
        public ActionResult Title()
        {
            return View();
        }
        public ActionResult HomeIframe()
        {
            return View();
        }
    }
}