private async void SaveBranch(object branchObj) { BranchesViewModel branchS = branchObj as BranchesViewModel; if ((branchS != null) && branchS.isValid()) { bool postRes = false; BranchesService us = new BranchesService(); postRes = await us.PostAsync(branchS.branch);//us.PostUserSync(userS.user); if (postRes) { BranchesList.Add(branchS); } } Back(); }
private async void DeleteBranch(object branchObj) { BranchesViewModel branchD = branchObj as BranchesViewModel; if (branchD != null && branchD.isValid()) { bool delRes = false; BranchesService us = new BranchesService(); delRes = await us.DeleteAsync(branchD.branch); if (delRes) { BranchesList.Remove(branchD); } } Back(); }
private async void Button_Clicked(object sender, EventArgs e) { branchesList.BranchesList.Clear(); BranchesService bs = new BranchesService(); branchSource = await bs.GetBranches(); foreach (Branches branch in branchSource) { BranchesViewModel bvm = new BranchesViewModel { id = branch.id, branchname = branch.branchname, description = branch.description, creator_id = branch.creator_id, created_date = branch.created_date }; branchesList.BranchesList.Add(bvm); } }
/// <summary> /// Sets up HTTP methods mappings. /// </summary> /// <param name="service">Service handling requests</param> public BranchesModule(BranchesService service) : base("/") { Get["/api/program/{programId}/repository/{repositoryId}/branches"] = parameters => { var programId = Parameters.ValueOf <string>(parameters, Context.Request, "programId", ParameterType.Path); var repositoryId = Parameters.ValueOf <string>(parameters, Context.Request, "repositoryId", ParameterType.Path); var xGwImsOrgId = Parameters.ValueOf <string>(parameters, Context.Request, "xGwImsOrgId", ParameterType.Header); var authorization = Parameters.ValueOf <string>(parameters, Context.Request, "authorization", ParameterType.Header); var xApiKey = Parameters.ValueOf <string>(parameters, Context.Request, "xApiKey", ParameterType.Header); Preconditions.IsNotNull(programId, "Required parameter: 'programId' is missing at 'GetBranches'"); Preconditions.IsNotNull(repositoryId, "Required parameter: 'repositoryId' is missing at 'GetBranches'"); Preconditions.IsNotNull(xGwImsOrgId, "Required parameter: 'xGwImsOrgId' is missing at 'GetBranches'"); Preconditions.IsNotNull(authorization, "Required parameter: 'authorization' is missing at 'GetBranches'"); Preconditions.IsNotNull(xApiKey, "Required parameter: 'xApiKey' is missing at 'GetBranches'"); return(service.GetBranches(Context, programId, repositoryId, xGwImsOrgId, authorization, xApiKey)); }; }
public CheckInController(LibraryContext _context, CheckInService checkInService, BranchesService branchesService) { this.checkInService = checkInService; this.branchesService = branchesService; }
public HoldingsController(LibraryContext context) { this.context = context; holdingsService = new HoldingsService(context); branchesService = new BranchesService(context); }
public BranchesServiceTest(DbContextFixture fixture) { fixture.Seed(); context = new LibraryContext(fixture.ContextOptions); branchesService = new BranchesService(context); }