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);
|
}
|
}
|
|
}
|
}
|