コード例 #1
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            //if (_revisionTypeId == 6) //Contract Draft
            //{
            //    BusyIndicator1.IsBusy = true;
            //    BusyIndicator1.BusyContent = "Creating Contract Draft...";

            //    _mrsClient.CreateContractDraftCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(mrsClient_CreateContractDraftCompleted);
            //    _mrsClient.CreateContractDraftAsync(_estimateRevisionId, (App.Current as App).CurrentUserId);
            //}
            //else if (_revisionTypeId == 13) //Final Contract
            //{
            //    BusyIndicator1.IsBusy = true;
            //    BusyIndicator1.BusyContent = "Creating Final Contract...";

            //    _mrsClient.CreateFinalContractCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(mrsClient_CreateFinalContractCompleted);
            //    _mrsClient.CreateFinalContractAsync(_estimateRevisionId, (App.Current as App).CurrentUserId);
            //}
            if (_revisionTypeId == 14)
            {
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "Creating Pre Site Variation...";

                _mrsClient.CreateVariationCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(_mrsClient_CreateVariationCompleted);
                _mrsClient.CreateVariationAsync(_estimateRevisionId, _revisionTypeId, (App.Current as App).CurrentUserId);
            }
            else if (_revisionTypeId == 18)
            {
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "Creating Building Variation...";

                _mrsClient.CreateVariationCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(_mrsClient_CreateVariationCompleted);
                _mrsClient.CreateVariationAsync(_estimateRevisionId, _revisionTypeId, (App.Current as App).CurrentUserId);
            }
            else if (_revisionTypeId == 5)
            {
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "Creating Customer Support Coordinator Revision...";

                _mrsClient.CreateCscVariationCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(_mrsClient_CreateCscVariationCompleted);
                _mrsClient.CreateCscVariationAsync(_estimateRevisionId, (App.Current as App).CurrentUserId);
            }
            else if (_revisionTypeId == 24)
            {
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "Creating Pre Site Variation...";

                _mrsClient.CreateVariationCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(_mrsClient_CreateVariationCompleted);
                _mrsClient.CreateVariationAsync(_estimateRevisionId, _revisionTypeId, (App.Current as App).CurrentUserId);
            }
            else if (_revisionTypeId == 0) //Skip Studio M revisions
            {
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "Creating After Studio M Variation...";

                _mrsClient.CreateVariationCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(_mrsClient_CreateVariationCompleted);
                _mrsClient.CreateVariationAsync(_estimateRevisionId, 23, (App.Current as App).CurrentUserId);
            }
            else if (_revisionTypeId == 23)
            {
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "Merging Studio M Revisions...";

                _mrsClient.MergeStudioMRevisionsCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(_mrsClient_MergeStudioMRevisionsCompleted);
                _mrsClient.MergeStudioMRevisionsAsync(_estimateRevisionId, (App.Current as App).CurrentUserId);
            }
        }