实例化Loginer和DAL层对象,调用方法返回数据
实例化Loginer和DAL层对象,调用方法返回数据
目录
实例化DAL层
C# Code:
C# 全选
private void button3_Click(object sender, EventArgs e)
{
/*
*测试目的:
* 1. 实例化Loginer对象
* 2. 实例化DAL对象
* 3. 调用DAL层方法,返回数据
*/
Loginer user = new Loginer();
user.Account = "admin";
user.AccountName = "管理员";
user.FlagAdmin = "Y";
user.LoginTime = DateTime.Now;
user.Password = CEncoder.Encode("123456");
user.DBName = "CSFrameworkV45_Normal";
user.DataSetID = "001";
//初始化DataProvider,连接系统库
string file = Path.Combine(Application.StartupPath, "config\\CSFrameworkV4.5.ini");
DataProvider.Instance.SetSQLConfig(new IniFileWriter(file));
//客户DAL
dalCustomer dal1 = new dalCustomer(user);
gv1.DataSource = dal1.GetLookupData();
//产品DAL
dalProduct dal2 = new dalProduct(user);
gv2.DataSource = dal2.Search("", "", "", "");
}
//来源:C/S框架网(www.csframework.com) QQ:1980854898
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网