Beispiel #1
0
        //查询
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                this.VisibleWailt(false);
                listBill = wave.ScanNewBill("ScanNewBill", BillTypes);
                switch (listBill.Count)
                {
                case 0:
                    billNo = "";
                    break;

                case 1:
                    billNo = listBill[0];
                    break;

                default:
                    SelectDialog selectDialog = new SelectDialog(listBill);
                    if (selectDialog.ShowDialog() == DialogResult.OK)
                    {
                        billNo = selectDialog.SelectedBillID;
                    }
                    break;
                }
                this.VisibleWailt(true);
                RefreshData();
            }
            catch (Exception ex)
            {
                THOKUtil.ShowError("读取数据失败,原因:" + ex.Message);
                this.VisibleWailt(false);
                return;
            }
        }
Beispiel #2
0
        //查询
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                string billNo = string.Empty;
                Task   task   = new Task(url);
                task.GetBillMasterCompleted += new Task.GetBillMasterCompletedEventHandler(delegate(bool isSuccess, string msg, BillMaster[] billMasters)
                {
                    ClosePlWailt();
                    if (billMasters != null)
                    {
                        switch (billMasters.Length)
                        {
                        case 0:
                            billNo = "";
                            break;

                        case 1:
                            billNo = billMasters[0].BillNo;
                            break;

                        default:
                            SelectDialog selectDialog = new SelectDialog(billMasters);
                            if (selectDialog.ShowDialog() == DialogResult.OK)
                            {
                                billNo = selectDialog.SelectedBillID;
                            }
                            break;
                        }
                        foreach (BillMaster billMaster in billMasters)
                        {
                            if (billNo == billMaster.BillNo)
                            {
                                this.BillMaster = billMaster;
                            }
                        }
                    }
                    if (!isSuccess)
                    {
                        MessageBox.Show(msg);
                    }
                    RefreshData();
                });
                task.SearchBillMaster(BillTypes);
                DisplayPlWailt();
            }
            catch (Exception ex)
            {
                MessageBox.Show("读取数据失败,原因:" + ex.Message, "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #3
0
        private void btnOut_Click(object sender, EventArgs e)
        {
            //this.ReadMasterBill("5", "STOCKMOVE");//�¼�

            listBill = wave.ScanNewBill("ScanNewBill", "5");
            switch (listBill.Count)
            {
                case 0:
                    billNo = "";
                    break;
                case 1:
                    billNo = listBill[0];
                    break;
                default:
                    SelectDialog selectDialog = new SelectDialog(listBill);
                    if (selectDialog.ShowDialog() == DialogResult.OK)
                    {
                        billNo = selectDialog.SelectedBillID;
                    }
                    break;
            }
        }
Beispiel #4
0
        //��ѯ
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                sp.Stop();
                Task task = new Task(url);
                task.GetBillMasterCompleted += new Task.GetBillMasterCompletedEventHandler(delegate(bool isSuccess, string msg, BillMaster[] billMasters)
                {
                    ClosePlWailt();
                    if (billMasters != null)
                    {
                        switch (billMasters.Length)
                        {
                            case 0:
                                billNo = "";
                                break;
                            case 1:
                                billNo = billMasters[0].BillNo;
                                break;
                            default:
                                SelectDialog selectDialog = new SelectDialog(billMasters);
                                if (selectDialog.ShowDialog() == DialogResult.OK)
                                {
                                    billNo = selectDialog.SelectedBillID;
                                }
                                break;
                        }

                        List<BillMaster> listBill = new List<Interface.Model.BillMaster>();
                        int f = 0;
                        for (int i = 0; i < billMasters.Length; i++)
                        {
                            if (billNo.Contains(billMasters[i].BillNo))
                            {
                                f++;
                                listBill.Add(billMasters[i]);
                            }
                        }
                        BillMasters = new BillMaster[f];
                        listBill.CopyTo(BillMasters, 0);
                    }
                    if (!isSuccess)
                        MessageBox.Show(msg);
                    RefreshData();
                });

                task.SearchBillMaster(BillTypes);
                DisplayPlWailt();
            }
            catch (Exception ex)
            {
                MessageBox.Show("��ȡ����ʧ�ܣ�ԭ��" + ex.Message, "��Ϣ", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 //��ѯ
 private void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         this.VisibleWailt(false);
         listBill = wave.ScanNewBill("ScanNewBill", BillTypes);
         switch (listBill.Count)
         {
             case 0:
                 billNo = "";
                 break;
             case 1:
                 billNo = listBill[0];
                 break;
             default:
                 SelectDialog selectDialog = new SelectDialog(listBill);
                 if (selectDialog.ShowDialog() == DialogResult.OK)
                 {
                     billNo = selectDialog.SelectedBillID;
                 }
                 break;
         }
         this.VisibleWailt(true);
         RefreshData();
     }
     catch (Exception ex)
     {
         THOKUtil.ShowError("��ȡ����ʧ�ܣ�ԭ��" + ex.Message);
         this.VisibleWailt(false);
         return;
     }
 }
Beispiel #6
0
 //��ѯ
 private void btnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         string billNo = string.Empty;
         Task task = new Task(url);
         task.GetBillMasterCompleted += new Task.GetBillMasterCompletedEventHandler(delegate(bool isSuccess, string msg, BillMaster[] billMasters)
         {
             ClosePlWailt();
             if (billMasters != null)
             {
                 switch (billMasters.Length)
                 {
                     case 0:
                         billNo = "";
                         break;
                     case 1:
                         billNo = billMasters[0].BillNo;
                         break;
                     default:
                         SelectDialog selectDialog = new SelectDialog(billMasters);
                         if (selectDialog.ShowDialog() == DialogResult.OK)
                         {
                             billNo = selectDialog.SelectedBillID;
                         }
                         break;
                 }
                 foreach (BillMaster billMaster in billMasters)
                 {
                     if (billNo == billMaster.BillNo)
                     {
                         this.BillMaster = billMaster;
                     }
                 }
             }
             if (!isSuccess)
                 MessageBox.Show(msg);
             RefreshData();
         });
         task.SearchBillMaster(BillTypes);
         DisplayPlWailt();
     }
     catch (Exception ex)
     {
         MessageBox.Show("��ȡ����ʧ�ܣ�ԭ��" + ex.Message, "��Ϣ", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 void ReadMasterBill(string billType)
 {
     listBill = waveData.ScanNewBill("ScanNewBill", billType);
     switch (listBill.Count)
     {
         case 0:
             billNo = "";
             break;
         case 1:
             billNo = listBill[0];
             break;
         default:
             SelectDialog selectDialog = new SelectDialog(listBill);
             if (selectDialog.ShowDialog() == DialogResult.OK)
             {
                 billNo = selectDialog.SelectedBillID;
             }
             break;
     }
     RefreshData();
 }