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
///
/// 信息提示框
///
///
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;
}
///
/// 警告提示框
///
///
public static void ShowWarnMsgBox(string msg)
{
MessageBox.Show(msg, @"警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
///
/// 错误提示框
///
///
public static void ShowErrorMsgBox(string msg)
{
MessageBox.Show(msg, @"错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#endregion MessageBox
}
}