Exemplo n.º 1
0
        private bool GetSupplier()
        {
            string strError = string.Empty;

            supplier = new Supplier_Model();
            supplier.SupplierCode = txtOutSideSupCode.Text.Trim();

            if (string.IsNullOrEmpty(supplier.SupplierCode))
            {
                MessageBox.Show("供应商编码不能为空", "供应商信息获取错误");
                supplier = null;
                return(false);
            }

            if (!JingXinWMS.Print.Print_Func.GetSupplierInfoForSAP(ref supplier, ref strError))
            {
                MessageBox.Show(strError, "供应商信息获取错误");
                supplier = null;
                return(false);
            }

            if (supplier == null || string.IsNullOrEmpty(supplier.SupplierCode))
            {
                MessageBox.Show("供应商信息获取错误");
                supplier = null;
                return(false);
            }
            else
            {
                txtOutSideSupCode.Text = supplier.SupplierCode;
                txtOutSideSupName.Text = supplier.SupplierName;
            }

            return(true);
        }
Exemplo n.º 2
0
        private void InitMainQuery()
        {
            supplier = null;

            _serverMainPage = new DividPage();
            queryMain       = new DeliveryReceive_Model();
            lstMain         = new BindingList <DeliveryReceiveDetail_Model>();

            bsMain.DataSource = queryMain;

            txtOutSideSupCode.Text    = "";
            txtOutSideSupCode.Enabled = false;

            cbxSelectAll.Width     = colSelect.Width;
            cbxSelectAll.BackColor = dgvList.ColumnHeadersDefaultCellStyle.BackColor;
            cbxSelectAll.Font      = dgvList.ColumnHeadersDefaultCellStyle.Font;
        }
Exemplo n.º 3
0
        private void GetListQueryData()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                bsMain.EndEdit();

                bool   bResult  = false;
                string strError = string.Empty;
                GetQueryMain();

                bResult           = Task_Func.GetDeliveryInfoToSRM(ref queryMain, ref strError);
                bsMain.DataSource = queryMain;

                if (!bResult || !string.IsNullOrEmpty(strError))
                {
                    Common.Common_Func.ErrorMessage(strError, "查询失败");
                }

                if (queryMain.lstDeliveryDetail == null || queryMain.lstDeliveryDetail.Count <= 0)
                {
                    lstMain            = new BindingList <DeliveryReceiveDetail_Model>();
                    dgvList.DataSource = lstMain;

                    txtOutSideSupCode.Enabled = false;
                    txtOutSideSupCode.Text    = "";
                    txtDeliveryNo.Focus();
                    txtDeliveryNo.SelectAll();
                }
                else
                {
                    supplier = null;
                    queryMain.lstDeliveryDetail.ForEach(t => t.ReceiveQty = t.CurrentlyDeliveryNum);
                    lstMain            = new BindingList <DeliveryReceiveDetail_Model>(queryMain.lstDeliveryDetail);
                    dgvList.DataSource = lstMain;

                    txtOutSideSupCode.Enabled = true;
                    txtOutSideSupCode.Focus();
                    txtOutSideSupCode.SelectAll();
                }

                if (queryMain.DocDate != null)
                {
                    dtpDocDate.Value = queryMain.DocDate.ToDateTime();
                }
                if (queryMain.PostDate != null)
                {
                    dtpPostDate.Value = queryMain.PostDate.ToDateTime();
                }
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message, "查询失败");
                txtDeliveryNo.Focus();
                txtDeliveryNo.SelectAll();
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }