Browse Source

..

master
robin 4 years ago
parent
commit
6d1ae5fac7
1 changed files with 38 additions and 17 deletions
  1. +38
    -17
      ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs

+ 38
- 17
ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs View File

@ -73,16 +73,7 @@ namespace ButcherFactory.SegmentProductionAuto_
}
void SegmentProductionAutoForm_FormClosing(object sender, FormClosingEventArgs e)
{
var unSyncCount = SegmentProductionBL.GetUnSyncCount();
if (unSyncCount > 0)
{
if (MessageBox.Show(string.Format("{0}条数据等待上传,确认关闭?", unSyncCount), "关闭确认", MessageBoxButtons.OKCancel) != DialogResult.OK)
{
e.Cancel = true;
}
}
{
if (initTask != null && initTask.IsAlive)
initTask.Abort();
if (uploadData != null && uploadData.IsAlive)
@ -90,6 +81,7 @@ namespace ButcherFactory.SegmentProductionAuto_
if (checkInStoreState != null && checkInStoreState.IsAlive)
checkInStoreState.Abort();
}
public WeightDetails mCache;
protected override void OnLoad(EventArgs e)
@ -163,8 +155,8 @@ namespace ButcherFactory.SegmentProductionAuto_
}
void BindBasicInfo()
{
this.Invoke(new Action(() =>
{
this.BeginInvoke(new Action(() =>
{
productBatchSelect.EBindComboBox<ProductBatch>(null, 6, "Date");
config = XmlUtil.DeserializeFromFile<NotAuto.SegmentProductionFormConfig>();
@ -624,11 +616,22 @@ namespace ButcherFactory.SegmentProductionAuto_
}
Thread.Sleep(5000);
}
}
private void closeBtn_Click(object sender, EventArgs e)
{
Close();
}
private void closeBtn_Click(object sender, EventArgs e)
{
var unSyncCount = SegmentProductionBL.GetUnSyncCount();
bool close = true;
if (unSyncCount > 0)
{
if (MessageBox.Show(string.Format("{0}条数据等待上传,确认关闭?", unSyncCount), "关闭确认", MessageBoxButtons.OKCancel) != DialogResult.OK)
{
close = false;
}
}
Thread.Sleep(500);
if (close)
Close();
}
private void goodsSetBtn_Click(object sender, EventArgs e)
@ -922,5 +925,23 @@ namespace ButcherFactory.SegmentProductionAuto_
MessageBox.Show(msg);
}
}
private const int CP_NOCLOSE_BUTTON = 0x200;
protected override CreateParams CreateParams
{
get
{
CreateParams myCp = base.CreateParams;
myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;
return myCp;
}
}
}
}

Loading…
Cancel
Save