Ejemplo n.º 1
0
 public static MSBuildLogsExtended.WcfContracts.IBuildEventCodeServiceAsyn ResolveWcfServiceBuildEventCode()
 {
     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.IBuildEventCodeServiceAsyn     _BusinessLogicLayerInstance          = _IBusinessLogicLayerFactory.CreateBLLInstanceOfEntityBuildEventCode(_BusinessLogicLayerContext);
     return(_BusinessLogicLayerInstance);
 }
Ejemplo n.º 2
0
        public void GetDropDownContentsOfBuildEventCode_1()
        {
            MSBuildLogsExtended.WcfContracts.IBuildEventCodeServiceAsyn _Instance = MSBuildLogsExtended.WcfContracts.WcfServiceResolverAsyn.ResolveWcfServiceBuildEventCode();

            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.DropDownContentsOfBuildEventCode_1.Clear();
                        if (collection != null)
                        {
                            foreach (Framework.NameValuePair item in collection)
                            {
                                this.DropDownContentsOfBuildEventCode_1.Add(item);
                            }
                        }
                    });
                }
                catch (Exception ex)
                {
                }
            };

            try
            {
                MSBuildLogsExtended.CommonBLLEntities.BuildEventCodeRequestMessageUserDefinedOfAll _Request = new MSBuildLogsExtended.CommonBLLEntities.BuildEventCodeRequestMessageUserDefinedOfAll()
                {
                    Critieria                      = new MSBuildLogsExtended.CommonBLLEntities.BuildEventCodeChainedQueryCriteriaAll(),
                    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)
            {
            }
        }
Ejemplo n.º 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.IBuildEventCodeServiceAsyn _Instance = MSBuildLogsExtended.WcfContracts.WcfServiceResolverAsyn.ResolveWcfServiceBuildEventCode();

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

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

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

                        if (collection != null)
                        {
                            foreach (MSBuildLogsExtended.DataSourceEntities.BuildEventCode 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.BuildEventCodeRequestMessageUserDefinedOfCommon _Request = new MSBuildLogsExtended.CommonBLLEntities.BuildEventCodeRequestMessageUserDefinedOfCommon()
                {
                    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.BuildEventCode>();
             * }
             *
             * this.m_EntityCollection.Clear();
             *
             * MSBuildLogsExtended.DataSourceEntities.BuildEventCodeCollection collection = MSBuildLogsExtended.CommonBLLIoC.IoCBuildEventCode.GetCollectionOfEntityOfCommon(m_CriteriaOfGetCollectionOfEntityOfCommon, this.m_QueryPagingSetting, this.m_QueryOrderBySettingCollection);
             * if(collection != null)
             * {
             *  foreach (MSBuildLogsExtended.DataSourceEntities.BuildEventCode item in collection)
             *  {
             *      this.m_EntityCollection.Add(item);
             *  }
             * }
             */
            #endregion Syncronized wcf method call -- not in use/WPF only
        }
Ejemplo n.º 4
0
        /// <summary>,
        /// delete a MSBuildLogsExtended.DataSourceEntities.BuildEventCode.
        /// </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.IBuildEventCodeServiceAsyn _Instance = MSBuildLogsExtended.WcfContracts.WcfServiceResolverAsyn.ResolveWcfServiceBuildEventCode();

            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.BuildEventCodeRequestMessageBuiltIn _Request = new MSBuildLogsExtended.CommonBLLEntities.BuildEventCodeRequestMessageBuiltIn()
                {
                    Critieria = new MSBuildLogsExtended.DataSourceEntities.BuildEventCodeCollection(),
                    BusinessLogicLayerRequestID    = Guid.NewGuid().ToString(),
                    BusinessLogicLayerRequestTypes = Framework.CommonBLLEntities.BusinessLogicLayerRequestTypes.Delete,
                };
                _Request.Critieria.Add(MSBuildLogsExtended.EntityContracts.IBuildEventCodeHelper.Clone <MSBuildLogsExtended.DataSourceEntities.BuildEventCode, MSBuildLogsExtended.DataSourceEntities.BuildEventCode>(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.IoCBuildEventCode.DeleteEntity(this.m_Current);//
             * this.m_EntityCollection.Remove(this.m_Current);
             */

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