private void Save() { var result = CustomerServiceAdapter .Execute(s => s.CreateNewCustomer(Model.NewCustomerOperation)); Refresh(); }
public AuthenticationResult Authenticate(string userName, string password, string clientId) { var msg = SignInMessageBuilder.BuildMessage(userName, password, clientId); var result = AuthenticationServiceAdapter.Execute(it => it.Authenticate(msg)); return(result); }
public void ServiceReturnsWarning() { var result = ServiceAdapter.Execute(s => s.MethodReturnsBusinessWarning()); Assert.IsTrue(result.Response.HasWarning, "A warning was expected"); Assert.IsTrue(result.Response.BusinessWarnings.Count() == 1, "Only one warning was expected"); Assert.IsTrue(result.Response.BusinessWarnings.First().Message.Equals("Warning was added")); }
private void Save() { Model.IsEnabled = false; RaisePropertyChanged(() => Model); var result = CustomerServiceAdapter .Execute(s => s.CreateNewCustomer(Model.NewCustomerOperation)); Refresh(); }
public OfficeDtoContainer GetOfficeDetails(int officeId) { var container = OfficeServiceAdapter.Execute(it => it.GetOfficeDetails(officeId)); if (container.Response.HasException) { return(null); } return(container); }
public List <SdUserRequestDto> LoadUserRequest(int perId) { string condition = ISE.Framework.Utility.Utils.ExpressionHelper.PredicateToDynamicString <SdUserRequestDto>(it => it.Createuserid == perId || it.Owneruserid == perId); var container = (UserRequestDtoContainer)UserRequestAdapter.Execute(it => it.GetAllByCondition(condition)); return(container.UserRequestList); }
public SdServiceCategoryDto Insert(SdServiceCategoryDto ServiceCategory) { SdServiceCategoryDto result = (SdServiceCategoryDto)ServiceCategoryServiceAdapter.Execute(s => s.Insert(ServiceCategory)); if (result.Response.HasException) { return(null); } ServiceCategory.ServiceCatId = result.ServiceCatId; return(ServiceCategory); }
public SdWorkDto Insert(SdWorkDto work) { SdWorkDto result = (SdWorkDto)WorkServiceAdapter.Execute(s => s.Insert(work)); if (result.Response.HasException) { return(null); } work.WorkId = result.WorkId; return(work); }
public ApplicationDomainDto Insert(ApplicationDomainDto appDomain) { ApplicationDomainDto result = (ApplicationDomainDto)AppDomainServiceAdapter.Execute(s => s.Insert(appDomain)); if (result.Response.HasException) { return(null); } appDomain.ApplicationDomainId = result.ApplicationDomainId; return(appDomain); }
public AccountDto CreateAccount(AccountDto account, UserDto user) { var result = MembershipProviderServiceAdapter.Execute(it => it.CreateAccount(account, user)); if (result.Response.HasException) { return(null); } account.AccountId = result.AccountId; return(result); }
public void CreateCustomer() { var dto = new CustomerDto { FirstName = "Joe", LastName = "Bloggs", Telephone = "9999-8888" }; CustomerInstance = ServiceAdapter.Execute(s => s.CreateNewCustomer(dto)); Assert.IsFalse(CustomerInstance.CustomerId == 0, "Customer Id should have been updated"); Assert.AreSame(CustomerInstance.FirstName, dto.FirstName, "First Name are different"); }
private void Save() { if (Model.Address.Id == 0) { Model.Address = AddressServiceAdapter.Execute(s => s.CreateNewAddress(Model.Address)); } else { Model.Address = AddressServiceAdapter.Execute(s => s.UpdateAddress(Model.Address)); } View.DialogResult = true; View.Close(); }
private void Save() { if (Model.Customer.Id == 0) { Model.Customer = CustomerServiceAdapter.Execute(s => s.CreateNewCustomer(Model.Customer)); } else { Model.Customer = CustomerServiceAdapter.Execute(s => s.UpdateCustomer(Model.Customer)); } View.DialogResult = true; View.Close(); }
public List <SecurityResourceDto> GetMenuList(IdentityToken token, int appDomainId) { AuthorizationRequest request = new AuthorizationRequest() { AppDomainId = appDomainId, IdentityToken = token, }; var result = AuthorizationServiceAdapter.Execute(it => it.MenuList(request)); if (result.Response.HasException) { return(null); } return(result.SecurityResourceDtoList); }
public List <SecurityResourceDto> GetResources(int resourceTypeId, int appDomainId) { string filter = ExpressionHelper.PredicateToDynamicString <SecurityResourceDto>(it => it.AppDomainId == appDomainId && it.ResourceTypeId == resourceTypeId); var result = (SecurityResourceDtoContainer)SecurityResourceServiceAdapter.Execute(s => s.GetAllByCondition(filter)); return(result.SecurityResourceDtoList); }
public bool Insert(SdItRoleDto dto) { SdItRoleDto newJob = (SdItRoleDto)roleServiceAdapter.Execute(it => it.Insert(dto)); if (newJob.Response.HasException) { return(false); } dto.RoleId = newJob.RoleId; return(true); }
public ISE.Framework.Common.Token.UserIdentity FindIdentity(string userName, string password, string systemName) { if (systemName == "IseFood") { ServiceAdapter <IIdentity> iseFoodIdentityService = new ServiceAdapter <IIdentity>(); UserIdentity identity = (UserIdentity)iseFoodIdentityService.Execute(s => s.GetUserIdentity(userName, password)); return(identity); } return(null); }
public List <AccountDto> GetUserAccounts(UserDto user) { var result = (AccountDtoContainer)MembershipServiceAdapter.Execute(s => s.GetUserAccounts(user)); if (result.Response.HasException) { return(null); } return(result.AccountDtoList); }
public bool InsertServiceJob(SdServiceJobDto dto) { SdServiceJobDto newJob = (SdServiceJobDto)ServiceJobServiceAdapter.Execute(it => it.Insert(dto)); if (newJob.Response.HasException) { return(false); } dto.ServiceJobId = newJob.ServiceJobId; return(true); }
public bool DeleteServiceCategoryJobs(List <SdServiceCategoryJobDto> lst) { PersistanceBox box = new PersistanceBox(); box.Add(lst.Cast <BaseDto>().ToList()); ServiceCatJobServiceAdapter.Execute(e => e.DeleteBatch(box)); return(true); }
private void Refresh() { //var result = CustomerServiceInstance.FindAll(); var adapter = new ServiceAdapter <ICustomerService>(); var result = adapter.Execute(service => service.FindAll()); Model = new CustomerModel() { NewCustomerOperation = new CustomerDto(), CustomerList = result.Customers, IsEnabled = true }; RaisePropertyChanged(() => Model); }
public List <ApplicationDomainDto> GetAppDomainList() { var container = DataServiceAdapter.Execute(it => it.GetAppDomainList()); if (container.Response.HasException) { return(null); } return(container.ApplicationDomainDtoList); }
Func <dynamic, dynamic> Create_handler(ServiceInfo service) { return((dynamic param) => { try { var input = Get_input(param, service); var handler = new ServiceAdapter(service.ServiceType, service.EntryPointMethodname, service.SetupMethodname, service.TeardownMethodname); var output = handler.Execute(input); var response = Produce_output(output); return CORS.Handle_simple_request(Request, response); } catch (Exception ex) { var resp = (Response)($"ServiceHost: Service request could not be handled! Exception: {ex}"); resp.StatusCode = HttpStatusCode.InternalServerError; return resp; } }); }
private async void LoadData() { IsInLoading = true; try { var data = await bloggingServiceAdapter.Execute(s => s.GetBlogs()); Blogs = new ObservableCollection <Blog>(data); SelectedBlog = Blogs.FirstOrDefault(); } catch (Exception ex) { ErrorMessage = ex.Message; ClearData(); } finally { IsInLoading = false; CommandManager.InvalidateRequerySuggested(); } }
public CompanyDtoContainer GetAll() { var result = (CompanyDtoContainer)SecurityCompanyServiceAdapter.Execute(s => s.GetAll()); return(result); }
public SecurityGroupDtoContainer GetAll() { var result = (SecurityGroupDtoContainer)SecurityGroupServiceAdapter.Execute(s => s.GetAll()); return(result); }
public UserDtoContainer GetAll() { var result = (UserDtoContainer)SecurityUserServiceAdapter.Execute(s => s.GetAll()); return(result); }
public RoleDtoContainer GetAll() { var result = (RoleDtoContainer)RoleServiceAdapter.Execute(s => s.GetAll()); return(result); }
public PermissionDtoContainer GetAll() { var result = (PermissionDtoContainer)PermissionServiceAdapter.Execute(s => s.GetAll()); return(result); }
public void DeleteCustomer(long id) { CustomerServiceAdapter.Execute(s => s.DeleteCustomer(id)); Refresh(); }