You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
1.9 KiB
86 lines
1.9 KiB
3 years ago
|
using EC.AutoWeightServer.UI;
|
||
|
using EC.Entity.Organization;
|
||
|
using System;
|
||
|
using System.Windows.Forms;
|
||
|
|
||
|
namespace EC.AutoWeightServer.Center
|
||
|
{
|
||
|
public class UiExtendCenter
|
||
|
{
|
||
|
public static UserEntity LoginUser()
|
||
|
{
|
||
|
var frmLogin = new FrmPwdVerify()
|
||
|
{
|
||
|
StartPosition = FormStartPosition.CenterScreen,
|
||
|
TopMost = true
|
||
|
};
|
||
|
var ret = frmLogin.ShowDialog();
|
||
|
if (ret != DialogResult.Yes)
|
||
|
Environment.Exit(1);
|
||
|
return frmLogin.user;
|
||
|
}
|
||
|
|
||
|
public static bool VerifyUser(UserEntity tempUser)
|
||
|
{
|
||
|
var frmLogin = new FrmPwdVerify()
|
||
|
{
|
||
|
StartPosition = FormStartPosition.CenterScreen,
|
||
|
TopMost = true,
|
||
|
ShowInTaskbar = false
|
||
|
};
|
||
|
if (tempUser != null)
|
||
|
frmLogin.LockAccount(tempUser);
|
||
|
var ret = frmLogin.ShowDialog();
|
||
|
return ret == DialogResult.Yes;
|
||
|
}
|
||
|
|
||
|
public static void ShowBillFrame(FrmMainServer mainServer)
|
||
|
{
|
||
|
var frm = new FrmBill(mainServer)
|
||
|
{
|
||
|
StartPosition = FormStartPosition.CenterScreen,
|
||
|
TopMost = true,
|
||
|
ShowInTaskbar = false
|
||
|
};
|
||
|
frm.ShowDialog();
|
||
|
}
|
||
|
|
||
|
#region MessageBox
|
||
|
|
||
|
/// <summary>
|
||
|
/// 信息提示框
|
||
|
/// </summary>
|
||
|
/// <param name="msg"></param>
|
||
|
public static void ShowMsgBox(string msg)
|
||
|
{
|
||
|
MessageBox.Show(msg);
|
||
|
}
|
||
|
|
||
|
public static DialogResult ShowConfirmBox(string msg)
|
||
|
{
|
||
|
var ret = MessageBox.Show(msg, @"确认",
|
||
|
MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
|
||
|
return ret;
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 警告提示框
|
||
|
/// </summary>
|
||
|
/// <param name="msg"></param>
|
||
|
public static void ShowWarnMsgBox(string msg)
|
||
|
{
|
||
|
MessageBox.Show(msg, @"警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 错误提示框
|
||
|
/// </summary>
|
||
|
/// <param name="msg"></param>
|
||
|
public static void ShowErrorMsgBox(string msg)
|
||
|
{
|
||
|
MessageBox.Show(msg, @"错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||
|
}
|
||
|
|
||
|
#endregion MessageBox
|
||
|
}
|
||
|
}
|