日期:2014-05-17 浏览次数:21119 次
Method MethdSave{get;set;}
btnAddNew_Click(object sender, EventArgs e){
this.Createview(ModelDrv.MethodDrv.GetMethod("SaleOrderInsert"));
}
btnEdit_Click(object sender, EventArgs e){
this.Createview(ModelDrv.MethodDrv.GetMethod("SaleOrderUpdate"));
}
btnSave_Click(object sender, EventArgs e){
//用当前视图更新Model
ViewDrv.MethodDrv.UpdateModel(this,this.MethodSave);
//调用数据访问层
DAHelper.ExecuteMethod(this.MethodSave);
}
void CreateView(Method pMethod){
this.MethodSave= pMethod
//向目标区域渲染该方法的视图,呈现给用户
pnl_1.Controls.Clear();
pnl_1.Controls.Add(ViewDrv.MethodDrv.CreateView(this.MethodSave));
}