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);
            }
        }
Example #2
0
 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();
 }
Example #4
0
 public Branch Create(BranchCreate branch)
 {
     return(api.Post().With(branch).To <Branch>(repoPath + "/branches"));
 }