Exemple #1
0
 public static MSBuildLogsExtended.WcfContracts.ISolutionServiceAsyn ResolveWcfServiceSolution()
 {
     Framework.CommonBLLEntities.IBusinessLogicLayerContextContainer _IBusinessLogicLayerContextContainer = Framework.IoCContainerWrapperSingleton.Instance.IoCContainer.Resolve <Framework.CommonBLLEntities.IBusinessLogicLayerContextContainer>();
     Framework.CommonBLLEntities.BusinessLogicLayerContext           _BusinessLogicLayerContext           = _IBusinessLogicLayerContextContainer.BusinessLogicLayerContext;
     MSBuildLogsExtended.WcfContracts.IBusinessLogicLayerFactoryAsyn _IBusinessLogicLayerFactory          = Framework.IoCContainerWrapperSingleton.Instance.IoCContainer.Resolve <MSBuildLogsExtended.WcfContracts.IBusinessLogicLayerFactoryAsyn>();
     MSBuildLogsExtended.WcfContracts.ISolutionServiceAsyn           _BusinessLogicLayerInstance          = _IBusinessLogicLayerFactory.CreateBLLInstanceOfEntitySolution(_BusinessLogicLayerContext);
     return(_BusinessLogicLayerInstance);
 }
        public void GetDropDownContentsOfSolution_1()
        {
            MSBuildLogsExtended.WcfContracts.ISolutionServiceAsyn _Instance = MSBuildLogsExtended.WcfContracts.WcfServiceResolverAsyn.ResolveWcfServiceSolution();

            AsyncCallback asyncCallback = delegate(IAsyncResult result)
            {
                try
                {
#if WINDOWS_PHONE
                    DispatcherHelper.Initialize();
#endif
                    DispatcherHelper.CheckBeginInvokeOnUI((Action) delegate()
                    {
                        var responseMessage = _Instance.EndGetCollectionOfNameValuePairOfAll(result);
                        Framework.NameValueCollection collection = responseMessage.Message;
                        this.DropDownContentsOfSolution_1.Clear();
                        if (collection != null)
                        {
                            foreach (Framework.NameValuePair item in collection)
                            {
                                this.DropDownContentsOfSolution_1.Add(item);
                            }
                        }
                    });
                }
                catch (Exception ex)
                {
                }
            };

            try
            {
                MSBuildLogsExtended.CommonBLLEntities.SolutionRequestMessageUserDefinedOfAll _Request = new MSBuildLogsExtended.CommonBLLEntities.SolutionRequestMessageUserDefinedOfAll()
                {
                    Critieria                      = new MSBuildLogsExtended.CommonBLLEntities.SolutionChainedQueryCriteriaAll(),
                    QueryPagingSetting             = new Framework.EntityContracts.QueryPagingSetting(-1, -1),
                    QueryOrderBySettingCollection  = new Framework.EntityContracts.QueryOrderBySettingCollection(null),
                    BusinessLogicLayerRequestID    = Guid.NewGuid().ToString(),
                    BusinessLogicLayerRequestTypes = Framework.CommonBLLEntities.BusinessLogicLayerRequestTypes.Search,
                };

                _Instance.BeginGetCollectionOfNameValuePairOfAll(_Request, asyncCallback, null);
            }
            catch (Exception ex)
            {
            }
        }
Exemple #3
0
        protected override void Search()
        {
            this.SearchStatus = Framework.EntityContracts.SearchStatus.Searching;

            #region Asyncronized wcf method call

            string             viewName = ViewName_SearchResult;
            Framework.UIAction uiAction = Framework.UIAction.Search;

            Messenger.Default.Send <Framework.UIActionStatusMessage>(new Framework.UIActionStatusMessage(EntityName, viewName, uiAction, Framework.UIActionStatus.Starting));

            MSBuildLogsExtended.WcfContracts.ISolutionServiceAsyn _Instance = MSBuildLogsExtended.WcfContracts.WcfServiceResolverAsyn.ResolveWcfServiceSolution();

            AsyncCallback asyncCallback = delegate(IAsyncResult result)
            {
#if WINDOWS_PHONE
                DispatcherHelper.Initialize();
#endif
                try
                {
                    DispatcherHelper.CheckBeginInvokeOnUI((Action) delegate()
                    {
                        var responseMessage = _Instance.EndGetCollectionOfEntityOfCommon(result);
                        MSBuildLogsExtended.DataSourceEntities.SolutionCollection collection = responseMessage.Message;

                        if (this.m_EntityCollection == null)
                        {
                            this.m_EntityCollection = new ObservableCollection <MSBuildLogsExtended.DataSourceEntities.Solution>();
                        }

#if WINDOWS_PHONE
                        if (this.IsToClearExistingCollection)
                        {
                            this.m_EntityCollection.Clear();
                        }
#endif

                        if (collection != null)
                        {
                            foreach (MSBuildLogsExtended.DataSourceEntities.Solution item in collection)
                            {
                                this.m_EntityCollection.Add(item);
                            }
                        }


                        if (responseMessage.QueryPagingResult != null)
                        {
                            this.QueryPagingSetting = GetQueryPagingSettingFromQueryPagingResult(responseMessage.QueryPagingResult);

#if WINDOWS_PHONE
                            if (!this.IsToClearExistingCollection && this.QueryPagingSetting.CurrentPage <= this.QueryPagingSetting.CountOfPages)
                            {
                                this.QueryPagingSetting.CurrentPage++;
                            }
#endif
                        }

                        this.SearchStatus = Framework.EntityContracts.SearchStatus.SearchResultLoaded;

                        Messenger.Default.Send <Framework.UIActionStatusMessage>(new Framework.UIActionStatusMessage(EntityName, viewName, uiAction, Framework.UIActionStatus.Success));
                    });
                }
                catch (Exception ex)
                {
                    DispatcherHelper.CheckBeginInvokeOnUI((Action) delegate()
                    {
                        Messenger.Default.Send <Framework.UIActionStatusMessage>(new Framework.UIActionStatusMessage(EntityName, viewName, uiAction, Framework.UIActionStatus.Failed, ex.Message));
                    });
                }
            };

            try
            {
                MSBuildLogsExtended.CommonBLLEntities.SolutionRequestMessageUserDefinedOfCommon _Request = new MSBuildLogsExtended.CommonBLLEntities.SolutionRequestMessageUserDefinedOfCommon()
                {
                    Critieria                      = this.Criteria,
                    QueryPagingSetting             = this.QueryPagingSetting,
                    QueryOrderBySettingCollection  = this.QueryOrderBySettingCollection,
                    BusinessLogicLayerRequestID    = Guid.NewGuid().ToString(),
                    BusinessLogicLayerRequestTypes = Framework.CommonBLLEntities.BusinessLogicLayerRequestTypes.Search,
                };

                _Instance.BeginGetCollectionOfEntityOfCommon(_Request, asyncCallback, null);
            }
            catch (Exception ex)
            {
                Messenger.Default.Send <Framework.UIActionStatusMessage>(new Framework.UIActionStatusMessage(EntityName, viewName, uiAction, Framework.UIActionStatus.Failed, ex.Message));
            }

            #endregion Asyncronized wcf method call

            #region Syncronized wcf method call -- not in use/WPF only

            /*
             * if (this.m_EntityCollection == null)
             * {
             *  this.m_EntityCollection = new ObservableCollection<MSBuildLogsExtended.DataSourceEntities.Solution>();
             * }
             *
             * this.m_EntityCollection.Clear();
             *
             * MSBuildLogsExtended.DataSourceEntities.SolutionCollection collection = MSBuildLogsExtended.CommonBLLIoC.IoCSolution.GetCollectionOfEntityOfCommon(m_CriteriaOfGetCollectionOfEntityOfCommon, this.m_QueryPagingSetting, this.m_QueryOrderBySettingCollection);
             * if(collection != null)
             * {
             *  foreach (MSBuildLogsExtended.DataSourceEntities.Solution item in collection)
             *  {
             *      this.m_EntityCollection.Add(item);
             *  }
             * }
             */
            #endregion Syncronized wcf method call -- not in use/WPF only
        }
