84 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			84 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| 
 | |
| using System.Collections.Generic;
 | |
| using System.ComponentModel;
 | |
| using System.Data;
 | |
| using System.Drawing;
 | |
| using System.Text;
 | |
| using System.Windows.Forms;
 | |
| 
 | |
| namespace DeiNiu.Wms.CE
 | |
| {
 | |
|     public partial class LocationQuery : basicForm
 | |
|     {
 | |
|         public LocationQuery()
 | |
|         {
 | |
|             setTitle();
 | |
|             InitializeComponent();
 | |
|         }
 | |
| 
 | |
|         //public void clear()
 | |
|         //{
 | |
|           
 | |
|         //    label3.Text = "";
 | |
|         //}
 | |
| 
 | |
|         private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
 | |
|         {
 | |
|             if(e.KeyChar==13)
 | |
|             {
 | |
|                 string code = "";
 | |
|                 code = textBox1.Text.ToString();
 | |
| 
 | |
|                 textBox1.Text = "";
 | |
| 
 | |
|                 textBox1.Focus();
 | |
| 
 | |
|                
 | |
|                 DataTable dt = null; 
 | |
|                 Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
 | |
|                 try
 | |
|                 {
 | |
|                    dt = client.getGoodsStockLocations(code);
 | |
|                 }
 | |
|                 catch (Exception er)
 | |
|                 {
 | |
|                     Cursor.Current = System.Windows.Forms.Cursors.Default;
 | |
|                     MessageBox.Show("发生错误:" + er.Message);
 | |
| 
 | |
|                     return;
 | |
|                 }
 | |
|                 Cursor.Current = System.Windows.Forms.Cursors.Default;  
 | |
| 
 | |
| 
 | |
| 
 | |
|                 if(dt.Rows.Count==0)
 | |
|                 {
 | |
|                     label3.Text = "";
 | |
|                     dataGrid1.DataSource = null;
 | |
| 
 | |
|                     
 | |
|                     return;
 | |
| 
 | |
|                 }
 | |
| 
 | |
|                  dataGrid1.DataSource = dt;
 | |
| 
 | |
|                 label3.Text=dt.Rows[0]["商品"].ToString();
 | |
|                 DataGridTableStyle ds = new DataGridTableStyle();
 | |
|                 ds.MappingName = dt.TableName;
 | |
|                 dataGrid1.TableStyles.Add(ds);
 | |
| 
 | |
|                 dataGrid1.TableStyles[0].GridColumnStyles["货位"].Width = 70;
 | |
|                 dataGrid1.TableStyles[0].GridColumnStyles["批号"].Width = 80;
 | |
|                 dataGrid1.TableStyles[0].GridColumnStyles["数量"].Width = 50; 
 | |
|                 dataGrid1.TableStyles[0].GridColumnStyles["厂家"].Width = 150;
 | |
|                 dataGrid1.TableStyles[0].GridColumnStyles["商品"].Width = 0;
 | |
|                 dataGrid1.TableStyles[0].GridColumnStyles["条码"].Width = 0;
 | |
| 
 | |
|             }
 | |
|         }
 | |
| 
 | |
|        
 | |
|     }
 | |
| } |