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; }