//// //////////////////////////////////////////////////////////////////////// //// PRIVATE METHODS //// /// <summary> /// Save all bondingCompanies to database (direct) /// </summary> /// <param name="companyId">companyId</param> public void Save(int companyId) { BondingCompaniesAddTDS bondingCompaniesChanges = (BondingCompaniesAddTDS)Data.GetChanges(); if (bondingCompaniesChanges.BondingCompanies.Rows.Count > 0) { BondingCompaniesAddBondingCompaniesGateway bondingCompaniesAddBondingCompaniesGateway = new BondingCompaniesAddBondingCompaniesGateway(bondingCompaniesChanges); foreach (BondingCompaniesAddTDS.BondingCompaniesRow row in (BondingCompaniesAddTDS.BondingCompaniesDataTable)bondingCompaniesChanges.BondingCompanies) { //Insert companies BondingCompanies hotels = new BondingCompanies(null); hotels.InsertDirect(row.COMPANIES_ID, row.Date, row.Name, row.Deleted, row.COMPANY_ID); } } }
private bool StepBondingCompaniesNext() { int selectedCompaniesIdForBondingCompanies = Int32.Parse(ddlCompaniesForBondingCompanies.SelectedValue); int companyIdForBondingCompanies = Int32.Parse(hdfCompanyIdForBondingCompanies.Value); BondingCompaniesAddBondingCompaniesGateway bondingCompaniesAddBondingCompaniesGateway = new BondingCompaniesAddBondingCompaniesGateway(); if (bondingCompaniesAddBondingCompaniesGateway.IsInLfs(selectedCompaniesIdForBondingCompanies, companyIdForBondingCompanies)) { lblUserErrorMessageForBondingCompanies.Visible = true; } else { lblUserErrorMessageForBondingCompanies.Visible = false; // Get name int companiesIdForBondingCompanies = Int32.Parse(ddlCompaniesForBondingCompanies.SelectedValue); DateTime dateForBondingCompanies = DateTime.Now; // Insert subcontractor hdfNameForBondingCompanies.Value = GetCompanyName(companiesIdForBondingCompanies, companyIdForBondingCompanies); BondingCompaniesAddBondingCompanies model = new BondingCompaniesAddBondingCompanies(bondingCompaniesAddTDS); model.Insert(companiesIdForBondingCompanies, dateForBondingCompanies, hdfNameForBondingCompanies.Value, false, companyIdForBondingCompanies); // ... Store tables Session["bondingCompaniesAddTDS"] = bondingCompaniesAddTDS; } return true; }
private bool StepBeginNext() { int selectedCompaniesId = Int32.Parse(ddlCompanies.SelectedValue); int companyId = Int32.Parse(hdfCompanyId.Value); BondingCompaniesAddBondingCompaniesGateway bondingCompaniesAddBondingCompaniesGateway = new BondingCompaniesAddBondingCompaniesGateway(); if (bondingCompaniesAddBondingCompaniesGateway.IsInLfs(selectedCompaniesId, companyId)) { lblUserErrorMessage.Visible = true; return false; } else { lblUserErrorMessage.Visible = false; // Get name int companiesId = Int32.Parse(ddlCompanies.SelectedValue); DateTime date = DateTime.Now; // Insert subcontractor CompaniesGatewayRAF companiesGatewayRAF = new CompaniesGatewayRAF(); companiesGatewayRAF.LoadByCompaniesId(companiesId, companyId); hdfName.Value = companiesGatewayRAF.GetName(companiesId); BondingCompaniesAddBondingCompanies model = new BondingCompaniesAddBondingCompanies(bondingCompaniesAddTDS); model.Insert(companiesId, date, hdfName.Value, false, companyId); // ... Store tables Session["bondingCompaniesAddTDS"] = bondingCompaniesAddTDS; } return true; }