Example #1
0
        private void BindScanList()
        {
            DataTable dtScan = WebAPIUtil.GetAPIByJsonToGeneric <DataTable>(string.Format("/api/scan/GetTempScan/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.CurrentUser.Userid));

            QSCommonValue.ScanBody = dtScan;
            dgScan.DataSource      = dtScan;
            lblCount.Text          = "合计件数:" + dtScan.Rows.Count.ToString();
        }
Example #2
0
        private void btnFinish_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                DataTable dt = dgScan.DataSource as DataTable;
                if (dt == null || dt.Rows.Count == 0)
                {
                    AppUtil.ShowError("请至少扫描一条记录!");
                    return;
                }

                dt = WebAPIUtil.GetAPIByJsonToGeneric <DataTable>(string.Format("/api/scan/GetTempScanCy/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule));

                DataView dv = new DataView(dt);
                dv.RowFilter = "CYQTY <> 0";
                if (dv.Count > 0 && AppUtil.ShowQuestion("仍有货品未扫描完毕,是否确认完成?") != DialogResult.Yes)
                {
                    return;
                }
                WebAPIUtil.GetToAPIByJsonToAPIResult(string.Format("/api/scan/TempScanFinish/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule));
                AppUtil.ShowInformation("操作完成!");
                this.ParentForm.LoadView(typeof(FrmHead), false, true);
            }
            catch (Exception ex)
            {
                logger.ErrorException("FrmScan窗体txtorderNo_KeyDown事件:" + ex.Message, ex);
                AppUtil.ShowError("操作失败!原因:" + ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
                txtbarcode.Focus();
                txtbarcode.Text = string.Empty;
            }
        }
Example #3
0
        private void BindScanCyList()
        {
            DataTable dtScan = WebAPIUtil.GetAPIByJsonToGeneric <DataTable>(string.Format("/api/scan/GetTempScanCy/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule));

            dgHead.DataSource = dtScan;
        }
Example #4
0
        private void txtorderNo_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                if (e.KeyCode != Keys.Enter)
                {
                    return;
                }

                DataSet ds = WebAPIUtil.GetAPIByJsonToGeneric <DataSet>(string.Format("api/scan/GetList/{0}/{1}", txtorderNo.Text, QSCommonValue.operModule));
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    txtorderNo.Focus();
                    txtorderNo.SelectAll();
                    AppUtil.ShowError("未能找到单据信息,请确认单号是否正确!");
                    return;
                }

                if (Convert.ToInt32(ds.Tables[0].Rows[0]["F_Status"]) > 1)
                {
                    txtorderNo.Focus();
                    txtorderNo.SelectAll();
                    AppUtil.ShowError("单据已经完成!");
                    return;
                }

                if (QSCommonValue.operModule == "PD")
                {
                    if (Convert.ToInt32(ds.Tables[0].Rows[0]["F_Status"]) > 0)
                    {
                        txtorderNo.Focus();
                        txtorderNo.SelectAll();
                        AppUtil.ShowError("单据已经完成!");
                        return;
                    }
                }
                else
                {
                    if (Convert.ToInt32(ds.Tables[0].Rows[0]["F_Status"]) == 0)
                    {
                        txtorderNo.Focus();
                        txtorderNo.SelectAll();
                        AppUtil.ShowError("单据尚未审核!");
                        return;
                    }
                }

                QSCommonValue.ListHead = ds.Tables[0];
                QSCommonValue.Body     = ds.Tables[1];
                dgHead.DataSource      = QSCommonValue.Body;
            }
            catch (Exception ex)
            {
                logger.ErrorException("FrmHead窗体txtorderNo_KeyDown事件:" + ex.Message, ex);
                AppUtil.ShowError("操作失败!原因:" + ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }