Ejemplo n.º 1
0
        /// <summary>
        /// 已扫描数据
        /// </summary>
        private void btnDone_Click(object sender, EventArgs e)
        {
            if (tempAVH.OperateDetails == null || tempAVH.OperateDetails.Count < 1)
            {
                MessageBox.Show("无操作数据!");
                return;
            }
            try
            {
                using (frmDone DataDone = new frmDone(tempAVH))
                {
                    int count = tempAVH.OperateDetails.Count;
                    DataDone.ShowDialog();
                    //刷新已扫数量
                    if (count != tempAVH.OperateDetails.Count && !string.IsNullOrEmpty(txtLabel.Text) && txtLabel.Enabled == false)
                    {
                        ArrivalVouchs sdl;
                        sdl             = tempAVH.OperateDetails.Find(delegate(ArrivalVouchs sdd) { return(sdd.cInvCode == txtLabel.Text.Trim() && sdd.Quantity > 0); });
                        lblDoneNum.Text = sdl == null ? "0" : sdl.Quantity.ToString("F4");
                    }
                    SetFocus();
                }

                //无已扫数量禁用
                if (tempAVH.OperateDetails == null || tempAVH.OperateDetails.Count < 1)
                {
                    btnDone.Enabled = false;
                }
            }
            catch { MessageBox.Show("操作失误,请重试!"); }
            finally { SetFocus(); }
        }
Ejemplo n.º 2
0
        private void btnDone_Click(object sender, EventArgs e)
        {
            if (tempSIO.OperateDetails == null || tempSIO.OperateDetails.Count < 1)
            {
                MessageBox.Show("无操作数据!");
                return;
            }
            try
            {
                using (frmDone DataDone = new frmDone(tempSIO))
                {
                    DataDone.ShowDialog();
                    if (!string.IsNullOrEmpty(txtLabel.Text) && txtLabel.Enabled == false)
                    {
                        StockInDetail sdl;
                        sdl = tempSIO.OperateDetails.Find(delegate(StockInDetail sdd) { return(sdd.cInvCode.ToUpper() == txtLabel.Text.Trim().ToUpper() && sdd.Batch.ToUpper() == lblBatch.Text.Trim().ToUpper()); });
                        if (sdl != null)
                        {
                            lblDoneNum.Text = sdl.Quantity.ToString("F4");
                        }
                        else
                        {
                            lblDoneNum.Text = "0";
                        }
                    }
                }

                if (tempSIO.OperateDetails == null || tempSIO.OperateDetails.Count < 1)
                {
                    btnDone.Enabled = false;
                }
            }
            catch { MessageBox.Show("操作失误,请重试!"); }
            finally { SetFocus(); }
        }