Example #1
0
        public ConflictCheckStandardReturnValue ConflictCheck(HostSecurityToken oHostSecurityToken,
                                                              CollectionRequest collectionRequest,
                                                              IRISLegal.IlbCommon.ContactType clientType,
                                                              Person person,
                                                              Organisation organisation,
                                                              Address addresses,
                                                              List <AdditionalAddressElement> addressInformation,
                                                              bool checkOnAllRoles)
        {
            ConflictCheckStandardReturnValue returnValue = null;

            if (Functions.ValidateIWSToken(oHostSecurityToken))
            {
                oClientService = new ClientService();
                returnValue    = oClientService.ConflictCheck(Functions.GetLogonIdFromToken(oHostSecurityToken), collectionRequest,
                                                              clientType, person, organisation, addresses, addressInformation, checkOnAllRoles);
            }
            else
            {
                returnValue         = new ConflictCheckStandardReturnValue();
                returnValue.Success = false;
                returnValue.Message = "Invalid Token";
            }
            return(returnValue);
        }
Example #2
0
        /// <summary>
        /// Binds title dropdownlist control
        /// </summary>
        private void BindTitleDropDown()
        {
            ContactServiceClient contactService = null;

            try
            {
                contactService = new ContactServiceClient();
                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.StartRow = 0;

                TitleSearchCriteria    titleCriteria    = new TitleSearchCriteria();
                TitleSearchReturnValue titleReturnValue = contactService.TitleSearch(_logonSettings.LogonId, collectionRequest, titleCriteria);
                if (titleReturnValue.Title != null)
                {
                    _ddlTitle.DataSource     = titleReturnValue.Title.Rows;
                    _ddlTitle.DataTextField  = "TitleId";
                    _ddlTitle.DataValueField = "TitleId";
                    _ddlTitle.DataBind();
                }

                // Adds "Select" at zero index of dropdownlist control.
                AddDefaultToDropDownList(_ddlTitle);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (contactService.State != System.ServiceModel.CommunicationState.Faulted)
                {
                    contactService.Close();
                }
            }
        }
        public ActionResult <DoneResult> ListProducts([FromQuery] CollectionRequest request)
        {
            int pageNumber = request.PageNumber;
            var products   = UnitOfWork.ProductRepository.GetAll(CurrentUserId, request.Take, ref pageNumber, request.SortField, request.SortOrder, out int totalCount).ToList();

            return(new DoneResult(ResultType.Successful, data: products));
        }
        public void AnalyzeDocument()
        {
            //arrange
            var collection = new CollectionRequest
            {
                id        = "2d2e7341-a3c2-4fb4-9d3a-779e8b0a5eff",
                documents = new[]
                {
                    "The drive for ever-greater institutional efficiency places an enormous burden on those involved in developing regulatory submissions. Jim Reilly suggests how this process can be engineered to function more effectively and meet the organisation's demands. Jim Reilly is a consultant, software implementation, for development partnering organisation Octagon Research Solutions Inc. He is based at the company's headquarters in Wayne, Pennsylvania, in the US. Email: [email protected] The pharmaceutical industry has been cast into the storm of the digital age in recent years. It is possible to walk around any pharma company and hear whispers of gene sequencing, predictive animal modelling, electronic data capture, XML authoring or the electronic common technical document. All of these are relatively new developments and form part of a trend towards the ever-elusive concept of institutional efficiency. It is clear that everyone wishes to do things better, smarter and faster. Those of us involved on the regulatory front have not turned a blind eye to this drive towards efficiency. Whether it be adverse event reporting (AERS in the US or EUDRAVigilance in the European Union), clinical trial applications/investigational new drug applications or marketing applications, we are confronted with a host of electronic means to submit data. The recent trend has been towards submitting data simultaneously across the globe. After all, what more efficient way is there to submit similar material than at the same time? Thanks to the advent of the common technical document, authors can pen the story of the safety, efficacy and quality of their therapeutic in a standard way. Gone are the days of writing similar content in alternative formats, or retrofitting information for a different purpose. In the drive towards commonality of review content amongst global regulatory agencies, regulatory groups in pharma have begun focusing their efficiency efforts towards simultaneous global submissions.",
                    "For the first time, a marketing authorisation application in the EU can be submitted at the same time as a new drug application filing in the US, thus driving organisational efficiency, longer patent exclusivity and, most importantly, making therapeutics available expeditiously worldwide. Due to this and other potential efficiencies, regulatory groups are facing increased pressure to deliver applications faster and to submit them to multiple agencies simultaneously. But with simplicity of delivery comes complexity of packaging. Indeed, the regulatory group has often been perceived as a packaging plant, where documentation is received from various contributing groups and compiled into a submission. However, that characterisation is, to put it politely, misguided. The process is a holistic continuum, requiring the orchestration of many cross-functional activities. It requires input from authors, clinical sites, data management, programmers and the regulatory group itself. The group must co-ordinate on-time receipt of internal and external deliverables, resolve issues stemming from these contributed deliverables, and is often under enormous internal pressure to dispatch the submissions to multiple agencies by a specific date. Saddled with this burden, the regulatory group very often faces managerial pressure to “produce” a submission as quickly as possible, even though the work of others may have resulted in its delay. To work within the increasingly complex milieu of the submission management process, it is important for those involved to be armed with detailed and accurate information. With the right information at their fingertips, this group can justify staffing, make accurate deadline projections and even institute process improvement. The onus is therefore on the regulatory group to institute a relatively new process concept: submission management.",
                    "Submission management can be defined as the “orchestration of the people, processes and technologies necessary to facilitate the production and management of global regulatory filings”. As the collection point for much of the output from functional groups, the regulatory group is in a unique position within the organisation as it can fulfil an informational need at both managerial and executive levels. Such a position permits a level of institutional process improvement to be driven. For example, with so many “moving parts” in a submission, it becomes difficult to synchronise processes and resources in such a way as to allow handoffs to exchange seamlessly. In order to ensure that deliverables are on time and “submission ready”, both the regulatory team and contributing areas have to agree upon a standard of deliverable quality, and to develop a mutually agreeable plan of delivery. In creating a system, defining what to measure and knowing how to measure, the regulatory group can effectively manage the complexities of the process while instituting a level of improvement for all contributors. Before assuming that a submission management capability can be instantly arranged, there are some fundamental tenets to follow. Define and implement a standard processFirst, it is an absolute necessity to define and implement a standard process for the development, compilation and submission of a filing. Without a standard, the process is not repeatable and apt to degrade and become problematic. Most organisations have a minimal “working” standard in place, but it is important to document a standard so that the process remains consistent and is transferable despite employee turnover. Additionally, a standard process reduces stress on team members. Instead of questions about how to perform one's job, questions should be reserved for more appropriate matters so team members can concentrate their efforts towards on-time delivery. Proper deliverable tracking should not focus only on the delivery of the final content.",
                    "It requires that the proper lines of communication be open amongst the regulatory and functional groups so that everyone is working towards the same goal and issues are resolved appropriately. Communication should also exist in the form of routine progress updates, thereby keeping all stakeholders focused on the common goal of a quality, on-time submission. Also, review cycles should be built into the process to confirm intent of document placement and navigation. After compilation, dispatch and archival, the regulatory group needs to be vigilant in monitoring any updates required by contributing groups or regulatory authorities, so that they may plan accordingly for future submissions. Determine what information is importantWith a standard process in place, the regulatory group can begin measuring in a meaningful way. Metrics provide information and are the foundation for “knowing” a process. They can identify holes or constraints and provide the capability to develop future projections based on historical results. Therefore, it is important to define the data necessary for measurement. Data such as the dispatch and approval dates are almost a given as points to track. However, if a regulatory group is to plan, execute and react towards the demands of a submission, it needs to track data more scientifically. Data can be tracked with regard to:projected submission dates;resource availability and utilisation;deliverable due dates (from authors, data groups, third parties, etc); anddeliverable returns to functional areas. From a planning perspective, it is important to plan a submission schedule. A longer-term schedule (one to two years) should be plotted for major applications and a shorter-term, floating schedule for smaller submissions. With a schedule in place, a regulatory organisation can align resources to accommodate the effort needed to meet submission deadlines.",
                    "From an operational perspective, this is important in order to manage personnel so that workload is balanced across the team and to ensure that staff are utilised appropriately. Plotting a submission schedule may reveal a spike at certain periods, which is a rampant circumstance in regulatory organisations, especially towards the year end as pressure builds to finalise the submission for agency review. A submission hastily sent at the end of the year may turn out to have originally been targeted for earlier in the year, perhaps when activity was not as brisk. However, any number of potential issues may cause the submission date to be pushed back until there is adequate resolution of the problem. Such issues abound in the submission development process, and are extremely important to track, both from an audit perspective and for the sake of process quality. Examples may be content-specific, where documents are often reversioned, even after being “approved”. Deliverables may slip deadlines or might be rushed due to deadline pressure, increasing the likelihood of inaccuracy or poor formatting. Issues might also be strategic in nature: problems with patient enrolment might delay a study, an update to manufacturing controls may be warranted or an agency query might require a response. Of these issues, deliverable quality and due dates are the most transparent and therefore easiest to track from a regulatory perspective. Deliverable tracking is a highly critical cog in terms of metric gathering as it allows for a view of deliverables in a time-sensitive fashion and those on a critical path can be tracked in relation to the overall submission deadline. When due dates are not met, especially for deliverables on a critical path, the submission deadline may be put in jeopardy. This places an enormous burden on the regulatory group to push the limits of their group to deliver a submission on time. Devise methods of measurementVarious techniques can be employed to track processes, with the prospect of learning and improving.",
                    "Deliverables can be tracked as a series of inputs, even before they are authored or created, by characterising or “typifying” according to the authoring, data, regulatory or third-party groups that produce them. These data can be tracked by noting the instances when deliverables must be returned to a contributing group for modification and should answer the questions of when, why and to whom the deliverable is returned. See Figure 1 for an example of document return rates by functional areas. Issues themselves can also be typified so as to standardise the types of problems an organisation encounters. Coupled with the deliverable types, it is possible to point to problematic trends related to specific functional groups or points in process. See Figure 2 for an example portrayal of submission issue rates by issue type. It is important to note that these data are not meant to point an accusatory finger at colleagues but are intended to illustrate how to make the process better for all. It is doubtful that clinical colleagues like having documents returned, just as regulatory colleagues would rather not pass the deliverable back. Figure 1. Percentage of documents returned by functional area during one month** Data gathered from three pharma companies and illustrated here in aggregate. Figure 1 depicts document return rates from regulatory back to various contributing groups. Whether the reason is content- or format-related, the deliverable is not “submission ready” when passed on to regulatory. Figure 2. Rates of issues in regulatory submissions** Data gathered from three pharma companies and illustrated here in aggregateIn Figure 2 the data portray the typical issues encountered through the course of an electronic submission, and their relative frequencies. This sort of information acts as a springboard into real process improvement.",
                    "An empirical case such as this can be used as a communication tool to upper management to effect change, whether that means better process control in a specific authoring group, or improved deliverable quality from a vendor. Develop or choose a solutionDepending on the group size, organisational need, and internal capability there are a variety of options for building a system to track the information. Spreadsheets are the de facto tracking tool and serve well enough to track the status and date information related to submissions and their deliverables. However, over time, spreadsheets can become unwieldy when tracking large amounts of data, and because they are literal files, data cannot be updated by more than one person at one time. An alternative option is to construct a database. Databases offer much more flexibility in terms of the type of data tracked, and can be developed to allow for ease of information entry through friendly interface screens. Because databases are not literal files, more than one team member can update information simultaneously. Also, from a reporting perspective, databases offer much more capability in the form of aggregating and analysing data. One downside to a database is that data entry is manually intensive, a process often referred to as “feeding the beast”. Last, for a robust tracking capability and higher performance, there are enterprise tracking and management systems. These systems offer more advanced capabilities for information capture and reduce the burden of information entry on team members. Implement an effective methodThe last step in instituting a good submission management capability is to effectively implement a system. Roles and responsibilities should be clearly defined, metrics need to be gathered and communicated in a repeatable way, and the vision should be sold up and down the organisation. It is important to communicate that the metrics gathered are not intended to place blame on a particular group for process inefficiency.",
                    "Metrics are meant to be revelatory with the prospect of encouraging improvement. In essence, the regulatory group is looking at the end product of much of the organisation's work through an analytical lens, and should promote improvement up and down the process chain. In addition, the regulatory group can use information to truly learn how its members do things. This way historical data can act as an accurate predictor of future activity. Instead of plotting a submission schedule based on arbitrary data or anecdotal information, the group can become more accurate with predictions as to when deliverables are received and how long it will take to get them ready for submission. If metric gathering is designed with the end questions in mind, a regulatory group, and indeed the larger organisation, will be well on its way towards improving its submission process."
                }
            };

            //act
            var responseId = _sut.SendCollection(collection);

            var result = new CollectionAnalysis {
                status = ""
            };

            while (result.status.ToLower() != "processed")
            {
                System.Threading.Thread.Sleep(5000);
                result = _sut.GetCollection(collection.id);
            }

            //assert
            Assert.IsNotNull(result.topics.Length > 0);
        }
        private void BindCategoryType()
        {
            DiaryServiceClient diaryService = null;

            try
            {
                diaryService = new DiaryServiceClient();

                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.ForceRefresh = true;
                collectionRequest.StartRow     = 0;
                collectionRequest.RowCount     = 0;

                CancellationCodeSearchReturnValue returnValue = new CancellationCodeSearchReturnValue();
                returnValue = diaryService.GetBookingCancelledCategories(_logonSettings.LogonId, collectionRequest);

                if (returnValue.Success)
                {
                    _ddlCategory.DataSource     = returnValue.CancellationCodes.Rows;
                    _ddlCategory.DataTextField  = "Description";
                    _ddlCategory.DataValueField = "Code";
                    _ddlCategory.DataBind();
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                _lblError.Text     = DataConstants.WSEndPointErrorMessage;
                _lblError.CssClass = "errorMessage";
            }
            catch (Exception ex)
            {
                _lblError.Text     = ex.Message;
                _lblError.CssClass = "errorMessage";
            }
            finally
            {
                if (diaryService != null)
                {
                    if (diaryService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        diaryService.Close();
                    }
                }
            }
            //try
            //{
            //    _ddlCategory.DataSource = DataTables.GetCategoryType();
            //    _ddlCategory.DataTextField = "category";
            //    _ddlCategory.DataValueField = "category";
            //    _ddlCategory.DataBind();
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
        }
        /// <summary>
        /// Gets the matters for the selected client.
        /// </summary>
        private void GetClientMatters(Guid memberId, Guid organisationId)
        {
            _ddlClientMatters.Items.Clear();
            if (_ddlClients.Items.Count > 0)
            {
                MatterServiceClient matterService = null;
                try
                {
                    matterService = new MatterServiceClient();
                    MatterSearchReturnValue matterReturnValue = new MatterSearchReturnValue();
                    CollectionRequest       collectionRequest = new CollectionRequest();
                    collectionRequest.ForceRefresh = true;
                    MatterSearchCriteria criteria = new MatterSearchCriteria();

                    criteria.MemberId       = memberId;
                    criteria.OrganisationId = organisationId;

                    matterReturnValue = matterService.MatterSearch(_logonId,
                                                                   collectionRequest, criteria);

                    if (matterReturnValue.Success)
                    {
                        if (matterReturnValue.Matters.Rows.Length > 0)
                        {
                            foreach (MatterSearchItem matter in matterReturnValue.Matters.Rows)
                            {
                                ListItem item = new ListItem();
                                item.Text  = matter.Reference.Substring(6) + " - " + matter.Description;
                                item.Value = matter.Id.ToString();
                                _ddlClientMatters.Items.Add(item);
                            }
                        }
                        else
                        {
                            SuccessEventArgs success = new SuccessEventArgs();
                            success.Message = "No Matters found for this client.";
                            OnSearchSuccessful(success);
                        }
                    }
                    else
                    {
                        throw new Exception(matterReturnValue.Message);
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    if (matterService != null)
                    {
                        if (matterService.State != System.ServiceModel.CommunicationState.Faulted)
                        {
                            matterService.Close();
                        }
                    }
                }
            }
        }
Example #7
0
        public async Task GetWithComplexReferenceType(CollectionRequest request)
        {
            await Task.CompletedTask;
            var query = HttpContext.Request.QueryString.HasValue ? HttpContext.Request.QueryString.Value : string.Empty;

            _logger.LogWarning(JsonConvert.SerializeObject(new { request, query }));
        }
Example #8
0
        public async Task <IActionResult> GetBsonAlbums(CollectionRequest request)
        {
            var albumMongoApi   = HttpContext.RequestServices.GetService <IAlbumMongoApi>();
            var albumCollection = await albumMongoApi.GetAlbums(request);

            return(Json(albumCollection));
        }
        public ContactSearchItem[] SearchContact(int startRow, int pageSize, string sortBy, string contactName, string organisation,
                                                 string houseNo, string POBox, string postCode, string town,
                                                 bool forceRefresh)
        {
            ContactServiceClient contactService = null;

            ContactSearchItem[] contacts = null;
            try
            {
                if (HttpContext.Current.Session[SessionName.LogonSettings] != null)
                {
                    Guid _logonId = ((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId;

                    CollectionRequest collectionRequest = new CollectionRequest();
                    collectionRequest.ForceRefresh = forceRefresh;
                    collectionRequest.StartRow     = startRow;
                    collectionRequest.RowCount     = pageSize;

                    ContactSearchCriteria criteria = new ContactSearchCriteria();
                    criteria.ContactName  = contactName;
                    criteria.HouseNumber  = houseNo;
                    criteria.Organisation = organisation;
                    criteria.POBox        = POBox;
                    criteria.PostCode     = postCode;
                    criteria.Town         = town;
                    criteria.OrderBy      = sortBy;

                    contactService = new ContactServiceClient();

                    ContactSearchReturnValue returnValue =
                        contactService.ContactSearch(_logonId,
                                                     collectionRequest,
                                                     criteria);
                    if (returnValue.Success)
                    {
                        contacts = returnValue.Contacts.Rows;
                        _contactSearchRowCount = returnValue.Contacts.TotalRowCount;
                    }
                    else
                    {
                        ErrorEventArgs e = new ErrorEventArgs();
                        e.Message = returnValue.Message;
                        OnError(e);
                    }
                }
                return(contacts);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (contactService.State != System.ServiceModel.CommunicationState.Faulted)
                {
                    contactService.Close();
                }
            }
        }
        private void BindTaskTypes()
        {
            DiaryServiceClient diaryService = null;

            try
            {
                diaryService = new DiaryServiceClient();

                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.ForceRefresh = true;
                collectionRequest.StartRow     = 0;
                collectionRequest.RowCount     = 0;

                DiaryParameterReturnValue returnValue = new DiaryParameterReturnValue();
                returnValue = diaryService.GetTaskTypes(_logonSettings.LogonId, collectionRequest);

                if (returnValue.Success)
                {
                    _ddlType.DataSource     = returnValue.DiaryParamters.Rows;
                    _ddlType.DataTextField  = "Description";
                    _ddlType.DataValueField = "Id";
                    _ddlType.DataBind();

                    if (_logonSettings.UserType == (int)DataConstants.UserType.Client ||
                        _logonSettings.UserType == (int)DataConstants.UserType.ThirdParty)
                    {
                        for (int i = 0; i < _ddlType.Items.Count - 1; i++)
                        {
                            if (_ddlType.Items[i].Text != "Standard Task")
                            {
                                _ddlType.Items.RemoveAt(i);
                            }
                        }

                        _ddlType.Enabled = false;
                    }
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (diaryService != null)
                {
                    if (diaryService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        diaryService.Close();
                    }
                }
            }
        }
Example #11
0
        private void BindFeeEarner()
        {
            EarnerServiceClient earnerService = null;

            try
            {
                CollectionRequest collectionRequest = new CollectionRequest();

                EarnerSearchCriteria criteria = new EarnerSearchCriteria();
                criteria.IncludeArchived = false;
                criteria.MultiOnly       = false;

                earnerService = new EarnerServiceClient();
                EarnerSearchReturnValue returnValue = earnerService.EarnerSearch(((LogonReturnValue)Session[SessionName.LogonSettings]).LogonId,
                                                                                 collectionRequest, criteria);

                if (returnValue.Success)
                {
                    _ddlFeeEarner.Items.Clear();
                    foreach (EarnerSearchItem feeEarner in returnValue.Earners.Rows)
                    {
                        ListItem item = new ListItem();
                        item.Text  = CommonFunctions.MakeFullName(feeEarner.Title, feeEarner.Name, feeEarner.SurName);
                        item.Value = feeEarner.Reference + "$" + feeEarner.Id.ToString();

                        if (!_editMode)
                        {
                            if (((LogonReturnValue)Session[SessionName.LogonSettings]).MemberId == feeEarner.Id)
                            {
                                item.Selected = true;
                            }
                        }

                        _ddlFeeEarner.Items.Add(item);
                    }
                    AddDefaultToDropDownList(_ddlFeeEarner);
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (earnerService != null)
                {
                    if (earnerService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        earnerService.Close();
                    }
                }
            }
        }
Example #12
0
        private Resource GetSampleResourceCollection(
            CollectionRequest request,
            IEnumerable <MySampleValue> values)
        {
            var r = CreateResourceCollection(GetUriFromRoute("getallvalues"), request)
                    .AddEmbeddedResources("values", values.Select(x => GetSampleResource(x, request.Fields)));

            return(r);
        }
Example #13
0
        /// <summary>
        /// Gets the industries.
        /// </summary>
        private void BindIndustries()
        {
            ContactServiceClient contactService = null;

            try
            {
                contactService = new ContactServiceClient();
                CollectionRequest         collectionRequest = new CollectionRequest();
                IndustrySearchCriteria    searchCriteria    = new IndustrySearchCriteria();
                IndustrySearchReturnValue returnValue       = contactService.IndustrySearch(_logonSettings.LogonId,
                                                                                            collectionRequest, searchCriteria);
                if (returnValue.Success)
                {
                    //Add a blank item
                    AppFunctions.AddDefaultToDropDownList(_ddlIndustry);

                    //Generate the items to be displayed in the Industry drop down list
                    //Get the main items
                    string industryText = string.Empty;
                    foreach (IndustrySearchItem industry in returnValue.Industries.Rows)
                    {
                        if (industry.ParentId == 0)
                        {
                            industryText = industry.Name;
                            _ddlIndustry.Items.Add(new ListItem(industryText, industry.Id.ToString()));

                            // Call method to get the sub items
                            GetIndustrySubItems(returnValue.Industries.Rows, industryText, industry.Id);
                        }
                    }
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                _lblError.Text     = DataConstants.WSEndPointErrorMessage;
                _lblError.CssClass = "errorMessage";
            }
            catch (Exception ex)
            {
                _lblError.Text     = ex.Message;
                _lblError.CssClass = "errorMessage";
            }
            finally
            {
                if (contactService != null)
                {
                    if (contactService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        contactService.Close();
                    }
                }
            }
        }
Example #14
0
        /// <summary>
        /// Binds VAT rates on page load
        /// </summary>
        private void BindVATRates()
        {
            _ddlVATRate.Items.Clear();
            AccountsServiceClient vatRateClient = new AccountsServiceClient();

            try
            {
                VatRateSearchCriteria criteria = new VatRateSearchCriteria();
                criteria.IncludeNonVatable = false;
                criteria.IncludeArchived   = false;

                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.StartRow = 0;

                VatRateSearchReturnValue vatReturnValue = vatRateClient.VatRateSearch(_logonSettings.LogonId, collectionRequest, criteria);

                if (vatReturnValue.Success)
                {
                    if (vatReturnValue.VatRates != null)
                    {
                        for (int i = 0; i < vatReturnValue.VatRates.Rows.Length; i++)
                        {
                            ListItem item = new ListItem(vatReturnValue.VatRates.Rows[i].Description, vatReturnValue.VatRates.Rows[i].Id.ToString() + "$" + vatReturnValue.VatRates.Rows[i].Percentage.ToString());

                            if (vatReturnValue.VatRates.Rows[i].IsDefault)
                            {
                                _ddlVATRate.SelectedIndex = -1;
                                item.Selected             = true;
                            }
                            _ddlVATRate.Items.Add(item);
                        }
                    }
                }
                else
                {
                    _lblMessage.Text = vatReturnValue.Message;
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                _lblMessage.Text     = DataConstants.WSEndPointErrorMessage;
                _lblMessage.CssClass = "errorMessage";
            }
            catch (Exception ex)
            {
                _lblMessage.CssClass = "errorMessage";
                _lblMessage.Text     = ex.Message;
            }
            finally
            {
                if (vatRateClient.State != System.ServiceModel.CommunicationState.Faulted)
                {
                    vatRateClient.Close();
                }
            }
        }
        private void GetDefaultFeeEarnerDetails()
        {
            DiaryServiceClient diaryService = null;

            _txtAttendees.Text          = string.Empty;
            _hdnAttendeesMemberId.Value = string.Empty;
            try
            {
                diaryService = new DiaryServiceClient();

                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.ForceRefresh = true;
                collectionRequest.StartRow     = 0;
                collectionRequest.RowCount     = 0;

                DiaryMemberSearchReturnValue returnValue = new DiaryMemberSearchReturnValue();
                returnValue = diaryService.GetDiaryMembers(_logonSettings.LogonId, collectionRequest);

                if (returnValue.Success)
                {
                    for (int i = 0; i < returnValue.DiaryMembers.Rows.Length; i++)
                    {
                        if (_logonSettings.MemberId.ToString() == returnValue.DiaryMembers.Rows[i].MemberID)
                        {
                            _txtAttendees.Text           = _txtAttendees.Text + returnValue.DiaryMembers.Rows[i].MemberDisplayName + "; ";
                            _hdnAttendeesMemberId.Value += _hdnAttendeesMemberId.Value + returnValue.DiaryMembers.Rows[i].MemberID + "; ";
                        }
                    }
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                _lblError.Text     = DataConstants.WSEndPointErrorMessage;
                _lblError.CssClass = "errorMessage";
            }
            catch (Exception ex)
            {
                _lblError.Text     = ex.Message;
                _lblError.CssClass = "errorMessage";
            }
            finally
            {
                if (diaryService != null)
                {
                    if (diaryService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        diaryService.Close();
                    }
                }
            }
        }
Example #16
0
        /// <summary>
        /// Displays the client matters.
        /// </summary>
        public MatterSearchItem[] GetClientMatters(int startRow, int pageSize,
                                                   string memberId, string organisationId, bool forceRefresh)
        {
            MatterServiceClient matterService = null;

            MatterSearchItem[] clientMatters = null;
            try
            {
                Guid logonId = ((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId;
                Guid orgId   = new Guid(organisationId);
                Guid memId   = new Guid(memberId);

                matterService = new MatterServiceClient();

                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.StartRow     = startRow;
                collectionRequest.RowCount     = pageSize;
                collectionRequest.ForceRefresh = forceRefresh;
                MatterSearchCriteria searchCriteria = new MatterSearchCriteria();

                if (memId != DataConstants.DummyGuid)
                {
                    searchCriteria.MemberId = memId;
                }
                else
                {
                    searchCriteria.OrganisationId = orgId;
                }

                MatterSearchReturnValue returnValue = matterService.MatterSearch(logonId,
                                                                                 collectionRequest, searchCriteria);

                if (returnValue.Success)
                {
                    _clientMatterRowCount = returnValue.Matters.TotalRowCount;
                    clientMatters         = returnValue.Matters.Rows;
                }

                return(clientMatters);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (matterService != null)
                {
                    if (matterService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        matterService.Close();
                    }
                }
            }
        }
        private void GetDefaultFeeEarnerDetails()
        {
            DiaryServiceClient diaryService = null;

            try
            {
                diaryService = new DiaryServiceClient();

                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.ForceRefresh = true;
                collectionRequest.StartRow     = 0;
                collectionRequest.RowCount     = 0;

                DiaryMemberSearchReturnValue returnValue = new DiaryMemberSearchReturnValue();
                returnValue = diaryService.GetDiaryMembers(_logonSettings.LogonId, collectionRequest);

                if (returnValue.Success)
                {
                    for (int i = 0; i < returnValue.DiaryMembers.Rows.Length; i++)
                    {
                        if (_logonSettings.UserDefaultFeeMemberId.ToString() == returnValue.DiaryMembers.Rows[i].MemberID)
                        {
                            _ddlUsers.SelectedIndex = -1;
                            if (_ddlUsers.Items.FindByValue(_logonSettings.UserDefaultFeeMemberId.ToString()) != null)
                            {
                                _ddlUsers.Items.FindByValue(_logonSettings.UserDefaultFeeMemberId.ToString()).Selected = true;
                            }
                        }
                    }
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (diaryService != null)
                {
                    if (diaryService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        diaryService.Close();
                    }
                }
            }

            if (_ddlUsers.SelectedValue == "")
            {
                _ddlUsers.SelectedIndex = 0;
            }
        }
Example #18
0
 public JsonResult GetContentList([FromQuery] CollectionRequest request)
 {
     return(Json(UnitOfWork.Repository <ContentObject>()
                 .Select(x => new ContentObjectViewModel
     {
         Id = x.Id,
         Title = x.Title,
         Url = x.Url,
         Active = x.Active
     }).ToCollectionResult(request, TryGetComposer <ContentObjectViewModel>())));
 }
Example #19
0
        private void BindPartner()
        {
            EarnerServiceClient earnerService = null;

            try
            {
                PartnerSearchCriteria criteria = new PartnerSearchCriteria();
                earnerService = new EarnerServiceClient();

                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.ForceRefresh = true;
                collectionRequest.StartRow     = 0;
                collectionRequest.RowCount     = 0;

                PartnerSearchReturnValue returnValue = new PartnerSearchReturnValue();
                returnValue = earnerService.PartnerSearch(_logonSettings.LogonId, collectionRequest, criteria);

                if (returnValue.Success)
                {
                    foreach (PartnerSearchItem partner in returnValue.Partners.Rows)
                    {
                        ListItem item = new ListItem();
                        item.Text  = CommonFunctions.MakeFullName(partner.PersonTitle, partner.Name, partner.Surname);
                        item.Value = partner.PartnerId.ToString();
                        _ddlPartner.Items.Add(item);
                    }
                    _ddlPartner.Items.Insert(0, new ListItem("All Partners", ""));
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                _lblMessage.Text     = DataConstants.WSEndPointErrorMessage;
                _lblMessage.CssClass = "errorMessage";
            }
            catch (Exception ex)
            {
                _lblMessage.CssClass = "errorMessage";
                _lblMessage.Text     = ex.Message;
            }
            finally
            {
                if (earnerService != null)
                {
                    if (earnerService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        earnerService.Close();
                    }
                }
            }
        }
        /// <summary>
        /// Populate Clearance Days
        /// </summary>
        private void SetClearanceDays(int clearanceTypeId, bool isCredit)
        {
            AccountsServiceClient accountService = null;

            try
            {
                CollectionRequest collectionRequest = new CollectionRequest();

                ClearanceTypeSearchCriteria criteria = new ClearanceTypeSearchCriteria();
                criteria.IsCredit        = isCredit;
                criteria.IncludeArchived = false;

                accountService = new AccountsServiceClient();
                ClearanceTypeSearchReturnValue returnValue = accountService.ClearanceTypes(_logonSettings.LogonId,
                                                                                           collectionRequest, criteria);

                if (returnValue.Success)
                {
                    foreach (ClearanceTypeSearchItem type in returnValue.ClearanceTypes.Rows)
                    {
                        if (clearanceTypeId == type.ClearanceTypeId)
                        {
                            _txtClearanceDaysChq.Text  = type.ClearanceTypeChqDays.ToString();
                            _txtClearanceDaysElec.Text = type.ClearanceTypeElecDays.ToString();
                        }
                    }
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                _lblMessage.Text     = DataConstants.WSEndPointErrorMessage;
                _lblMessage.CssClass = "errorMessage";
            }
            catch (Exception ex)
            {
                _lblMessage.CssClass = "errorMessage";
                _lblMessage.Text     = ex.Message;
            }
            finally
            {
                if (accountService != null)
                {
                    if (accountService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        accountService.Close();
                    }
                }
            }
        }
        /// <summary>
        /// Gets the documents for the matter.
        /// </summary>
        public DocumentSearchItem[] GetMatterDocuments(int startRow, int pageSize)
        {
            DocumentServiceClient documentService = new DocumentServiceClient();

            DocumentSearchItem[] matterDocs = null;
            try
            {
                Guid logonId = ((LogonReturnValue)Session[SessionName.LogonSettings]).LogonId;
                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.StartRow     = startRow;
                collectionRequest.RowCount     = pageSize;
                collectionRequest.ForceRefresh = true;

                if (Session[SessionName.ProjectId] != null)
                {
                    DocumentSearchReturnValue returnValue = documentService.MatterDocumentSearch(logonId, (Guid)Session[SessionName.ProjectId], "");
                    if (returnValue != null)
                    {
                        if (returnValue.Success)
                        {
                            if (returnValue.Document != null)
                            {
                                matterDocs = returnValue.Document.Rows;
                                _matterDocumentRowCount = returnValue.Document.Rows.Length;
                            }
                        }
                        else
                        {
                            throw new Exception(returnValue.Message);
                        }
                    }
                }
                else
                {
                    throw new Exception("No Project Id found.");
                }
                return(matterDocs);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (documentService != null)
                {
                    if (documentService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        documentService.Close();
                    }
                }
            }
        }
Example #22
0
        /// <summary>
        /// Gets the supplimentary details for the role
        /// </summary>
        private void GetRoleExtendedInfo()
        {
            ContactServiceClient contactService = null;

            try
            {
                CollectionRequest collectionRequest     = new CollectionRequest();
                RoleExtendedInfoSearchCriteria criteria = new RoleExtendedInfoSearchCriteria();
                criteria.AssociationRoleId = Convert.ToInt32(_ddlRole.SelectedValue);

                contactService = new ContactServiceClient();
                RoleExtendedInfoReturnValue returnValue = contactService.RoleExtendedInfoSearch(_logonSettings.LogonId,
                                                                                                criteria, collectionRequest);

                if (returnValue.Success)
                {
                    //Set to false so that the info is not fetched again from the service if the user
                    //navigates back and does not change the role
                    _hdnRefreshRoleExtInfo.Value = "false";

                    if (returnValue.RoleExtendedInfo.Rows.Length > 0)
                    {
                        _grdAdditionalAssociationInfo.DataSource = returnValue.RoleExtendedInfo.Rows;
                        _grdAdditionalAssociationInfo.DataBind();
                    }
                    else
                    {
                        _grdAdditionalAssociationInfo.DataSource = null;
                        _grdAdditionalAssociationInfo.DataBind();

                        _wizardAddAssociationsForMatter.WizardSteps.Remove(_wizardStepAdditionalAssociationInfo2);
                    }
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (contactService != null)
                {
                    if (contactService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        contactService.Close();
                    }
                }
            }
        }
Example #23
0
        public ChequeAuthorisationSearchItem[] LoadUnauthorisedClientChequeRequestsCredit(int startRow, int pageSize, bool forceRefresh)
        {
            AccountsServiceClient accountsService = null;

            ChequeAuthorisationSearchItem[] clientChequeRequests = null;

            try
            {
                accountsService = new AccountsServiceClient();
                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.ForceRefresh = forceRefresh;
                collectionRequest.StartRow     = startRow;
                collectionRequest.RowCount     = pageSize;

                ChequeAuthorisationSearchCriteria searchCriteria = new ChequeAuthorisationSearchCriteria();
                searchCriteria.IsAuthorised = false;
                searchCriteria.IsPosted     = false;

                // Suggestd by client after introducing new properties in service layer
                searchCriteria.IncludeDebit  = false;
                searchCriteria.IncludeCredit = true;

                Guid logonId = ((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId;
                ChequeAuthorisationReturnValue returnValue = accountsService.GetUnauthorisedClientChequeRequests(logonId, collectionRequest, searchCriteria);

                if (returnValue.Success)
                {
                    _clientChequeRequestsCreditRowCount = returnValue.ChequeRequests.TotalRowCount;
                    clientChequeRequests = returnValue.ChequeRequests.Rows;
                }
                else
                {
                    _lblMessage.CssClass = "errorMessage";
                    _lblMessage.Text     = returnValue.Message;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (accountsService != null)
                {
                    if (accountsService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        accountsService.Close();
                    }
                }
            }

            return(clientChequeRequests);
        }
        /// <summary>
        /// Gets list of client banks
        /// </summary>
        /// <param name="bankType">Bank type should be of client type</param>
        /// <returns>Returns banks of client type on page load.</returns>
        private BankSearchItem[] GetBanks(DataConstants.BankSearchTypes bankType)
        {
            BankServiceClient bankService = null;

            BankSearchItem[] banks = null;
            try
            {
                CollectionRequest collectionRequest = new CollectionRequest();

                BankSearchCriteria criteria = new BankSearchCriteria();
                criteria.IncludeArchived = false;
                criteria.BankSearchTypes = (int)bankType;


                bankService = new BankServiceClient();
                BankSearchReturnValue returnValue = bankService.BankSearch(_logonSettings.LogonId,
                                                                           collectionRequest, criteria);

                if (returnValue.Success)
                {
                    banks = returnValue.Banks.Rows;
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
                return(banks);
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                _lblMessage.Text     = DataConstants.WSEndPointErrorMessage;
                _lblMessage.CssClass = "errorMessage";
                return(banks);
            }
            catch (Exception ex)
            {
                _lblMessage.CssClass = "errorMessage";
                _lblMessage.Text     = ex.Message;
                return(banks);
            }
            finally
            {
                if (bankService != null)
                {
                    if (bankService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        bankService.Close();
                    }
                }
            }
        }
Example #25
0
        /// <summary>
        /// Gets the industries.
        /// </summary>
        private void GetIndustries()
        {
            ContactServiceClient contactService = null;

            try
            {
                contactService = new ContactServiceClient();
                CollectionRequest         collectionRequest = new CollectionRequest();
                IndustrySearchCriteria    searchCriteria    = new IndustrySearchCriteria();
                IndustrySearchReturnValue returnValue       = contactService.IndustrySearch(_logonId,
                                                                                            collectionRequest, searchCriteria);
                if (returnValue.Success)
                {
                    //Add a blank item
                    _ddlIndustry.Items.Add(new ListItem("", "0"));

                    //Generate the items to be displayed in the Industry drop down list
                    //Get the main items
                    string industryText = string.Empty;
                    foreach (IndustrySearchItem industry in returnValue.Industries.Rows)
                    {
                        if (industry.ParentId == 0)
                        {
                            industryText = industry.Name;
                            _ddlIndustry.Items.Add(new ListItem(industryText, industry.Id.ToString()));

                            // Call method to get the sub items
                            GetIndustrySubItems(returnValue.Industries.Rows, industryText, industry.Id);
                        }
                    }
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (contactService != null)
                {
                    if (contactService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        contactService.Close();
                    }
                }
            }
        }
        /// <summary>
        /// Gets list of clearance type
        /// </summary>
        /// <returns>Returns clearance types.</returns>
        private ClearanceTypeSearchItem[] GetClearanceType(bool isCredit)
        {
            AccountsServiceClient accountService = null;

            ClearanceTypeSearchItem[] clearanceType = null;
            try
            {
                CollectionRequest collectionRequest = new CollectionRequest();

                ClearanceTypeSearchCriteria criteria = new ClearanceTypeSearchCriteria();
                criteria.IsCredit        = isCredit;
                criteria.IncludeArchived = false;

                accountService = new AccountsServiceClient();
                ClearanceTypeSearchReturnValue returnValue = accountService.ClearanceTypes(_logonSettings.LogonId,
                                                                                           collectionRequest, criteria);

                if (returnValue.Success)
                {
                    clearanceType = returnValue.ClearanceTypes.Rows;
                }
                else
                {
                    throw new Exception(returnValue.Message);
                }
                return(clearanceType);
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                _lblMessage.Text     = DataConstants.WSEndPointErrorMessage;
                _lblMessage.CssClass = "errorMessage";
                return(clearanceType);
            }
            catch (Exception ex)
            {
                _lblMessage.CssClass = "errorMessage";
                _lblMessage.Text     = ex.Message;
                return(clearanceType);
            }
            finally
            {
                if (accountService != null)
                {
                    if (accountService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        accountService.Close();
                    }
                }
            }
        }
Example #27
0
        /// <summary>
        /// Searches for clients that match the search criteria.
        /// </summary>
        public ServiceSearchItem[] SearchService(int startRow, int pageSize, string sortBy, string industry, bool forceRefresh)
        {
            TimeServiceClient timeService = null;

            ServiceSearchItem[] services = null;
            try
            {
                if (HttpContext.Current.Session[SessionName.LogonSettings] != null)
                {
                    Guid _logonId = ((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId;
                    CollectionRequest collectionRequest = new CollectionRequest();
                    collectionRequest.ForceRefresh = forceRefresh;
                    collectionRequest.StartRow     = startRow;
                    collectionRequest.RowCount     = pageSize;

                    ServiceSearchCriteria criteria = new ServiceSearchCriteria();
                    criteria.IndustryId = Convert.ToInt32(industry);
                    criteria.OrderBy    = sortBy;

                    timeService = new TimeServiceClient();
                    ServiceSearchReturnValue returnValue = timeService.ServiceSearchOnIndustry(_logonId,
                                                                                               collectionRequest, criteria);

                    if (returnValue.Success)
                    {
                        _serviceRowCount = returnValue.Service.TotalRowCount;
                        services         = returnValue.Service.Rows;
                    }
                    else
                    {
                        throw new Exception(returnValue.Message);
                    }
                }
                return(services);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (timeService != null)
                {
                    if (timeService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        timeService.Close();
                    }
                }
            }
        }
Example #28
0
        public virtual int SendCollection(CollectionRequest collection, string configId = null, string jobId = null)
        {
            string url = RepositoryClient.BuildUrl(ApiKeys, "collection", configId);

            if (!string.IsNullOrEmpty(jobId))
            {
                var delimiter = string.IsNullOrWhiteSpace(configId) ? "?" : "&";
                url = $"{url}{delimiter}job_id={jobId}";
            }
            string data     = JsonConvert.SerializeObject(collection);
            var    response = RepositoryClient.PostStatus(url, data);

            return(response);
        }
Example #29
0
        /// <summary>
        /// Loads client balances details by project id
        /// </summary>
        /// <param name="startRow">starting row for grid view</param>
        /// <param name="pageSize">Sets the page size for grid view.</param>
        /// <param name="forceRefresh">Gets records if forcefresh is true else gets records from cacahe.</param>
        /// <returns>Retrieves client balances details by project id</returns>
        public BalancesSearchItem[] LoadClientBalancesDetails(int startRow, int pageSize, bool forceRefresh)
        {
            AccountsServiceClient accountsService = null;

            BalancesSearchItem[] clientBalances = null;

            try
            {
                if (Session[SessionName.ProjectId] != null)
                {
                    accountsService = new AccountsServiceClient();
                    CollectionRequest collectionRequest = new CollectionRequest();
                    collectionRequest.ForceRefresh = forceRefresh;
                    collectionRequest.StartRow     = startRow;
                    collectionRequest.RowCount     = pageSize;

                    Guid projectId = (Guid)Session[SessionName.ProjectId];
                    Guid logonId   = ((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId;
                    BalancesSearchReturnValue returnValue = accountsService.GetClientBalancesDetails(logonId, collectionRequest, projectId);

                    if (returnValue.Success)
                    {
                        _clientRowCount = returnValue.Balances.TotalRowCount;
                        clientBalances  = returnValue.Balances.Rows;
                    }
                    else
                    {
                        _lblMessage.CssClass = "errorMessage";
                        _lblMessage.Text     = returnValue.Message;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (accountsService != null)
                {
                    if (accountsService.State != System.ServiceModel.CommunicationState.Faulted)
                    {
                        accountsService.Close();
                    }
                }
            }

            return(clientBalances);
        }
        /// <summary>
        /// Gets the matters for the client.
        /// </summary>
        private void BindDocumentTypes()
        {
            DocumentServiceClient documentTypeService = new DocumentServiceClient();

            try
            {
                CollectionRequest collectionRequest = new CollectionRequest();
                collectionRequest.StartRow = 0;

                DocumentTypeSearchCriteria docTypeCriteria = new DocumentTypeSearchCriteria();
                docTypeCriteria.DocTypeIDs = "1, 3";
                FileTypeReturnValue fileTypeReturnValue = documentTypeService.GetFileTypes(((LogonReturnValue)HttpContext.Current.Session[SessionName.LogonSettings]).LogonId);

                if (fileTypeReturnValue.Success)
                {
                    if (fileTypeReturnValue.FileType != null)
                    {
                        _ddlFileType.DataSource     = fileTypeReturnValue.FileType;
                        _ddlFileType.DataTextField  = "FileDescription";
                        _ddlFileType.DataValueField = "FileDescription";
                        _ddlFileType.DataBind();
                    }
                }
                else
                {
                    throw new Exception(fileTypeReturnValue.Message);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException)
            {
                _lblError.Text     = DataConstants.WSEndPointErrorMessage;
                _lblError.CssClass = "errorMessage";
            }
            catch (Exception ex)
            {
                _lblError.Text     = ex.Message;
                _lblError.CssClass = "errorMessage";
            }
            finally
            {
                if (documentTypeService.State != System.ServiceModel.CommunicationState.Faulted)
                {
                    documentTypeService.Close();
                }
            }

            _ddlFileType.SelectedIndex = -1;
            _ddlFileType.SelectedIndex = _ddlFileType.Items.Count - 1;
        }