南骏 池
2024-09-01 fc1b563df6d0405a24e7898c997bd52472ae9154
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
using DevExpress.XtraEditors;
using Gs.DevApp.Models;
using Gs.DevApp.ToolBox;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace Gs.DevApp.DevFrm.User
{
    public partial class UserAdd : DevExpress.XtraEditors.XtraForm
    {
        public UserAdd(string guid)
        {
            InitializeComponent();
            btnSave.Click += BtnSave_Click;
            btnEsc.Click += BtnEsc_Click;
            lbGuid.Text = guid;
        }
 
        private void BtnEsc_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }
 
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtAccount.Text.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("登录账号不能为空!");
                txtAccount.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtPwd.Text.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("密码不能为空!");
                txtPwd.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtUserName.Text.Trim()))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("菜单状态不能为空!");
                txtUserName.Focus();
                return;
            }
            var _obj = new
            {
                account = "string",
                password = "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                userName = "string",
                address = "string",
                tel = "string",
                email = "string",
                isLocked = 0,
                flagAdmin = 0,
                flagOnline = 0,
                loginCounter = 0,
                workerID = "string",
                remark = "string",
                departGuid = "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                isSys = 0
            };
            string strJson = "";
            try
            {
                strJson = UtilityHelper.HttpPost("", "User/EditModel", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson);
                ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                if (_rtn.rtnCode > 0)
                {
 
                }
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
 
    }
}