2024-07-01 16:52:48 +00:00
|
|
|
|
using CsharpHttpHelper;
|
|
|
|
|
using DevExpress.XtraEditors;
|
|
|
|
|
using DeviceRepair.Models;
|
|
|
|
|
using DeviceRepair.Models.Enum;
|
|
|
|
|
using DeviceRepairAndOptimization.Common;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace DeviceRepairAndOptimization.Pages.Common
|
|
|
|
|
{
|
|
|
|
|
public partial class pageSignature : XtraForm
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 操作人
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string OperateBy
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return bTxtUserCode.Text.Trim();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 操作人密码
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string OperateByPwd
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return bTxtPassword.Text.Trim();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 备注
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ConfirmNotes
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return bTxtNotes.Text.Trim();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 待认证的权限字符串
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string AuthString
|
|
|
|
|
{
|
|
|
|
|
get; set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private UserConfirmModel m_ConfirmModel;
|
|
|
|
|
public UserConfirmModel ConfirmModel
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return m_ConfirmModel;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
m_ConfirmModel = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 验证内容描述
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string ConfirmContent
|
|
|
|
|
{
|
|
|
|
|
get;
|
|
|
|
|
set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool? NeedNotes { get; set; }
|
|
|
|
|
public bool? CanNa { get; set; }
|
|
|
|
|
|
|
|
|
|
public int NoteMaxLen { get; set; } = 200;
|
|
|
|
|
|
|
|
|
|
public ApiOperationRtn OperationResult;
|
|
|
|
|
|
|
|
|
|
public pageSignature()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void pageSignature_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Text = $"用户确认-{ConfirmContent}";
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
XtraMessageBoxHelper.Error(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnCancel_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.DialogResult = DialogResult.Cancel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnOK_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrWhiteSpace(OperateBy))
|
|
|
|
|
{
|
|
|
|
|
XtraMessageBoxHelper.Error("请录入账号!");
|
|
|
|
|
bTxtUserCode.Focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-17 02:32:45 +00:00
|
|
|
|
if (OperateBy.Length > 50)
|
|
|
|
|
{
|
|
|
|
|
XtraMessageBoxHelper.Error("输入的账号长度不正确!");
|
|
|
|
|
bTxtUserCode.Focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-01 16:52:48 +00:00
|
|
|
|
if (string.IsNullOrEmpty(OperateByPwd))
|
|
|
|
|
{
|
|
|
|
|
XtraMessageBoxHelper.Error("请录入密码!");
|
|
|
|
|
bTxtPassword.Focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-17 02:32:45 +00:00
|
|
|
|
if (OperateByPwd.Length > 200)
|
|
|
|
|
{
|
|
|
|
|
XtraMessageBoxHelper.Error("输入的密码长度不正确!");
|
|
|
|
|
bTxtUserCode.Focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-01 16:52:48 +00:00
|
|
|
|
if (NeedNotes ?? false)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(ConfirmNotes))
|
|
|
|
|
{
|
|
|
|
|
XtraMessageBoxHelper.Error("备注必须录入,请录入备注!");
|
|
|
|
|
bTxtNotes.Focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!CanNa ?? true)
|
|
|
|
|
{
|
|
|
|
|
if (ConfirmNotes.Equals("NA", StringComparison.CurrentCultureIgnoreCase) || ConfirmNotes.Equals("N/A", StringComparison.CurrentCultureIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
XtraMessageBoxHelper.Error("备注必须录入且不允许为N/A或NA,请录入备注!");
|
|
|
|
|
bTxtNotes.Focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ConfirmNotes.Length > NoteMaxLen)
|
|
|
|
|
{
|
|
|
|
|
XtraMessageBoxHelper.Error($"备注必须录入且长度不允许大于{NoteMaxLen},请检查!");
|
|
|
|
|
bTxtNotes.Focus();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
APIResponseData apiResponseData = Biz.UserManager.Instance.UserConfirm(new DeviceRepair.Models.History.UserConfirmHistory
|
|
|
|
|
{
|
|
|
|
|
bSuccess = false,
|
|
|
|
|
cContent = ConfirmContent,
|
|
|
|
|
cModel = ConfirmModel.Description(),
|
|
|
|
|
ConfirmAuth = AuthString,
|
|
|
|
|
UserCode = OperateBy,
|
|
|
|
|
PassWord = HttpHelper.ToMD5(OperateByPwd),
|
|
|
|
|
Note = ConfirmNotes
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!apiResponseData.IsSuccess)
|
|
|
|
|
throw new Exception(apiResponseData.Message);
|
|
|
|
|
|
|
|
|
|
OperationResult = apiResponseData.ToDeserializeObject<ApiOperationRtn>();
|
|
|
|
|
DialogResult = DialogResult.OK;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
XtraMessageBoxHelper.Error(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|