Beispiel #1
0
        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            string detailIDsSelected    = string.Empty;
            string detailOptionsSeleced = string.Empty;
            string detailPricesSeleced  = string.Empty;

            if (errorGrid.ItemsSource != null)
            {
                BusyIndicator1.IsBusy      = true;
                BusyIndicator1.BusyContent = "Changing Facade...";

                foreach (ValidationErrorMessage item in (ObservableCollection <ValidationErrorMessage>)errorGrid.ItemsSource)
                {
                    if (item.Reason == "0" && !item.CopyAsNSR)
                    {
                        continue;
                    }
                    detailIDsSelected    += item.PagID + ",";
                    detailOptionsSeleced += (item.CopyAsNSR ? "1" : item.QuantityUseCurrent ? "2" : item.QuantityUseNew ? "3" : item.PriceUseCurrent ? "4" : item.PriceUseNew ? "5" : "0") + ",";
                    detailPricesSeleced  += item.SellPrice + ",";
                }
                if (detailIDsSelected.Length > 0)
                {
                    detailIDsSelected = detailIDsSelected.Substring(0, detailIDsSelected.Length - 1);
                }
                if (detailOptionsSeleced.Length > 0)
                {
                    detailOptionsSeleced = detailOptionsSeleced.Substring(0, detailOptionsSeleced.Length - 1);
                }
                if (detailPricesSeleced.Length > 0)
                {
                    detailPricesSeleced = detailPricesSeleced.Substring(0, detailPricesSeleced.Length - 1);
                }
            }
            RetailSystemClient MRSclient = new RetailSystemClient();

            MRSclient.Endpoint.Address = new System.ServiceModel.EndpointAddress(Internal.Utilities.GetMetriconRetailSystemWcfClientEndpointUrl());

            MRSclient.ChangeFacadeCompleted += new EventHandler <ChangeFacadeCompletedEventArgs>(mrsClient_ChangeFacadeCompleted);
            MRSclient.ChangeFacadeAsync(estimaterevisionid, selectedfacadehomeid, detailIDsSelected, detailOptionsSeleced, detailPricesSeleced, DateTime.Now.ToString("dd/MMM/yyyy"), (App.Current as App).CurrentUserId);
        }