public bool Create(Branch entity, int?countryId, int?stateId, int?cityId, int SchoolId) { using (var context = new CourseContext()) { Branch branch = entity; if (countryId != null) { Country country = context.Country.Find(countryId); if (country != null) { BranchCountry branchCountry = new BranchCountry() { Branch = branch, Country = country }; context.Add(branchCountry); } } if (stateId != null) { State state = context.State.Find(stateId); if (state != null) { BranchState branchState = new BranchState() { Branch = branch, State = state }; context.Add(branchState); } } if (cityId != null) { City city = context.City.Find(cityId); if (city != null) { BranchCity branchCity = new BranchCity() { Branch = branch, City = city }; context.Add(branchCity); } } School school = context.School.Find(SchoolId); if (school != null) { SchoolBranch schoolBranch = new SchoolBranch() { School = school, Branch = branch }; context.Add(schoolBranch); } context.SaveChanges(); return(true); } }
public void CreateBranchApplication() { Thread.Sleep(500); SelectBusinessFromList.ClickOn(); BranchCreate.ClickOn(); softAssert.VerifyElementIsPresent(BranchCancelButton); BranchSaveButton.ClickOn(); softAssert.VerifyElementPresentInsideWindow(BranchEmail, BusinessClose); BranchAddress.EnterClearText(Constant.branchAddress); BranchCity.EnterText(Constant.businessCity); BranchPhone.EnterClearText(Constant.userPhone); BranchEmail.EnterClearText(Constant.userEmail); Thread.Sleep(500); BranchSaveButton.ClickOn(); softAssert.VerifySuccessMsg(); }
public override string ToString() { return("Bank Number: " + BankNumber.ToString() + "\nBank Name: " + BankName.ToString() + "\nBank Branch Address: " + BankBranchAddress.ToString() + "\nBranch City: " + BranchCity.ToString() + "\nAccount Number: " + AccountNumber.ToString()); }