五丰称屠宰重客户端
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.
 

739 lines
25 KiB

using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using B3ButcherWeightClient.Data;
using BO;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.JsonRpc.Client.Data;
using Forks.Utils.Data;
using Timer = System.Threading.Timer;
namespace B3ButcherWeightClient {
public partial class Main : Form {
#region 变量实例
List<IDName> batchListOnit = new List<IDName>();
List<IDName> batchListNew = new List<IDName>();
private string _msg = string.Empty;
private readonly IDataFormat _dataFormat;
private Thread _insertThread;
private Thread _inQueryThread, _outQueryThread;
private bool _mainProcessIsRun;
private static DateTime NewToday {
get {
return new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, ConfigUtil.PerDayStartHour, 0, 0);
}
}
private static DateTime NextNewToday {
get { return NewToday.AddHours(24); }
}
private readonly ManualResetEvent _manualResetEvent = new ManualResetEvent(false);
private readonly object _queLocker = new object();
private readonly Queue<WeightTable> _weightQueue = new Queue<WeightTable>();
readonly ConcurrentQueue<string> _dataQueue = new ConcurrentQueue<string>();
readonly StringBuilder _dataStrBuilder = new StringBuilder();
readonly Form _parentForm;
readonly IList<Livestock.Info> _dTable = new List<Livestock.Info>();
readonly IList<Button> _btList = new List<Button>();
private Livestock.Info _currentInfo = new Livestock.Info();
static string startDate = NewToday.ToString("yyyy-MM-dd HH:mm:ss");//24小时
private readonly string _querySql = string.Format("select [ID],[Sequence],[PhaseCode],[DateTime],[Livestock_Name],[Weight],[SubWeight],[GoodsBatchName],[DmoID] from [WeightTable] where [DateTime] >='{0}' order by [ID] desc", startDate);
private string _querySeqSql = string.Format("select top 1 Sequence from [WeightTable] where [DateTime] > '{0}' and [DateTime] <'{1}' order by Sequence desc", NewToday.ToString("yyyy-MM-dd HH:mm"), NextNewToday.ToString("yyyy-MM-dd HH:mm"));
private DataSet _resultDataSet = new DataSet();
private readonly Timer _timer;
private const int WmProcessMessage = 0x0500 + 1;
private const int WmUpdDisplayMessage = 0x0500 + 2;
private const int WmUpdLanStateMessage = 0x0500 + 3;
private string _displayValue;
private int _mainHandle;
int MainHandle {
get {
if (_mainHandle == 0) {
_mainHandle = WinApiSendMessage.FindWindow(null, @"青花瓷称重客户端");
}
return _mainHandle;
}
}
#endregion
readonly AutoSizeFormClass _asc = new AutoSizeFormClass();
public Main(Form form) {
InitializeComponent();
monthCalendar.Visible = false;
dataGridView.AutoGenerateColumns = false;
OpenSerialPort();
_parentForm = form;
AddLivestockControl();
_displayValue = "display";
_mainProcessIsRun = true;
pictureBox2.Visible = false;
switch (ConfigUtil.CType) {
case "XK3130":
case "XK3124":
_dataFormat = new Xk3124DataFormat();
break;
case "IND560":
_dataFormat = new IND560DataFormat();
break;
case "Xk3190A9":
_dataFormat = new Xk3190A9DataFormat();
break;
default:
_dataFormat = new Xk3124DataFormat();
break;
}
BeginInsertThread();
ReadData();
_timer = new Timer(TimerClick, null, 0, 1000);
var syncThread = new Thread(SyncTask) { IsBackground = true };
syncThread.Start();
CheckForIllegalCrossThreadCalls = false;//线程间操作
tbxSequence.Text = "1";
if (ConfigUtil.SubWeight > 0) {
subWeightTextBox.Text = ConfigUtil.SubWeight.ToString();
}
textBoxBeginTime.Text = DateTime.Today.ToString("yyyy-MM-dd");
textBoxEndTime.Text = DateTime.Today.ToString("yyyy-MM-dd");
}
protected override void DefWndProc(ref Message m) {
switch (m.Msg) {
case WmProcessMessage:
QueryResult();
break;
case WmUpdDisplayMessage:
lblDisplay.Text = _displayValue;
break;
case WmUpdLanStateMessage:
break;
default:
base.DefWndProc(ref m);
break;
}
}
#region 控件事件
void bt_Click(object sender, EventArgs e) {
var bt = sender as Button;
foreach (var button in _btList) {
button.BackColor = Color.White;
}
if (bt != null) {
bt.BackColor = Color.OrangeRed;
_currentInfo = bt.Tag as Livestock.Info;
batchListOnit.Clear();
batchComboBox.Text = "";
batchComboBox.Items.Clear();
var o = RpcUtil.Call<IList<RpcObject>>(RpcUtil.GetGoodsBatch, _currentInfo.ID);
foreach (var rpcObject in o) {
var item = new IDName();
item.ID = rpcObject.Get<long>("ID");
item.Name = rpcObject.Get<string>("Name");
batchListOnit.Add(item);
}
batchComboBox.Items.AddRange(batchListOnit.Select(x => x.Name).ToArray());
}
}
private void Main_Load(object sender, EventArgs e) {
InitSequence();
//_asc.ControllInitializeSize(this);
//WindowState = FormWindowState.Maximized;
FormLoadQueryResult();
}
private void saveButton_Click(object sender, EventArgs e) {
decimal w;
if (numberTextBox.Text == "") {
MessageBox.Show("头数录入为空");
return;
}
int number;
if (!int.TryParse(numberTextBox.Text, out number)) {
MessageBox.Show("头数录入的格式错误");
return;
}
if (decimal.TryParse(_displayValue, out w)) {
AddWeightInfo(w, number);
QueryResult();
}
else {
MessageBox.Show("重量格式错误");
}
}
private void DataGridViewCellContentClick(object sender, DataGridViewCellEventArgs e) {
if (DeleteDetail.Index == e.ColumnIndex) {
if (MessageBox.Show("确定要删除吗?", "删除", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
return;
var sql = string.Format("delete [WeightTable] where id = {0}", dataGridView.Rows[e.RowIndex].Cells["ID"].Value);
//var sequence = dataGridView.Rows[e.RowIndex].Cells["Sequence"].Value;
using (var sqlUtil = new SqlUtil(ConfigUtil.ConnectionStr)) {
sqlUtil.ExecuteNonQuery(sql);
}
//同步删除远程数据库的数据
pictureBox2.Visible = !SyncUtil.TryDeleteServerData(dataGridView.Rows[e.RowIndex].Cells["ID"].Value.ToString(), out _msg);
dataGridView.Rows.RemoveAt(e.RowIndex);
InitSequence();
//
}
}
private void pictureBox2_Click(object sender, EventArgs e) {
MessageBox.Show(_msg);
}
private int textBoxNum;
private void textBoxBeginTime_DoubleClick(object sender, EventArgs e) {
textBoxNum = 1;
monthCalendar.Visible = true;
monthCalendar.Focus();
}
private void textBoxEndTime_DoubleClick(object sender, EventArgs e) {
textBoxNum = 2;
monthCalendar.Visible = true;
monthCalendar.Focus();
}
private void monthCalendar_DateSelected(object sender, DateRangeEventArgs e) {
if (textBoxNum == 1) {
textBoxBeginTime.Text = this.monthCalendar.SelectionStart.ToString("yyyy-MM-dd",
DateTimeFormatInfo.InvariantInfo);
}
if (textBoxNum == 2) {
string str = this.monthCalendar.SelectionStart.ToString("yyyy-MM-dd", DateTimeFormatInfo.InvariantInfo);
textBoxEndTime.Text = str;
}
monthCalendar.Visible = false;
}
#endregion
#region 方法
private void InitSequence() {
using (var sqlUtil = new SqlUtil(ConfigUtil.ConnectionStr)) {
var obj = sqlUtil.ExecuteScalar(_querySeqSql);
tbxSequence.Text = obj != null ? (long.Parse(obj.ToString()) + 1).ToString() : @"1";
}
}
private void AddLivestockControl() {
ConfigUtil.SetLivestock(_dTable);
var i = 0;
var j = 0;
foreach (var info in _dTable) {
var bt = new Button();
bt.Text = info.;
bt.Size = new Size(190, 100);
bt.Left = i * 193;
bt.Top = j * 102;
bt.Tag = info;
bt.Click += bt_Click;
panel1.Controls.Add(bt);
_btList.Add(bt);
i++;
if (i == 3) {
i = 0;
j++;
}
}
}
private void OpenSerialPort() {
_serialPort.PortName = ConfigUtil.ComName;
_serialPort.BaudRate = int.Parse(ConfigUtil.BaundRate);
_serialPort.DataBits = int.Parse(ConfigUtil.DataBits);
_serialPort.ReadBufferSize = 4096 * 100;
// 打开串口
if (!_serialPort.IsOpen) {
try {
_serialPort.Open();
} catch (InvalidOperationException) {
MessageBox.Show(@"指定的端口已打开");
} catch (UnauthorizedAccessException) {
MessageBox.Show(@"对端口的访问被拒绝");
}
}
}
// 接受数据: 称仪表连续输出
void ReadData() {
_inQueryThread = new Thread(InQuery);
_inQueryThread.Start();
_outQueryThread = new Thread(OutQuery);
_outQueryThread.Start();
}
private void InQuery() {
while (_mainProcessIsRun) {
int availableCount = _serialPort.BytesToRead;
if (availableCount == 0) {
Thread.Sleep(1);
}
char[] buffer = new char[availableCount];
_serialPort.Read(buffer, 0, availableCount);
foreach (var c in buffer) {
if (c == _dataFormat.Beginchar) {
_dataStrBuilder.Clear();
_dataStrBuilder.Append(c);
} else if (c == _dataFormat.Endchar || _dataStrBuilder.Length > _dataFormat.Bufsize) {
_dataStrBuilder.Append(c);
_dataQueue.Enqueue(_dataStrBuilder.ToString());
_dataStrBuilder.Clear();
} else {
_dataStrBuilder.Append(c);
}
}
}
}
private void OutQuery() {
while (_mainProcessIsRun) {
try {
bool isStatic;
string str;
string subStr;
if (!_dataQueue.TryDequeue(out subStr)) {
Thread.Sleep(1);
continue;
}
// 解析接受的端口数据
if (_dataFormat.ParseAscii(subStr, out str, out isStatic)) {
_displayValue = str;
lblDisplay.Text = _displayValue;
//WinApiSendMessage.SendMessage(_mainHandle, WmUpdDisplayMessage, 0, 0);
}
decimal num;
if (ConfigUtil.ReadType == "0") {
//五丰通过点击界面按钮来增加重量信息
//if (decimal.TryParse(str, out num)) {
// WeighAvgControl.Add(num, isStatic);
//}
//if (WeighAvgControl.TryGetValue(out num)) {
// AddWeightInfo(num);
//}
} else if (ConfigUtil.ReadType == "1") {
if (decimal.TryParse(str, out num)) {
if (num >= ConfigUtil.MinWeight && num <= ConfigUtil.MaxWeight)
AddWeightInfo(num);
}
}
} catch (Exception) {
Thread.Sleep(1000);
continue;
}
Thread.Sleep(1);
}
}
private void TimerClick(object o) {
WinApiSendMessage.SendMessage(MainHandle, WmUpdLanStateMessage, 0, 0);
}
private void AddWeightInfo(decimal curValue, int number = 1) {
var info = new WeightTable();
info.DateTime = DateTime.Now;
info.SubWeight = ConfigUtil.SubWeight;//默认取设置的扣重
decimal subWeight = 0;
if (!string.IsNullOrEmpty(subWeightTextBox.Text)) {
if (decimal.TryParse(subWeightTextBox.Text, out subWeight))
info.SubWeight = subWeight * number;
}
info.Weight = curValue - subWeight;
info.Livestock_ID = _currentInfo.ID;
info.Livestock_Name = _currentInfo.;
info.Sequence = long.Parse(tbxSequence.Text);
info.PhaseCode = jdTextBox.Text;
if (batchComboBox.Text.Length > 0) {
info.GoodsBatchName = batchComboBox.Text;
var batch = batchListOnit.FirstOrDefault(x => x.Name == info.GoodsBatchName);
if (batch != null)
info.GoodsBatchID = batch.ID;
}
info.Number = number;
WeightEnQueue(info);
}
private void WeightEnQueue(WeightTable inforStruct) {
Monitor.Enter(_queLocker);
_weightQueue.Enqueue(inforStruct);
_manualResetEvent.Set();
Monitor.Exit(_queLocker);
}
private WeightTable WeightDeQueue() {
Monitor.Enter(_queLocker);
WeightTable weightInfo = null;
if (_weightQueue.Count > 0) {
weightInfo = _weightQueue.Dequeue();
}
Monitor.Exit(_queLocker);
return weightInfo;
}
private void BeginInsertThread() {
_insertThread = new Thread(DoInser) { IsBackground = true };
_insertThread.Start(new object());
}
private void DoInser(object o) {
_manualResetEvent.WaitOne();
while (_mainProcessIsRun) {
var weightInfo = WeightDeQueue();//获取队列对象
if (weightInfo != null) {
string err = string.Empty;
try {
using (var context = new TransactionContext(Dmo.NewSession(ConfigUtil.ConnectionStr))) {
context.Session.Insert(weightInfo);
context.Commit();
}
tbxSequence.Text = (weightInfo.Sequence + 1).ToString();
} catch (Exception ex) {
err = ex.Message;
} finally {
lock (EncodeString.RwLocker) {
using (ISqlUtil sqlUtil = new SqlUtil(ConfigUtil.ConnectionStr)) {
try {
lock (EncodeString.RwLocker) {
_resultDataSet = sqlUtil.ExecuteSql(_querySql);
}
sqlUtil.Close();
} catch (Exception ex) {
MessageBox.Show(ex.Message);
}
}
}
}
if (!string.IsNullOrEmpty(err))
MessageBox.Show(err);
WinApiSendMessage.SendMessage(_mainHandle, WmProcessMessage, 0, 0);
}
}
}
private void QueryResult() {
lock (EncodeString.RwLocker) {
dataGridView.DataSource = _resultDataSet.Tables[0];
}
if (this.dataGridView.Rows.Count > 0) {
for (int index = 0; index < dataGridView.Rows.Count; index++) {
var row = dataGridView.Rows[index];
var dmoID = row.Cells["DmoID"].Value;
if (dmoID != DBNull.Value && ((long)dmoID) > 0) {
row.DefaultCellStyle.BackColor = Color.LawnGreen;
}
}
}
}
private void FormLoadQueryResult() {
using (ISqlUtil sqlUtil = new SqlUtil(ConfigUtil.ConnectionStr)) {
try {
lock (EncodeString.RwLocker) {
_resultDataSet = sqlUtil.ExecuteSql(_querySql);
}
sqlUtil.Close();
} catch (Exception ex) {
MessageBox.Show(ex.Message);
}
}
QueryResult();
}
void SyncTask() {
var sleeptime = 500;
pictureBox2.Visible = true;
while (_mainProcessIsRun) {
Thread.Sleep(sleeptime);
sleeptime = 20000;
if (string.IsNullOrEmpty(ConfigUtil.RemoteConStr)) {
_msg = "没有设置服务器数据库,无法同步!";
LogUtil.WriteLog(DateTime.Now + ":" + _msg);
continue;
}
pictureBox2.Visible = !SyncUtil.TryUpdateServerData(out _msg);
}
}
#endregion
private class WeighAvgControl {
public static bool TryGetValue(out decimal result) {
List<Tuple<decimal, bool>> list;
if (mWeighList.TryDequeue(out list)) {
var r = list.Where(x => x.Item2).Select(x => x.Item1).GroupBy(x => x);
var firstOrDefault = r.OrderByDescending(x => x.Count()).FirstOrDefault();
if (firstOrDefault != null) {
result = firstOrDefault.Key;
return true;
}
result = 0;
return false;
}
result = 0;
return false;
}
static ConcurrentQueue<List<Tuple<decimal, bool>>> mWeighList = new ConcurrentQueue<List<Tuple<decimal, bool>>>();
static List<Tuple<decimal, bool>> _list = new List<Tuple<decimal, bool>>();
public static void Add(decimal value, bool isStatic) {
if (value >= ConfigUtil.MinWeight && value <= ConfigUtil.MaxWeight) {
_list.Add(new Tuple<decimal, bool>(value, isStatic));
} else {
if (_list.Count > 0) {
mWeighList.Enqueue(_list);
_list = new List<Tuple<decimal, bool>>();
}
}
}
}
private void dataGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) {
if (!ConfigUtil.AllowChangeLevel) {
return;
}
// e.RowIndex
long id;
if (long.TryParse(dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString(), out id)) {
var levelName = dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString();
var f = new ChangeLevelForm();
f.Init(levelName);
if (f.ShowDialog() == DialogResult.OK) {
var newLevelId = f.mID;
var newLevelName = f.mName;
var updateSql = "update [WeightTable] set [Livestock_ID]=" + newLevelId + ",[Livestock_Name]='" + newLevelName + "' where ID=" + id + " ";
bool needUpdate = false;
lock (EncodeString.RwLocker) {
using (ISqlUtil sqlUtil = new SqlUtil(ConfigUtil.ConnectionStr)) {
try {
lock (EncodeString.RwLocker) {
sqlUtil.ExecuteNonQuery(updateSql);
_resultDataSet = sqlUtil.ExecuteSql(_querySql);
QueryResult();
needUpdate = true;
}
sqlUtil.Close();
} catch (Exception ex) {
MessageBox.Show(ex.Message);
}
}
}
if (needUpdate) {
//同步修改远程数据库的数据
pictureBox2.Visible = !SyncUtil.TryUpdateLevel(id.ToString(), newLevelId, newLevelName, out _msg);
}
}
}
}
private void button1_Click(object sender, EventArgs e) {
var form = new QueryForm();
form.StartPosition = FormStartPosition.CenterParent;
form.ShowDialog();
}
private void batchComboBox_TextUpdate(object sender, EventArgs e) {
batchComboBox.Items.Clear();
batchListNew.Clear();
if (batchComboBox.Text.Length == 0) {
batchComboBox.Items.AddRange(batchListOnit.Select(x => x.Name).ToArray());
} else {
foreach (var item in batchListOnit) {
if (item.Name.Contains(batchComboBox.Text)) {
batchListNew.Add(item);
}
}
batchComboBox.Items.AddRange(batchListNew.Select(x => x.Name).ToArray());
}
batchComboBox.SelectionStart = batchComboBox.Text.Length;
Cursor = Cursors.Default;
batchComboBox.DroppedDown = true;
}
private void setButton_Click(object sender, EventArgs e) {
var setForm = new Parameters();
setForm.ShowDialog();
}
private void button2_Click(object sender, EventArgs e) {
if (textBoxBeginTime.Text.Length == 0) {
MessageBox.Show("开始日期不能为空");
return;
}
if (textBoxEndTime.Text.Length == 0) {
MessageBox.Show("结束日期不能为空");
return;
}
var dmos = new List<WeightTable>();
using (var sqlUtil = new SqlUtil(ConfigUtil.ConnectionStr)) {
using (var context = new TransactionContext(Dmo.NewSession(sqlUtil, SessionBehaviors.None))) {
var dom = new DmoQuery(typeof(WeightTable));
dom.Where.Conditions.Add(DQCondition.IsNull(DQExpression.Field("DmoID")));
dom.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("DateTime", textBoxBeginTime.Text));
dom.Where.Conditions.Add(DQCondition.LessThanOrEqual("DateTime", string.Format("{0} 23:59:59", textBoxEndTime.Text)));
var list = context.Session.ExecuteList(dom);
foreach (WeightTable dmo in list) {
dmos.Add(dmo);
}
}
}
if (dmos.Count == 0) {
MessageBox.Show("没有可以创建单据的称重数据");
return;
}
var details = new ManyList("/MainSystem/B3ButcherManage/BO/CarcassPicking_WeightDetail");
foreach (var detail in dmos) {
var detail1 = new RpcObject("/MainSystem/B3ButcherManage/BO/CarcassPicking_WeightDetail");
detail1.Set("Goods_ID", detail.Livestock_ID);
detail1.Set("Goods_Name", detail.Livestock_Name);
detail1.Set("GoodsBatch_ID", detail.GoodsBatchID);
detail1.Set("SubWeight", detail.SubWeight);
detail1.Set("Weight", (detail.Weight ?? 0) + (detail.SubWeight ?? 0));
detail1.Set("DateTime", detail.DateTime);
details.Add(detail1);
}
var groups = dmos.GroupBy(x => new { x.Livestock_ID, x.GoodsBatchID });
var details2 = new ManyList("/MainSystem/B3ButcherManage/BO/CarcassPicking_Detail");
foreach (var @group in groups) {
var weight = @group.Sum(x => x.Weight ?? 0);
var subWeight = @group.Sum(x => x.SubWeight ?? 0);
var first = @group.FirstOrDefault();
var detail1 = new RpcObject("/MainSystem/B3ButcherManage/BO/CarcassPicking_Detail");
detail1.Set("Goods_ID", @group.Key.Livestock_ID);
detail1.Set("Goods_Name", first.Livestock_Name);
detail1.Set("GoodsBatch_ID", @group.Key.GoodsBatchID);
detail1.Set("BodyWeight", weight - subWeight);
detail1.Set("SecondNumber", @group.Sum(x => x.Number ?? 0) * 1.0m);
detail1.Set("Number", weight - subWeight);
details2.Add(detail1);
}
var bill = new RpcObject("/MainSystem/B3ButcherManage/BO/CarcassPicking");
bill.Set("Store_ID", ConfigUtil.StoreID);
bill.Set("Department_ID", ConfigUtil.DeptID);
bill.Set("InputType_ID", ConfigUtil.TouruID);
bill.Set("ProductionUnit_ID", ConfigUtil.ShengchanID);
bill.Set("AccountingUnit_ID", ConfigUtil.AccID);
bill.Set("Domain_ID", ConfigUtil.BanKuaiID);
bill.Set("Remark", "称重客户端上传");
bill.Set("Details", details2);
bill.Set("WeightDetails", details);
var id = RpcUtil.Call<long>(RpcUtil.InsertCarcassPicking, bill);
using (var sqlUtil = new SqlUtil(ConfigUtil.ConnectionStr)) {
using (var context = new TransactionContext(Dmo.NewSession(sqlUtil, SessionBehaviors.None))) {
var dom = new DQUpdateDom(typeof(WeightTable));
dom.Columns.Add(new DQUpdateColumn("DmoID", id));
dom.Columns.Add(new DQUpdateColumn("DmoTypeID", 2880 + 14));
dom.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), dmos.Select(x => DQExpression.ConstValue(x.ID)).ToArray()));
context.Session.ExecuteNonQuery(dom);
context.Commit();
}
}
var querySql = new StringBuilder();
querySql.Append("select [ID],[Sequence],[PhaseCode],[DateTime],[Livestock_Name],[Weight],[SubWeight],[GoodsBatchName],[DmoID] from [WeightTable] where [DmoID]=");
querySql.Append(id);
using (ISqlUtil sqlUtil = new SqlUtil(ConfigUtil.ConnectionStr)) {
lock (EncodeString.RwLocker) {
_resultDataSet = sqlUtil.ExecuteSql(querySql.ToString());
}
sqlUtil.Close();
}
lock (EncodeString.RwLocker) {
dataGridView.DataSource = _resultDataSet.Tables[0];
}
if (this.dataGridView.Rows.Count > 0) {
for (int index = 0; index < dataGridView.Rows.Count; index++) {
var row = dataGridView.Rows[index];
var dmoID = row.Cells["DmoID"].Value;
if (dmoID != DBNull.Value && ((long)dmoID) > 0) {
row.DefaultCellStyle.BackColor = Color.LawnGreen;
}
}
}
MessageBox.Show("成功创建单据No." + id);
}
private void button3_Click(object sender, EventArgs e)
{
string msg;
if(!RpcUtil.Logout(out msg))
{
MessageBox.Show(msg);
}
Environment.Exit(0);
}
}
class IDName {
public long ID { get; set; }
private string _name = string.Empty;
public string Name {
get { return _name; }
set { _name = value; }
}
}
}