public int insertVendor(Organization org, CompanyDetails company, BranchLocation location) { int OrganizationID = 0; int CompanyDetailsID = 0; int LocationID = 0; bool insertResult = false; try { OrganizationHelper organizationhelper = new OrganizationHelper(); OrganizationID = organizationhelper.insertupdateOrganizationHier(org, 'I'); if (OrganizationID > 0) { company.Org_Hier_ID = OrganizationID; CompanyDetailsID = organizationhelper.insertupdateCompanyDetails(company, 'I'); location.Org_Hier_ID = OrganizationID; LocationID = organizationhelper.insertupdateBranchLocation(location, 'I'); } if (OrganizationID > 0 && CompanyDetailsID > 0) { insertResult = true; } } catch { throw; } return(OrganizationID); }
public bool updateVendor(Organization org, CompanyDetails company) { int insertOrganizationID = 0; int insertCompanyDetailsID = 0; bool updateResult = false; try { OrganizationHelper organizationhelper = new OrganizationHelper(); insertOrganizationID = organizationhelper.insertupdateOrganizationHier(org, 'U'); insertCompanyDetailsID = organizationhelper.insertupdateCompanyDetails(company, 'U'); { updateResult = true; } } catch { throw; } return(updateResult); }
public int insertCompany(Organization org, CompanyDetails company, BranchLocation branch) { int OrganizationID = 0; int BranchLocationID = 0; int CompanyDetailsID = 0; int IndustryTypeID = 0; bool insertResult = false; try { OrganizationHelper organizationhelper = new OrganizationHelper(); OrganizationID = organizationhelper.insertupdateOrganizationHier(org, 'I'); if (OrganizationID > 0) { branch.Org_Hier_ID = OrganizationID; BranchLocationID = organizationhelper.insertupdateBranchLocation(branch, 'I'); if (OrganizationID > 0) { company.Org_Hier_ID = OrganizationID; CompanyDetailsID = organizationhelper.insertupdateCompanyDetails(company, 'I'); } } if (BranchLocationID > 0 && OrganizationID > 0 && CompanyDetailsID > 0) { insertResult = true; } } catch { throw; } return(OrganizationID); }