winform+dev的前后台分离标准项目
lg
2024-08-27 978d57ea2e89b07508f01f800ee97b36f19adec2
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
using DevExpress.XtraEditors;
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
{
    public partial class FrmLogin : DevExpress.XtraEditors.XtraForm
    {
        public FrmLogin()
        {
            InitializeComponent();
            btnLogin.Click += BtnLogin_Click;
            btnCancel.Click += BtnCancel_Click;
        }
 
        private void BtnCancel_Click(object sender, EventArgs e)
        {
            if (Msg.AskQuestion("确定要退出系统吗?"))
            {
                // frmMain1.IsClosing = true;
                Application.Exit();
            }
        }
 
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            //int i = 199;
            //ShowDialogForm sdf = new ShowDialogForm("提示", "正在登录......", "请耐心等候,正在验证您的身份!", i);
            //for (int j = 1; j < i; j++) 
            //{ 
            //    sdf.SetCaption("执行进度(" + j.ToString() + "/" + i.ToString() + ")"); 
            //}
            var _obj = new
            {
                accountPwd = txtUser.Text.Trim(),
                accountNo = txtPwd.Text.Trim(),
                orgGuid = Guid.NewGuid()
            };
            string json = JsonConvert.SerializeObject(_obj);
            try
            {
                Utility.HttpPost("", "User/UserLogin", json);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            //  sdf.Close();
 
        }
    }
}