private void oldUnitWeightBtn_Click(object sender, EventArgs e) { try { FNZAIKOEntity zaikoEntity = DbAccess.GetZaiKoByTicketNo(ticketNoBox.Text); if (zaikoEntity == null) { msgBox.Text = "库存数据不存在,不能更改单位重量"; return; } else { msgBox.Text = string.Empty; UnitWeightChange uwc = new UnitWeightChange(zaikoEntity); if (uwc.ShowDialog(this) == DialogResult.OK) { zaikoEntity = DbAccess.GetZaiKoByTicketNo(ticketNoBox.Text); //FMBUCKETEntity bucket = DbAccess.GetBucket(newBucketNoBox.Text); unitWeightBox.Text = (zaikoEntity.REAL_UNIT_WEIGHT * 1000).ToString(); planWeightBox.Text = (zaikoEntity.ZAIKOSU * zaikoEntity.REAL_UNIT_WEIGHT).ToString(); } } } catch (Exception ex) { msgBox.Text = ex.Message; } }
private void unitWeightBtn_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(ticketNoBox.Text)) { msgBox.Text = "没有对应的作业数据"; return; } FNZAIKOEntity zaikoEntity = DbAccess.GetZaiKoByTicketNo(ticketNoBox.Text); if (zaikoEntity == null) { msgBox.Text = "库存数据不存在,不能更改单位重量"; return; } else { msgBox.Text = string.Empty; UnitWeightChange uwc = new UnitWeightChange(zaikoEntity); if (uwc.ShowDialog(this) == DialogResult.OK) { zaikoEntity = DbAccess.GetZaiKoByTicketNo(ticketNoBox.Text); unitWeightBox.Text = (zaikoEntity.REAL_UNIT_WEIGHT * 1000).ToString(); sendMessageBtn.PerformClick(); } } } catch (Exception ex) { msgBox.Text = ex.Message; } }