Exemple #4
0
        /// <summary>,
        /// delete a MSBuildLogsExtended.DataSourceEntities.Solution.
        /// </summary>
        protected override void Delete()
        {
            #region Asyncronized wcf method call

            string             viewName = ViewName_Delete;
            Framework.UIAction uiAction = Framework.UIAction.Delete;

            Messenger.Default.Send <Framework.UIActionStatusMessage>(new Framework.UIActionStatusMessage(EntityName, viewName, uiAction, Framework.UIActionStatus.Starting));

            MSBuildLogsExtended.WcfContracts.ISolutionServiceAsyn _Instance = MSBuildLogsExtended.WcfContracts.WcfServiceResolverAsyn.ResolveWcfServiceSolution();

            AsyncCallback asyncCallback = delegate(IAsyncResult result)
            {
#if WINDOWS_PHONE
                DispatcherHelper.Initialize();
#endif
                try
                {
                    DispatcherHelper.CheckBeginInvokeOnUI((Action) delegate()
                    {
                        var responseMessage = _Instance.EndDeleteEntity(result);

                        this.Search();

                        Messenger.Default.Send <Framework.UIActionStatusMessage>(new Framework.UIActionStatusMessage(EntityName, viewName, uiAction, Framework.UIActionStatus.Success));
                    });
                }
                catch (Exception ex)
                {
                    DispatcherHelper.CheckBeginInvokeOnUI((Action) delegate()
                    {
                        Messenger.Default.Send <Framework.UIActionStatusMessage>(new Framework.UIActionStatusMessage(EntityName, viewName, uiAction, Framework.UIActionStatus.Failed, ex.Message));
                    });
                }
            };

            try
            {
#if WINDOWS_PHONE
                AssignSelectedValueFromSelectedItemToEntity(this.m_CurrentInEditing);
#endif

                MSBuildLogsExtended.CommonBLLEntities.SolutionRequestMessageBuiltIn _Request = new MSBuildLogsExtended.CommonBLLEntities.SolutionRequestMessageBuiltIn()
                {
                    Critieria = new MSBuildLogsExtended.DataSourceEntities.SolutionCollection(),
                    BusinessLogicLayerRequestID    = Guid.NewGuid().ToString(),
                    BusinessLogicLayerRequestTypes = Framework.CommonBLLEntities.BusinessLogicLayerRequestTypes.Delete,
                };
                _Request.Critieria.Add(MSBuildLogsExtended.EntityContracts.ISolutionHelper.Clone <MSBuildLogsExtended.DataSourceEntities.Solution, MSBuildLogsExtended.DataSourceEntities.Solution>(this.m_Current));
                _Instance.BeginDeleteEntity(_Request, asyncCallback, null);
            }
            catch (Exception ex)
            {
                Messenger.Default.Send <Framework.UIActionStatusMessage>(new Framework.UIActionStatusMessage(EntityName, viewName, uiAction, Framework.UIActionStatus.Failed, ex.Message));
            }

            #endregion Asyncronized wcf method call

            #region Syncronized wcf method call -- not in use/WPF only

            /*
             * MSBuildLogsExtended.CommonBLLIoC.IoCSolution.DeleteEntity(this.m_Current);//
             * this.m_EntityCollection.Remove(this.m_Current);
             */

            #endregion Syncronized wcf method call -- not in use/WPF only
        }