public bool CreateBranch(BranchCreate model) { var entity = new Branch() { BranchName = model.BranchName, }; using (var ctx = new ApplicationDbContext()) { ctx.Branches.Add(entity); return(ctx.SaveChanges() == 1); } }
protected void ValidateBranchCreate(BranchCreate branchCreate) { try { branchCreate.Name = branchCreate.Name.Trim(); branchCreate.NameAr = branchCreate.NameAr.Trim(); ValidateNames(branchCreate.Name, branchCreate.NameAr); } catch (RestaurantException ex) { throw ex; } }
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 Branch Create(BranchCreate branch) { return(api.Post().With(branch).To <Branch>(repoPath + "/branches")); }