//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This code was auto-generated by Microsoft.Silverlight.ServiceReference, version 4.0.50401.0
// 
namespace Factories.FactoriesService {
    using System.Runtime.Serialization;
    
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="DataBase", Namespace="http://tempuri.org/")]
    public partial class DataBase : object, System.ComponentModel.INotifyPropertyChanged {
        
        private System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Factory> FactoriesField;
        
        private System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Office> OfficesField;
        
        private System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Store> StoresField;
        
        private System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Product> ProductsField;
        
        private double OfficeStoreDistanceField;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Factory> Factories {
            get {
                return this.FactoriesField;
            }
            set {
                if ((object.ReferenceEquals(this.FactoriesField, value) != true)) {
                    this.FactoriesField = value;
                    this.RaisePropertyChanged("Factories");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Office> Offices {
            get {
                return this.OfficesField;
            }
            set {
                if ((object.ReferenceEquals(this.OfficesField, value) != true)) {
                    this.OfficesField = value;
                    this.RaisePropertyChanged("Offices");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Store> Stores {
            get {
                return this.StoresField;
            }
            set {
                if ((object.ReferenceEquals(this.StoresField, value) != true)) {
                    this.StoresField = value;
                    this.RaisePropertyChanged("Stores");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=3)]
        public System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Product> Products {
            get {
                return this.ProductsField;
            }
            set {
                if ((object.ReferenceEquals(this.ProductsField, value) != true)) {
                    this.ProductsField = value;
                    this.RaisePropertyChanged("Products");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true, Order=4)]
        public double OfficeStoreDistance {
            get {
                return this.OfficeStoreDistanceField;
            }
            set {
                if ((this.OfficeStoreDistanceField.Equals(value) != true)) {
                    this.OfficeStoreDistanceField = value;
                    this.RaisePropertyChanged("OfficeStoreDistance");
                }
            }
        }
        
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        
        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="Factory", Namespace="http://tempuri.org/")]
    public partial class Factory : Factories.FactoriesService.Entity {
        
        private double CapacityField;
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public double Capacity {
            get {
                return this.CapacityField;
            }
            set {
                if ((this.CapacityField.Equals(value) != true)) {
                    this.CapacityField = value;
                    this.RaisePropertyChanged("Capacity");
                }
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="Office", Namespace="http://tempuri.org/")]
    public partial class Office : Factories.FactoriesService.Entity {
        
        private string ManagerField;
        
        private int StoresField;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public string Manager {
            get {
                return this.ManagerField;
            }
            set {
                if ((object.ReferenceEquals(this.ManagerField, value) != true)) {
                    this.ManagerField = value;
                    this.RaisePropertyChanged("Manager");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public int Stores {
            get {
                return this.StoresField;
            }
            set {
                if ((this.StoresField.Equals(value) != true)) {
                    this.StoresField = value;
                    this.RaisePropertyChanged("Stores");
                }
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="Store", Namespace="http://tempuri.org/")]
    public partial class Store : Factories.FactoriesService.Entity {
        
        private System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.ProductSale> SalesField;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.ProductSale> Sales {
            get {
                return this.SalesField;
            }
            set {
                if ((object.ReferenceEquals(this.SalesField, value) != true)) {
                    this.SalesField = value;
                    this.RaisePropertyChanged("Sales");
                }
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="Product", Namespace="http://tempuri.org/")]
    public partial class Product : object, System.ComponentModel.INotifyPropertyChanged {
        
        private string NameField;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public string Name {
            get {
                return this.NameField;
            }
            set {
                if ((object.ReferenceEquals(this.NameField, value) != true)) {
                    this.NameField = value;
                    this.RaisePropertyChanged("Name");
                }
            }
        }
        
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        
        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="Entity", Namespace="http://tempuri.org/")]
    [System.Runtime.Serialization.KnownTypeAttribute(typeof(Factories.FactoriesService.Store))]
    [System.Runtime.Serialization.KnownTypeAttribute(typeof(Factories.FactoriesService.Office))]
    [System.Runtime.Serialization.KnownTypeAttribute(typeof(Factories.FactoriesService.Factory))]
    public partial class Entity : object, System.ComponentModel.INotifyPropertyChanged {
        
        private string NameField;
        
        private double LatitudeField;
        
        private double LongitudeField;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public string Name {
            get {
                return this.NameField;
            }
            set {
                if ((object.ReferenceEquals(this.NameField, value) != true)) {
                    this.NameField = value;
                    this.RaisePropertyChanged("Name");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true, Order=1)]
        public double Latitude {
            get {
                return this.LatitudeField;
            }
            set {
                if ((this.LatitudeField.Equals(value) != true)) {
                    this.LatitudeField = value;
                    this.RaisePropertyChanged("Latitude");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true, Order=2)]
        public double Longitude {
            get {
                return this.LongitudeField;
            }
            set {
                if ((this.LongitudeField.Equals(value) != true)) {
                    this.LongitudeField = value;
                    this.RaisePropertyChanged("Longitude");
                }
            }
        }
        
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        
        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    [System.Runtime.Serialization.DataContractAttribute(Name="ProductSale", Namespace="http://tempuri.org/")]
    public partial class ProductSale : object, System.ComponentModel.INotifyPropertyChanged {
        
        private Factories.FactoriesService.Product ProductField;
        
        private int SalesField;
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)]
        public Factories.FactoriesService.Product Product {
            get {
                return this.ProductField;
            }
            set {
                if ((object.ReferenceEquals(this.ProductField, value) != true)) {
                    this.ProductField = value;
                    this.RaisePropertyChanged("Product");
                }
            }
        }
        
        [System.Runtime.Serialization.DataMemberAttribute(IsRequired=true)]
        public int Sales {
            get {
                return this.SalesField;
            }
            set {
                if ((this.SalesField.Equals(value) != true)) {
                    this.SalesField = value;
                    this.RaisePropertyChanged("Sales");
                }
            }
        }
        
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        
        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="FactoriesService.FactoriesServiceSoap")]
    public interface FactoriesServiceSoap {
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/MergeDataBase", ReplyAction="*")]
        System.IAsyncResult BeginMergeDataBase(Factories.FactoriesService.MergeDataBaseRequest request, System.AsyncCallback callback, object asyncState);
        
        Factories.FactoriesService.MergeDataBaseResponse EndMergeDataBase(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/GetFactoriesAndOffices", ReplyAction="*")]
        System.IAsyncResult BeginGetFactoriesAndOffices(Factories.FactoriesService.GetFactoriesAndOfficesRequest request, System.AsyncCallback callback, object asyncState);
        
        Factories.FactoriesService.GetFactoriesAndOfficesResponse EndGetFactoriesAndOffices(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/GetStores", ReplyAction="*")]
        System.IAsyncResult BeginGetStores(Factories.FactoriesService.GetStoresRequest request, System.AsyncCallback callback, object asyncState);
        
        Factories.FactoriesService.GetStoresResponse EndGetStores(System.IAsyncResult result);
        
        [System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/GetLocationName", ReplyAction="*")]
        System.IAsyncResult BeginGetLocationName(Factories.FactoriesService.GetLocationNameRequest request, System.AsyncCallback callback, object asyncState);
        
        Factories.FactoriesService.GetLocationNameResponse EndGetLocationName(System.IAsyncResult result);
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class MergeDataBaseRequest {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="MergeDataBase", Namespace="http://tempuri.org/", Order=0)]
        public Factories.FactoriesService.MergeDataBaseRequestBody Body;
        
        public MergeDataBaseRequest() {
        }
        
        public MergeDataBaseRequest(Factories.FactoriesService.MergeDataBaseRequestBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class MergeDataBaseRequestBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)]
        public Factories.FactoriesService.DataBase clientDataBase;
        
        public MergeDataBaseRequestBody() {
        }
        
        public MergeDataBaseRequestBody(Factories.FactoriesService.DataBase clientDataBase) {
            this.clientDataBase = clientDataBase;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class MergeDataBaseResponse {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="MergeDataBaseResponse", Namespace="http://tempuri.org/", Order=0)]
        public Factories.FactoriesService.MergeDataBaseResponseBody Body;
        
        public MergeDataBaseResponse() {
        }
        
        public MergeDataBaseResponse(Factories.FactoriesService.MergeDataBaseResponseBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute()]
    public partial class MergeDataBaseResponseBody {
        
        public MergeDataBaseResponseBody() {
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetFactoriesAndOfficesRequest {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetFactoriesAndOffices", Namespace="http://tempuri.org/", Order=0)]
        public Factories.FactoriesService.GetFactoriesAndOfficesRequestBody Body;
        
        public GetFactoriesAndOfficesRequest() {
        }
        
        public GetFactoriesAndOfficesRequest(Factories.FactoriesService.GetFactoriesAndOfficesRequestBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute()]
    public partial class GetFactoriesAndOfficesRequestBody {
        
        public GetFactoriesAndOfficesRequestBody() {
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetFactoriesAndOfficesResponse {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetFactoriesAndOfficesResponse", Namespace="http://tempuri.org/", Order=0)]
        public Factories.FactoriesService.GetFactoriesAndOfficesResponseBody Body;
        
        public GetFactoriesAndOfficesResponse() {
        }
        
        public GetFactoriesAndOfficesResponse(Factories.FactoriesService.GetFactoriesAndOfficesResponseBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class GetFactoriesAndOfficesResponseBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)]
        public Factories.FactoriesService.DataBase GetFactoriesAndOfficesResult;
        
        public GetFactoriesAndOfficesResponseBody() {
        }
        
        public GetFactoriesAndOfficesResponseBody(Factories.FactoriesService.DataBase GetFactoriesAndOfficesResult) {
            this.GetFactoriesAndOfficesResult = GetFactoriesAndOfficesResult;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetStoresRequest {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetStores", Namespace="http://tempuri.org/", Order=0)]
        public Factories.FactoriesService.GetStoresRequestBody Body;
        
        public GetStoresRequest() {
        }
        
        public GetStoresRequest(Factories.FactoriesService.GetStoresRequestBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class GetStoresRequestBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=0)]
        public double lowerLeftLat;
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=1)]
        public double lowerLeftLong;
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=2)]
        public double upperRightLat;
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=3)]
        public double upperRightLong;
        
        public GetStoresRequestBody() {
        }
        
        public GetStoresRequestBody(double lowerLeftLat, double lowerLeftLong, double upperRightLat, double upperRightLong) {
            this.lowerLeftLat = lowerLeftLat;
            this.lowerLeftLong = lowerLeftLong;
            this.upperRightLat = upperRightLat;
            this.upperRightLong = upperRightLong;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetStoresResponse {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetStoresResponse", Namespace="http://tempuri.org/", Order=0)]
        public Factories.FactoriesService.GetStoresResponseBody Body;
        
        public GetStoresResponse() {
        }
        
        public GetStoresResponse(Factories.FactoriesService.GetStoresResponseBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class GetStoresResponseBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)]
        public System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Store> GetStoresResult;
        
        public GetStoresResponseBody() {
        }
        
        public GetStoresResponseBody(System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Store> GetStoresResult) {
            this.GetStoresResult = GetStoresResult;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetLocationNameRequest {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetLocationName", Namespace="http://tempuri.org/", Order=0)]
        public Factories.FactoriesService.GetLocationNameRequestBody Body;
        
        public GetLocationNameRequest() {
        }
        
        public GetLocationNameRequest(Factories.FactoriesService.GetLocationNameRequestBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class GetLocationNameRequestBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=0)]
        public double latitude;
        
        [System.Runtime.Serialization.DataMemberAttribute(Order=1)]
        public double longitude;
        
        public GetLocationNameRequestBody() {
        }
        
        public GetLocationNameRequestBody(double latitude, double longitude) {
            this.latitude = latitude;
            this.longitude = longitude;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.ServiceModel.MessageContractAttribute(IsWrapped=false)]
    public partial class GetLocationNameResponse {
        
        [System.ServiceModel.MessageBodyMemberAttribute(Name="GetLocationNameResponse", Namespace="http://tempuri.org/", Order=0)]
        public Factories.FactoriesService.GetLocationNameResponseBody Body;
        
        public GetLocationNameResponse() {
        }
        
        public GetLocationNameResponse(Factories.FactoriesService.GetLocationNameResponseBody Body) {
            this.Body = Body;
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
    [System.Runtime.Serialization.DataContractAttribute(Namespace="http://tempuri.org/")]
    public partial class GetLocationNameResponseBody {
        
        [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=0)]
        public string GetLocationNameResult;
        
        public GetLocationNameResponseBody() {
        }
        
        public GetLocationNameResponseBody(string GetLocationNameResult) {
            this.GetLocationNameResult = GetLocationNameResult;
        }
    }
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface FactoriesServiceSoapChannel : Factories.FactoriesService.FactoriesServiceSoap, System.ServiceModel.IClientChannel {
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetFactoriesAndOfficesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetFactoriesAndOfficesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public Factories.FactoriesService.DataBase Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((Factories.FactoriesService.DataBase)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetStoresCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetStoresCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Store> Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Store>)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class GetLocationNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        public GetLocationNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        public string Result {
            get {
                base.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
    
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class FactoriesServiceSoapClient : System.ServiceModel.ClientBase<Factories.FactoriesService.FactoriesServiceSoap>, Factories.FactoriesService.FactoriesServiceSoap {
        
        private BeginOperationDelegate onBeginMergeDataBaseDelegate;
        
        private EndOperationDelegate onEndMergeDataBaseDelegate;
        
        private System.Threading.SendOrPostCallback onMergeDataBaseCompletedDelegate;
        
        private BeginOperationDelegate onBeginGetFactoriesAndOfficesDelegate;
        
        private EndOperationDelegate onEndGetFactoriesAndOfficesDelegate;
        
        private System.Threading.SendOrPostCallback onGetFactoriesAndOfficesCompletedDelegate;
        
        private BeginOperationDelegate onBeginGetStoresDelegate;
        
        private EndOperationDelegate onEndGetStoresDelegate;
        
        private System.Threading.SendOrPostCallback onGetStoresCompletedDelegate;
        
        private BeginOperationDelegate onBeginGetLocationNameDelegate;
        
        private EndOperationDelegate onEndGetLocationNameDelegate;
        
        private System.Threading.SendOrPostCallback onGetLocationNameCompletedDelegate;
        
        private BeginOperationDelegate onBeginOpenDelegate;
        
        private EndOperationDelegate onEndOpenDelegate;
        
        private System.Threading.SendOrPostCallback onOpenCompletedDelegate;
        
        private BeginOperationDelegate onBeginCloseDelegate;
        
        private EndOperationDelegate onEndCloseDelegate;
        
        private System.Threading.SendOrPostCallback onCloseCompletedDelegate;
        
        public FactoriesServiceSoapClient() {
        }
        
        public FactoriesServiceSoapClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public FactoriesServiceSoapClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public FactoriesServiceSoapClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public FactoriesServiceSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }
        
        public System.Net.CookieContainer CookieContainer {
            get {
                System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
                if ((httpCookieContainerManager != null)) {
                    return httpCookieContainerManager.CookieContainer;
                }
                else {
                    return null;
                }
            }
            set {
                System.ServiceModel.Channels.IHttpCookieContainerManager httpCookieContainerManager = this.InnerChannel.GetProperty<System.ServiceModel.Channels.IHttpCookieContainerManager>();
                if ((httpCookieContainerManager != null)) {
                    httpCookieContainerManager.CookieContainer = value;
                }
                else {
                    throw new System.InvalidOperationException("Unable to set the CookieContainer. Please make sure the binding contains an HttpC" +
                            "ookieContainerBindingElement.");
                }
            }
        }
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> MergeDataBaseCompleted;
        
        public event System.EventHandler<GetFactoriesAndOfficesCompletedEventArgs> GetFactoriesAndOfficesCompleted;
        
        public event System.EventHandler<GetStoresCompletedEventArgs> GetStoresCompleted;
        
        public event System.EventHandler<GetLocationNameCompletedEventArgs> GetLocationNameCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> OpenCompleted;
        
        public event System.EventHandler<System.ComponentModel.AsyncCompletedEventArgs> CloseCompleted;
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult Factories.FactoriesService.FactoriesServiceSoap.BeginMergeDataBase(Factories.FactoriesService.MergeDataBaseRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginMergeDataBase(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.IAsyncResult BeginMergeDataBase(Factories.FactoriesService.DataBase clientDataBase, System.AsyncCallback callback, object asyncState) {
            Factories.FactoriesService.MergeDataBaseRequest inValue = new Factories.FactoriesService.MergeDataBaseRequest();
            inValue.Body = new Factories.FactoriesService.MergeDataBaseRequestBody();
            inValue.Body.clientDataBase = clientDataBase;
            return ((Factories.FactoriesService.FactoriesServiceSoap)(this)).BeginMergeDataBase(inValue, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        Factories.FactoriesService.MergeDataBaseResponse Factories.FactoriesService.FactoriesServiceSoap.EndMergeDataBase(System.IAsyncResult result) {
            return base.Channel.EndMergeDataBase(result);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private void EndMergeDataBase(System.IAsyncResult result) {
            Factories.FactoriesService.MergeDataBaseResponse retVal = ((Factories.FactoriesService.FactoriesServiceSoap)(this)).EndMergeDataBase(result);
        }
        
        private System.IAsyncResult OnBeginMergeDataBase(object[] inValues, System.AsyncCallback callback, object asyncState) {
            Factories.FactoriesService.DataBase clientDataBase = ((Factories.FactoriesService.DataBase)(inValues[0]));
            return this.BeginMergeDataBase(clientDataBase, callback, asyncState);
        }
        
        private object[] OnEndMergeDataBase(System.IAsyncResult result) {
            this.EndMergeDataBase(result);
            return null;
        }
        
        private void OnMergeDataBaseCompleted(object state) {
            if ((this.MergeDataBaseCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.MergeDataBaseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void MergeDataBaseAsync(Factories.FactoriesService.DataBase clientDataBase) {
            this.MergeDataBaseAsync(clientDataBase, null);
        }
        
        public void MergeDataBaseAsync(Factories.FactoriesService.DataBase clientDataBase, object userState) {
            if ((this.onBeginMergeDataBaseDelegate == null)) {
                this.onBeginMergeDataBaseDelegate = new BeginOperationDelegate(this.OnBeginMergeDataBase);
            }
            if ((this.onEndMergeDataBaseDelegate == null)) {
                this.onEndMergeDataBaseDelegate = new EndOperationDelegate(this.OnEndMergeDataBase);
            }
            if ((this.onMergeDataBaseCompletedDelegate == null)) {
                this.onMergeDataBaseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnMergeDataBaseCompleted);
            }
            base.InvokeAsync(this.onBeginMergeDataBaseDelegate, new object[] {
                        clientDataBase}, this.onEndMergeDataBaseDelegate, this.onMergeDataBaseCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult Factories.FactoriesService.FactoriesServiceSoap.BeginGetFactoriesAndOffices(Factories.FactoriesService.GetFactoriesAndOfficesRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetFactoriesAndOffices(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.IAsyncResult BeginGetFactoriesAndOffices(System.AsyncCallback callback, object asyncState) {
            Factories.FactoriesService.GetFactoriesAndOfficesRequest inValue = new Factories.FactoriesService.GetFactoriesAndOfficesRequest();
            inValue.Body = new Factories.FactoriesService.GetFactoriesAndOfficesRequestBody();
            return ((Factories.FactoriesService.FactoriesServiceSoap)(this)).BeginGetFactoriesAndOffices(inValue, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        Factories.FactoriesService.GetFactoriesAndOfficesResponse Factories.FactoriesService.FactoriesServiceSoap.EndGetFactoriesAndOffices(System.IAsyncResult result) {
            return base.Channel.EndGetFactoriesAndOffices(result);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private Factories.FactoriesService.DataBase EndGetFactoriesAndOffices(System.IAsyncResult result) {
            Factories.FactoriesService.GetFactoriesAndOfficesResponse retVal = ((Factories.FactoriesService.FactoriesServiceSoap)(this)).EndGetFactoriesAndOffices(result);
            return retVal.Body.GetFactoriesAndOfficesResult;
        }
        
        private System.IAsyncResult OnBeginGetFactoriesAndOffices(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return this.BeginGetFactoriesAndOffices(callback, asyncState);
        }
        
        private object[] OnEndGetFactoriesAndOffices(System.IAsyncResult result) {
            Factories.FactoriesService.DataBase retVal = this.EndGetFactoriesAndOffices(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetFactoriesAndOfficesCompleted(object state) {
            if ((this.GetFactoriesAndOfficesCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetFactoriesAndOfficesCompleted(this, new GetFactoriesAndOfficesCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetFactoriesAndOfficesAsync() {
            this.GetFactoriesAndOfficesAsync(null);
        }
        
        public void GetFactoriesAndOfficesAsync(object userState) {
            if ((this.onBeginGetFactoriesAndOfficesDelegate == null)) {
                this.onBeginGetFactoriesAndOfficesDelegate = new BeginOperationDelegate(this.OnBeginGetFactoriesAndOffices);
            }
            if ((this.onEndGetFactoriesAndOfficesDelegate == null)) {
                this.onEndGetFactoriesAndOfficesDelegate = new EndOperationDelegate(this.OnEndGetFactoriesAndOffices);
            }
            if ((this.onGetFactoriesAndOfficesCompletedDelegate == null)) {
                this.onGetFactoriesAndOfficesCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetFactoriesAndOfficesCompleted);
            }
            base.InvokeAsync(this.onBeginGetFactoriesAndOfficesDelegate, null, this.onEndGetFactoriesAndOfficesDelegate, this.onGetFactoriesAndOfficesCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult Factories.FactoriesService.FactoriesServiceSoap.BeginGetStores(Factories.FactoriesService.GetStoresRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetStores(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.IAsyncResult BeginGetStores(double lowerLeftLat, double lowerLeftLong, double upperRightLat, double upperRightLong, System.AsyncCallback callback, object asyncState) {
            Factories.FactoriesService.GetStoresRequest inValue = new Factories.FactoriesService.GetStoresRequest();
            inValue.Body = new Factories.FactoriesService.GetStoresRequestBody();
            inValue.Body.lowerLeftLat = lowerLeftLat;
            inValue.Body.lowerLeftLong = lowerLeftLong;
            inValue.Body.upperRightLat = upperRightLat;
            inValue.Body.upperRightLong = upperRightLong;
            return ((Factories.FactoriesService.FactoriesServiceSoap)(this)).BeginGetStores(inValue, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        Factories.FactoriesService.GetStoresResponse Factories.FactoriesService.FactoriesServiceSoap.EndGetStores(System.IAsyncResult result) {
            return base.Channel.EndGetStores(result);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Store> EndGetStores(System.IAsyncResult result) {
            Factories.FactoriesService.GetStoresResponse retVal = ((Factories.FactoriesService.FactoriesServiceSoap)(this)).EndGetStores(result);
            return retVal.Body.GetStoresResult;
        }
        
        private System.IAsyncResult OnBeginGetStores(object[] inValues, System.AsyncCallback callback, object asyncState) {
            double lowerLeftLat = ((double)(inValues[0]));
            double lowerLeftLong = ((double)(inValues[1]));
            double upperRightLat = ((double)(inValues[2]));
            double upperRightLong = ((double)(inValues[3]));
            return this.BeginGetStores(lowerLeftLat, lowerLeftLong, upperRightLat, upperRightLong, callback, asyncState);
        }
        
        private object[] OnEndGetStores(System.IAsyncResult result) {
            System.Collections.ObjectModel.ObservableCollection<Factories.FactoriesService.Store> retVal = this.EndGetStores(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetStoresCompleted(object state) {
            if ((this.GetStoresCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetStoresCompleted(this, new GetStoresCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetStoresAsync(double lowerLeftLat, double lowerLeftLong, double upperRightLat, double upperRightLong) {
            this.GetStoresAsync(lowerLeftLat, lowerLeftLong, upperRightLat, upperRightLong, null);
        }
        
        public void GetStoresAsync(double lowerLeftLat, double lowerLeftLong, double upperRightLat, double upperRightLong, object userState) {
            if ((this.onBeginGetStoresDelegate == null)) {
                this.onBeginGetStoresDelegate = new BeginOperationDelegate(this.OnBeginGetStores);
            }
            if ((this.onEndGetStoresDelegate == null)) {
                this.onEndGetStoresDelegate = new EndOperationDelegate(this.OnEndGetStores);
            }
            if ((this.onGetStoresCompletedDelegate == null)) {
                this.onGetStoresCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetStoresCompleted);
            }
            base.InvokeAsync(this.onBeginGetStoresDelegate, new object[] {
                        lowerLeftLat,
                        lowerLeftLong,
                        upperRightLat,
                        upperRightLong}, this.onEndGetStoresDelegate, this.onGetStoresCompletedDelegate, userState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        System.IAsyncResult Factories.FactoriesService.FactoriesServiceSoap.BeginGetLocationName(Factories.FactoriesService.GetLocationNameRequest request, System.AsyncCallback callback, object asyncState) {
            return base.Channel.BeginGetLocationName(request, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private System.IAsyncResult BeginGetLocationName(double latitude, double longitude, System.AsyncCallback callback, object asyncState) {
            Factories.FactoriesService.GetLocationNameRequest inValue = new Factories.FactoriesService.GetLocationNameRequest();
            inValue.Body = new Factories.FactoriesService.GetLocationNameRequestBody();
            inValue.Body.latitude = latitude;
            inValue.Body.longitude = longitude;
            return ((Factories.FactoriesService.FactoriesServiceSoap)(this)).BeginGetLocationName(inValue, callback, asyncState);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        Factories.FactoriesService.GetLocationNameResponse Factories.FactoriesService.FactoriesServiceSoap.EndGetLocationName(System.IAsyncResult result) {
            return base.Channel.EndGetLocationName(result);
        }
        
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
        private string EndGetLocationName(System.IAsyncResult result) {
            Factories.FactoriesService.GetLocationNameResponse retVal = ((Factories.FactoriesService.FactoriesServiceSoap)(this)).EndGetLocationName(result);
            return retVal.Body.GetLocationNameResult;
        }
        
        private System.IAsyncResult OnBeginGetLocationName(object[] inValues, System.AsyncCallback callback, object asyncState) {
            double latitude = ((double)(inValues[0]));
            double longitude = ((double)(inValues[1]));
            return this.BeginGetLocationName(latitude, longitude, callback, asyncState);
        }
        
        private object[] OnEndGetLocationName(System.IAsyncResult result) {
            string retVal = this.EndGetLocationName(result);
            return new object[] {
                    retVal};
        }
        
        private void OnGetLocationNameCompleted(object state) {
            if ((this.GetLocationNameCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.GetLocationNameCompleted(this, new GetLocationNameCompletedEventArgs(e.Results, e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void GetLocationNameAsync(double latitude, double longitude) {
            this.GetLocationNameAsync(latitude, longitude, null);
        }
        
        public void GetLocationNameAsync(double latitude, double longitude, object userState) {
            if ((this.onBeginGetLocationNameDelegate == null)) {
                this.onBeginGetLocationNameDelegate = new BeginOperationDelegate(this.OnBeginGetLocationName);
            }
            if ((this.onEndGetLocationNameDelegate == null)) {
                this.onEndGetLocationNameDelegate = new EndOperationDelegate(this.OnEndGetLocationName);
            }
            if ((this.onGetLocationNameCompletedDelegate == null)) {
                this.onGetLocationNameCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnGetLocationNameCompleted);
            }
            base.InvokeAsync(this.onBeginGetLocationNameDelegate, new object[] {
                        latitude,
                        longitude}, this.onEndGetLocationNameDelegate, this.onGetLocationNameCompletedDelegate, userState);
        }
        
        private System.IAsyncResult OnBeginOpen(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(callback, asyncState);
        }
        
        private object[] OnEndOpen(System.IAsyncResult result) {
            ((System.ServiceModel.ICommunicationObject)(this)).EndOpen(result);
            return null;
        }
        
        private void OnOpenCompleted(object state) {
            if ((this.OpenCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.OpenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void OpenAsync() {
            this.OpenAsync(null);
        }
        
        public void OpenAsync(object userState) {
            if ((this.onBeginOpenDelegate == null)) {
                this.onBeginOpenDelegate = new BeginOperationDelegate(this.OnBeginOpen);
            }
            if ((this.onEndOpenDelegate == null)) {
                this.onEndOpenDelegate = new EndOperationDelegate(this.OnEndOpen);
            }
            if ((this.onOpenCompletedDelegate == null)) {
                this.onOpenCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnOpenCompleted);
            }
            base.InvokeAsync(this.onBeginOpenDelegate, null, this.onEndOpenDelegate, this.onOpenCompletedDelegate, userState);
        }
        
        private System.IAsyncResult OnBeginClose(object[] inValues, System.AsyncCallback callback, object asyncState) {
            return ((System.ServiceModel.ICommunicationObject)(this)).BeginClose(callback, asyncState);
        }
        
        private object[] OnEndClose(System.IAsyncResult result) {
            ((System.ServiceModel.ICommunicationObject)(this)).EndClose(result);
            return null;
        }
        
        private void OnCloseCompleted(object state) {
            if ((this.CloseCompleted != null)) {
                InvokeAsyncCompletedEventArgs e = ((InvokeAsyncCompletedEventArgs)(state));
                this.CloseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState));
            }
        }
        
        public void CloseAsync() {
            this.CloseAsync(null);
        }
        
        public void CloseAsync(object userState) {
            if ((this.onBeginCloseDelegate == null)) {
                this.onBeginCloseDelegate = new BeginOperationDelegate(this.OnBeginClose);
            }
            if ((this.onEndCloseDelegate == null)) {
                this.onEndCloseDelegate = new EndOperationDelegate(this.OnEndClose);
            }
            if ((this.onCloseCompletedDelegate == null)) {
                this.onCloseCompletedDelegate = new System.Threading.SendOrPostCallback(this.OnCloseCompleted);
            }
            base.InvokeAsync(this.onBeginCloseDelegate, null, this.onEndCloseDelegate, this.onCloseCompletedDelegate, userState);
        }
        
        protected override Factories.FactoriesService.FactoriesServiceSoap CreateChannel() {
            return new FactoriesServiceSoapClientChannel(this);
        }
        
        private class FactoriesServiceSoapClientChannel : ChannelBase<Factories.FactoriesService.FactoriesServiceSoap>, Factories.FactoriesService.FactoriesServiceSoap {
            
            public FactoriesServiceSoapClientChannel(System.ServiceModel.ClientBase<Factories.FactoriesService.FactoriesServiceSoap> client) : 
                    base(client) {
            }
            
            public System.IAsyncResult BeginMergeDataBase(Factories.FactoriesService.MergeDataBaseRequest request, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = request;
                System.IAsyncResult _result = base.BeginInvoke("MergeDataBase", _args, callback, asyncState);
                return _result;
            }
            
            public Factories.FactoriesService.MergeDataBaseResponse EndMergeDataBase(System.IAsyncResult result) {
                object[] _args = new object[0];
                Factories.FactoriesService.MergeDataBaseResponse _result = ((Factories.FactoriesService.MergeDataBaseResponse)(base.EndInvoke("MergeDataBase", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginGetFactoriesAndOffices(Factories.FactoriesService.GetFactoriesAndOfficesRequest request, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = request;
                System.IAsyncResult _result = base.BeginInvoke("GetFactoriesAndOffices", _args, callback, asyncState);
                return _result;
            }
            
            public Factories.FactoriesService.GetFactoriesAndOfficesResponse EndGetFactoriesAndOffices(System.IAsyncResult result) {
                object[] _args = new object[0];
                Factories.FactoriesService.GetFactoriesAndOfficesResponse _result = ((Factories.FactoriesService.GetFactoriesAndOfficesResponse)(base.EndInvoke("GetFactoriesAndOffices", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginGetStores(Factories.FactoriesService.GetStoresRequest request, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = request;
                System.IAsyncResult _result = base.BeginInvoke("GetStores", _args, callback, asyncState);
                return _result;
            }
            
            public Factories.FactoriesService.GetStoresResponse EndGetStores(System.IAsyncResult result) {
                object[] _args = new object[0];
                Factories.FactoriesService.GetStoresResponse _result = ((Factories.FactoriesService.GetStoresResponse)(base.EndInvoke("GetStores", _args, result)));
                return _result;
            }
            
            public System.IAsyncResult BeginGetLocationName(Factories.FactoriesService.GetLocationNameRequest request, System.AsyncCallback callback, object asyncState) {
                object[] _args = new object[1];
                _args[0] = request;
                System.IAsyncResult _result = base.BeginInvoke("GetLocationName", _args, callback, asyncState);
                return _result;
            }
            
            public Factories.FactoriesService.GetLocationNameResponse EndGetLocationName(System.IAsyncResult result) {
                object[] _args = new object[0];
                Factories.FactoriesService.GetLocationNameResponse _result = ((Factories.FactoriesService.GetLocationNameResponse)(base.EndInvoke("GetLocationName", _args, result)));
                return _result;
            }
        }
    }
}
