예제 #1
0
 public static MSBuildLogsExtended.WcfContracts.IBuildLogServiceAsyn ResolveWcfServiceBuildLog()
 {
     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.IBuildLogServiceAsyn           _BusinessLogicLayerInstance          = _IBusinessLogicLayerFactory.CreateBLLInstanceOfEntityBuildLog(_BusinessLogicLayerContext);
     return(_BusinessLogicLayerInstance);
 }
예제 #2
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.IBuildLogServiceAsyn _Instance = MSBuildLogsExtended.WcfContracts.WcfServiceResolverAsyn.ResolveWcfServiceBuildLog();

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

                        if (this.m_EntityCollectionDefault == null)
                        {
                            this.m_EntityCollectionDefault = new ObservableCollection <MSBuildLogsExtended.DataSourceEntities.BuildLog.Default>();
                        }

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

                        if (collection != null)
                        {
                            foreach (MSBuildLogsExtended.DataSourceEntities.BuildLog.Default item in collection)
                            {
                                this.m_EntityCollectionDefault.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
            {
#if WINDOWS_PHONE
                this.AssignSelectedValueFromSelectedItemToCritieriaOfDefault();
#endif
                MSBuildLogsExtended.CommonBLLEntities.BuildLogRequestMessageUserDefinedOfCommon _Request = new MSBuildLogsExtended.CommonBLLEntities.BuildLogRequestMessageUserDefinedOfCommon()
                {
                    Critieria                      = this.Criteria,
                    QueryPagingSetting             = this.QueryPagingSetting,
                    QueryOrderBySettingCollection  = this.QueryOrderBySettingCollection,
                    BusinessLogicLayerRequestID    = Guid.NewGuid().ToString(),
                    BusinessLogicLayerRequestTypes = Framework.CommonBLLEntities.BusinessLogicLayerRequestTypes.Search,
                };

                _Instance.BeginGetCollectionOfDefaultOfCommon(_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_EntityCollectionDefault = new ObservableCollection<MSBuildLogsExtended.DataSourceEntities.BuildLog.Default>();
             * }
             *
             * this.m_EntityCollectionDefault.Clear();
             *
             * MSBuildLogsExtended.DataSourceEntities.BuildLog.DefaultCollection collection = MSBuildLogsExtended.CommonBLLIoC.IoCBuildLog.GetCollectionOfDefaultOfCommon(m_CriteriaOfGetCollectionOfDefaultOfCommon, this.m_QueryPagingSetting, this.m_QueryOrderBySettingCollection);
             * if(collection != null)
             * {
             *  foreach (MSBuildLogsExtended.DataSourceEntities.BuildLog.Default item in collection)
             *  {
             *      this.m_EntityCollectionDefault.Add(item);
             *  }
             * }
             */
            #endregion Syncronized wcf method call -- not in use/WPF only
        }
예제 #3
0
        /// <summary>,
        /// delete a MSBuildLogsExtended.DataSourceEntities.BuildLog.
        /// </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.IBuildLogServiceAsyn _Instance = MSBuildLogsExtended.WcfContracts.WcfServiceResolverAsyn.ResolveWcfServiceBuildLog();

            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_CurrentInEditingDefault);
#endif

                MSBuildLogsExtended.CommonBLLEntities.BuildLogRequestMessageBuiltIn _Request = new MSBuildLogsExtended.CommonBLLEntities.BuildLogRequestMessageBuiltIn()
                {
                    Critieria = new MSBuildLogsExtended.DataSourceEntities.BuildLogCollection(),
                    BusinessLogicLayerRequestID    = Guid.NewGuid().ToString(),
                    BusinessLogicLayerRequestTypes = Framework.CommonBLLEntities.BusinessLogicLayerRequestTypes.Delete,
                };
                _Request.Critieria.Add(MSBuildLogsExtended.EntityContracts.IBuildLogHelper.Clone <MSBuildLogsExtended.DataSourceEntities.BuildLog.Default, MSBuildLogsExtended.DataSourceEntities.BuildLog>(this.m_CurrentDefault));
                _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.IoCBuildLog.DeleteEntity(this.m_CurrentDefault);//
             * this.m_EntityCollectionDefault.Remove(this.m_CurrentDefault);
             */

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