protected void loadData() { SupplierParser newParser = new SupplierParser(); this.dataModel = new SupplierModel(@".\SQL2008", 1433, "TSQLFundamentals2008", "sa", "123456", "Production.Suppliers", newParser); newParser.DataModel = this.dataModel; try { this.dataModel.resetModel(""); } catch (Exception ex) { Session["current_error"] = ex.Message; Response.Redirect("serverError.aspx"); } /*if (this.IsPostBack == false) this.loadEmpIDS();*/ if ((Request.Params.Get("suppid") != null)) { this.suppID = int.Parse(Request.Params.Get("suppid").Trim()); this.newEmpMode = false; if (this.IsPostBack == true) return; this.loadSuppData(); } }
protected void _initModel() { Settings setting = new Settings(); SupplierParser newParser = new SupplierParser(); dataModel = new SupplierModel( this.gvSuppliers, setting.DB_HOST, setting.DB_PORT, setting.DB_NAME, setting.DB_USER, setting.DB_PASS, "Production.Suppliers", newParser); //dataModel = new SupplierModel(this.gvSuppliers, ".\\SQL2008", setting.DB_PORT, setting.DB_NAME, setting.DB_USER, setting.DB_PASS, "Production.Suppliers", newParser); newParser.DataModel = dataModel; dataModel.resetControl(); }