public IndividualListResponse GetIndividualsByPage(int currentPage = 1, int itemsPerPage = 6, string IndividualName = "")
        {
            IndividualListResponse response = new IndividualListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <IndividualViewModel>, IndividualListResponse>("GetIndividualsByPage", new Dictionary <string, string>()
                {
                    { "CurrentPage", currentPage.ToString() },
                    { "itemsPerPage", itemsPerPage.ToString() },
                    { "IndividualName", IndividualName },
                });
                //response.TotalItems = WpfApiHandler.GetFromApi<int, IndividualViewModel, IndividualListResponse>("GetIndividualsCount", new Dictionary<string, string>() {
                //    { "CompanyID", companyId.ToString() },
                //    { "searchParameter", IndividualName }
                //}).TotalItems;

                response.Success = true;
            }

            catch (Exception ex)
            {
                response = new IndividualListResponse();
                response.IndividualsByPage = new List <IndividualViewModel>();
                response.Success           = false;
                response.Message           = ex.Message;
            }

            return(response);
        }
        public OutputInvoiceResponse GetNewCodeValue()
        {
            OutputInvoiceResponse response = new OutputInvoiceResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <OutputInvoiceViewModel, OutputInvoiceResponse>("GetNewCodeValue", null);
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
Пример #3
0
        public CompanyListResponse GetCompanies()
        {
            CompanyListResponse response = new CompanyListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <CompanyViewModel>, CompanyListResponse>("GetCompanies", null);
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
Пример #4
0
        ///<summary>
        /// Gets new code for business partner creation
        ///</summary>
        ///<returns></returns>
        public CompanyResponse GetNewCodeValue()
        {
            CompanyResponse response = new CompanyResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <CompanyViewModel, CompanyResponse>("GetNewCodeValue", null);
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
        ///<summary>
        /// Gets new code for business partner creation
        ///</summary>
        ///<returns></returns>
        public IndividualCodeResponse GetNewCodeValue()
        {
            IndividualCodeResponse response = new IndividualCodeResponse();

            try
            {
                response         = WpfApiHandler.GetFromApi <int, IndividualViewModel, IndividualCodeResponse>("GetNewCodeValue", null);
                response.Success = true;
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
        public PhysicalPersonProfessionListResponse GetPhysicalPersonItems(int companyId)
        {
            PhysicalPersonProfessionListResponse response = new PhysicalPersonProfessionListResponse();

            try
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("CompanyID", companyId.ToString());

                response = WpfApiHandler.GetFromApi <List <PhysicalPersonProfessionViewModel>, PhysicalPersonProfessionListResponse>("GetPhysicalPersonItems", parameters);
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
        public EmployeeLicenceItemListResponse GetEmployeeItems(int companyId)
        {
            EmployeeLicenceItemListResponse response = new EmployeeLicenceItemListResponse();

            try
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("CompanyID", companyId.ToString());

                response = WpfApiHandler.GetFromApi <List <EmployeeLicenceItemViewModel>, EmployeeLicenceItemListResponse>("GetEmployeeItems", parameters);
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
        public BusinessPartnerOrganizationUnitListResponse GetBusinessPartnerOrganizationUnits(int companyId)
        {
            BusinessPartnerOrganizationUnitListResponse response = new BusinessPartnerOrganizationUnitListResponse();

            try
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("CompanyID", companyId.ToString());

                response = WpfApiHandler.GetFromApi <List <BusinessPartnerOrganizationUnitViewModel>, BusinessPartnerOrganizationUnitListResponse>("GetBusinessPartnerOrganizationUnits", parameters);
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
Пример #9
0
        public UserListResponse GetUsers()
        {
            UserListResponse response = new UserListResponse();

            try
            {
                response         = WpfApiHandler.GetFromApi <List <UserViewModel>, UserListResponse>("GetUsers", new Dictionary <string, string>());
                response.Success = true;
            }
            catch (Exception ex)
            {
                response.Users   = new List <UserViewModel>();
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
Пример #10
0
        public ConstructionSiteCalculationListResponse GetConstructionSiteCalculations(int companyId)
        {
            ConstructionSiteCalculationListResponse response = new ConstructionSiteCalculationListResponse();

            try
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("CompanyID", companyId.ToString());

                response = WpfApiHandler.GetFromApi <List <ConstructionSiteCalculationViewModel>, ConstructionSiteCalculationListResponse>("GetConstructionSiteCalculations", parameters);
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
        public BusinessPartnerOrganizationUnitListResponse GetBusinessPartnerOrganizationUnitsNewerThen(int companyId, DateTime?lastUpdateTime)
        {
            BusinessPartnerOrganizationUnitListResponse response = new BusinessPartnerOrganizationUnitListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <BusinessPartnerOrganizationUnitViewModel>, BusinessPartnerOrganizationUnitListResponse>("GetBusinessPartnerOrganizationUnitsNewerThen", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() },
                    { "LastUpdateTime", lastUpdateTime.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
Пример #12
0
        public EmployeeAttachmentListResponse GetEmployeeAttachments(int companyId)
        {
            EmployeeAttachmentListResponse response = new EmployeeAttachmentListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <EmployeeAttachmentViewModel, EmployeeAttachmentListResponse>("GetEmployeeAttachments", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
Пример #13
0
        public CityListResponse GetCities()
        {
            CityListResponse response = new CityListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <CityViewModel>, CityListResponse>("GetCities", new Dictionary <string, string>()
                {
                });
            }
            catch (Exception ex)
            {
                response.Cities  = new List <CityViewModel>();
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
        public PhysicalPersonProfessionListResponse GetPhysicalPersonItemsNewerThen(int companyId, DateTime?lastUpdateTime)
        {
            PhysicalPersonProfessionListResponse response = new PhysicalPersonProfessionListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <PhysicalPersonProfessionViewModel>, PhysicalPersonProfessionListResponse>("GetPhysicalPersonItemsNewerThen", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() },
                    { "LastUpdateTime", lastUpdateTime.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
Пример #15
0
        public ConstructionSiteCalculationListResponse GetConstructionSiteCalculationsNewerThen(int companyId, DateTime?lastUpdateTime)
        {
            ConstructionSiteCalculationListResponse response = new ConstructionSiteCalculationListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <ConstructionSiteCalculationViewModel>, ConstructionSiteCalculationListResponse>("GetConstructionSiteCalculationsNewerThen", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() },
                    { "LastUpdateTime", lastUpdateTime.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
        public EmployeeLicenceItemListResponse GetEmployeeItemsNewerThen(int companyId, DateTime?lastUpdateTime)
        {
            EmployeeLicenceItemListResponse response = new EmployeeLicenceItemListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <EmployeeLicenceItemViewModel>, EmployeeLicenceItemListResponse>("GetEmployeeItemsNewerThen", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() },
                    { "LastUpdateTime", lastUpdateTime.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }
            return(response);
        }
        /// <summary>
        /// Get single active business partner for selected company
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public IndividualResponse GetIndividual(int id)
        {
            IndividualResponse response = new IndividualResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <IndividualViewModel, IndividualResponse>("GetIndividual", new Dictionary <string, string>()
                {
                    { "id", id.ToString() },
                });
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
        public IndividualListResponse GetIndividualsCount(string searchParameter = "")
        {
            IndividualListResponse response = new IndividualListResponse();

            try
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("searchParameter", searchParameter);

                response         = WpfApiHandler.GetFromApi <List <IndividualViewModel>, IndividualListResponse>("GetIndividualsCount", parameters);
                response.Success = true;
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
        public OutputInvoiceListResponse GetOutputInvoices(int companyId)
        {
            OutputInvoiceListResponse response = new OutputInvoiceListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <OutputInvoiceViewModel>, OutputInvoiceListResponse>("GetOutputInvoices", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.OutputInvoices = new List <OutputInvoiceViewModel>();
                response.Success        = false;
                response.Message        = ex.Message;
            }

            return(response);
        }
        public IndividualListResponse GetIndividualsForPopup(string filterString)
        {
            IndividualListResponse response = new IndividualListResponse();

            try
            {
                Dictionary <string, string> parameters = new Dictionary <string, string>();
                parameters.Add("FilterString", filterString);

                response         = WpfApiHandler.GetFromApi <List <IndividualViewModel>, IndividualListResponse>("GetIndividualsForPopup", parameters);
                response.Success = true;
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
Пример #21
0
        public FamilyMemberListResponse GetFamilyMembers(int companyId)
        {
            FamilyMemberListResponse response = new FamilyMemberListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <FamilyMemberViewModel>, FamilyMemberListResponse>("GetFamilyMembers", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.FamilyMembers = new List <FamilyMemberViewModel>();
                response.Success       = false;
                response.Message       = ex.Message;
            }

            return(response);
        }
Пример #22
0
        public CompanyUserListResponse GetCompanyUsersNewerThan(DateTime?dateFrom)
        {
            CompanyUserListResponse response = new CompanyUserListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <CompanyUserViewModel>, CompanyUserListResponse>("GetCompanyUsersNewerThan", new Dictionary <string, string>()
                {
                    { "dateFrom", dateFrom.ToString() },
                });
            }
            catch (Exception ex)
            {
                response.CompanyUsers = new List <CompanyUserViewModel>();
                response.Success      = false;
                response.Message      = ex.Message;
            }

            return(response);
        }
        public LimitationListResponse GetLimitations(int companyId)
        {
            LimitationListResponse response = new LimitationListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <LimitationViewModel>, LimitationListResponse>("GetLimitations", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.Limitations = new List <LimitationViewModel>();
                response.Success     = false;
                response.Message     = ex.Message;
            }

            return(response);
        }
        public PhysicalPersonListResponse GetPhysicalPersons(int companyId)
        {
            PhysicalPersonListResponse response = new PhysicalPersonListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <PhysicalPersonViewModel, PhysicalPersonListResponse>("GetPhysicalPersons",
                                                                                                          new Dictionary <string, string>()
                {
                    { "CompanyID", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
Пример #25
0
        public CompanyUserResponse Delete(Guid identifier)
        {
            CompanyUserResponse response = new CompanyUserResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <CompanyUserViewModel, CompanyUserResponse>("Delete", new Dictionary <string, string>()
                {
                    { "identifier", identifier.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.CompanyUser = new CompanyUserViewModel();
                response.Success     = false;
                response.Message     = ex.Message;
            }

            return(response);
        }
        public AgencyListResponse GetAgencies(int companyId)
        {
            AgencyListResponse response = new AgencyListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <AgencyViewModel>, AgencyListResponse>("GetAgencies", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.Agencies = new List <AgencyViewModel>();
                response.Success  = false;
                response.Message  = ex.Message;
            }

            return(response);
        }
        public ToDoStatusListResponse GetToDoStatuses(int companyId)
        {
            ToDoStatusListResponse response = new ToDoStatusListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <ToDoStatusViewModel>, ToDoStatusListResponse>("GetToDoStatuses", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.ToDoStatuses = new List <ToDoStatusViewModel>();
                response.Success      = false;
                response.Message      = ex.Message;
            }

            return(response);
        }
Пример #28
0
        public DocumentFolderResponse Clear(int companyId)
        {
            DocumentFolderResponse response = new DocumentFolderResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <DocumentFolderViewModel, DocumentFolderResponse>("Clear", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.DocumentFolder = new DocumentFolderViewModel();
                response.Success        = false;
                response.Message        = ex.Message;
            }

            return(response);
        }
Пример #29
0
        public CalendarAssignmentListResponse GetCalendarAssignments(int companyId)
        {
            CalendarAssignmentListResponse response = new CalendarAssignmentListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <CalendarAssignmentViewModel, CalendarAssignmentListResponse>("GetCalendarAssignments",
                                                                                                                  new Dictionary <string, string>()
                {
                    { "CompanyID", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }
        public BusinessPartnerTypeListResponse GetBusinessPartnerTypes(int companyId)
        {
            BusinessPartnerTypeListResponse response = new BusinessPartnerTypeListResponse();

            try
            {
                response = WpfApiHandler.GetFromApi <List <BusinessPartnerTypeViewModel>, BusinessPartnerTypeListResponse>("GetBusinessPartnerTypes", new Dictionary <string, string>()
                {
                    { "CompanyId", companyId.ToString() }
                });
            }
            catch (Exception ex)
            {
                response.BusinessPartnerTypes = new List <BusinessPartnerTypeViewModel>();
                response.Success = false;
                response.Message = ex.Message;
            }

            return(response);
        }