storeAdapter.SelectCommand.Connection=sqlConnection1;
storeAdapter.Fill(storeInfo);
DataGridTableStyle fn= new DataGridTableStyle();//定义DataGrid格式
fn.AlternatingBackColor = Color.Blue;//颜色设置
fn.MappingName = storeInfo.TableName;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
}
}
4.2.5 货物入库管理模块
本系统的货物入库界面有货物入库界面和入库查询界面,分别如图4.13和图4.14所示:
图4.13 货物入库管理之货物入库模块设计图
private void InStorage_Load(object sender, System.EventArgs e)
{
MyConn.Open();//打开连接
InStgAdapter.SelectCommand.CommandText = "SELECT * FROM storage_In";
InStgAdapter.SelectCommand.Connection = MyConn;
InStgAdapter.Fill(InStgInfo);//填充数据集
this.dataGrid1.DataSource = InStgInfo.DefaultView;
ISReport = (CurrencyManager) BindingContext[InStgInfo];
this.DataBindingsFunction();
DataGridTableStyle ts = new DataGridTableStyle();
ts.AlternatingBackColor = Color.Blue;//颜色设置
ts.MappingName = InStgInfo.TableName;
this.dataGrid1.Select(0);//选定第一列
this.textNum2.Enabled=false;
}
图4.14 货物入库管理之入库查询模块设计图
private void SelInStg_Load(object sender, System.EventArgs e)
{
try
{
this.sqlConnection1.ConnectionString= "server=.;Trusted_Connection=yes;user=sa;pwd=1;database=storage";//建立连接
this.sqlConnection1.Open();
DataSet InStgSet=new DataSet();
InStgAdapter.SelectCommand.CommandText="SELECT * FROM storage_In"; C#条码仓库管理系统的设计与开发—统计、报表模块(11):http://www.751com.cn/jisuanji/lunwen_871.html