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

// 
// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50727.1433.
// 
#pragma warning disable 1591

namespace EQTrack.BlackhawkInvoiceService {
    using System.Diagnostics;
    using System.Web.Services;
    using System.ComponentModel;
    using System.Web.Services.Protocols;
    using System;
    using System.Xml.Serialization;
    using System.Data;
    
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name="InvoiceServiceSoap", Namespace="http://www.theblackhawk.co.nz/")]
    public partial class InvoiceService : System.Web.Services.Protocols.SoapHttpClientProtocol {
        
        private System.Threading.SendOrPostCallback GetInvoicesForDeviceSetOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetInvoicesGeneratedTodayOperationCompleted;
        
        private System.Threading.SendOrPostCallback GetInvoiceDetailsOperationCompleted;
        
        private System.Threading.SendOrPostCallback GenerateTodaysInvoicesOperationCompleted;
        
        private bool useDefaultCredentialsSetExplicitly;
        
        /// <remarks/>
        public InvoiceService() {
            this.Url = global::EQTrack.Properties.Settings.Default.BH_TOOLBOX_BlackhawkInvoiceService_InvoiceService;
            if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
                this.UseDefaultCredentials = true;
                this.useDefaultCredentialsSetExplicitly = false;
            }
            else {
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        public new string Url {
            get {
                return base.Url;
            }
            set {
                if ((((this.IsLocalFileSystemWebService(base.Url) == true) 
                            && (this.useDefaultCredentialsSetExplicitly == false)) 
                            && (this.IsLocalFileSystemWebService(value) == false))) {
                    base.UseDefaultCredentials = false;
                }
                base.Url = value;
            }
        }
        
        public new bool UseDefaultCredentials {
            get {
                return base.UseDefaultCredentials;
            }
            set {
                base.UseDefaultCredentials = value;
                this.useDefaultCredentialsSetExplicitly = true;
            }
        }
        
        /// <remarks/>
        public event GetInvoicesForDeviceSetCompletedEventHandler GetInvoicesForDeviceSetCompleted;
        
        /// <remarks/>
        public event GetInvoicesGeneratedTodayCompletedEventHandler GetInvoicesGeneratedTodayCompleted;
        
        /// <remarks/>
        public event GetInvoiceDetailsCompletedEventHandler GetInvoiceDetailsCompleted;
        
        /// <remarks/>
        public event GenerateTodaysInvoicesCompletedEventHandler GenerateTodaysInvoicesCompleted;
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/GetInvoicesForDeviceSet", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public System.Data.DataTable GetInvoicesForDeviceSet(int DeviceSet, string from) {
            object[] results = this.Invoke("GetInvoicesForDeviceSet", new object[] {
                        DeviceSet,
                        from});
            return ((System.Data.DataTable)(results[0]));
        }
        
        /// <remarks/>
        public void GetInvoicesForDeviceSetAsync(int DeviceSet, string from) {
            this.GetInvoicesForDeviceSetAsync(DeviceSet, from, null);
        }
        
        /// <remarks/>
        public void GetInvoicesForDeviceSetAsync(int DeviceSet, string from, object userState) {
            if ((this.GetInvoicesForDeviceSetOperationCompleted == null)) {
                this.GetInvoicesForDeviceSetOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetInvoicesForDeviceSetOperationCompleted);
            }
            this.InvokeAsync("GetInvoicesForDeviceSet", new object[] {
                        DeviceSet,
                        from}, this.GetInvoicesForDeviceSetOperationCompleted, userState);
        }
        
        private void OnGetInvoicesForDeviceSetOperationCompleted(object arg) {
            if ((this.GetInvoicesForDeviceSetCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetInvoicesForDeviceSetCompleted(this, new GetInvoicesForDeviceSetCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/GetInvoicesGeneratedToday", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public System.Data.DataTable GetInvoicesGeneratedToday() {
            object[] results = this.Invoke("GetInvoicesGeneratedToday", new object[0]);
            return ((System.Data.DataTable)(results[0]));
        }
        
        /// <remarks/>
        public void GetInvoicesGeneratedTodayAsync() {
            this.GetInvoicesGeneratedTodayAsync(null);
        }
        
        /// <remarks/>
        public void GetInvoicesGeneratedTodayAsync(object userState) {
            if ((this.GetInvoicesGeneratedTodayOperationCompleted == null)) {
                this.GetInvoicesGeneratedTodayOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetInvoicesGeneratedTodayOperationCompleted);
            }
            this.InvokeAsync("GetInvoicesGeneratedToday", new object[0], this.GetInvoicesGeneratedTodayOperationCompleted, userState);
        }
        
        private void OnGetInvoicesGeneratedTodayOperationCompleted(object arg) {
            if ((this.GetInvoicesGeneratedTodayCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetInvoicesGeneratedTodayCompleted(this, new GetInvoicesGeneratedTodayCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/GetInvoiceDetails", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public System.Data.DataTable GetInvoiceDetails(int invoice) {
            object[] results = this.Invoke("GetInvoiceDetails", new object[] {
                        invoice});
            return ((System.Data.DataTable)(results[0]));
        }
        
        /// <remarks/>
        public void GetInvoiceDetailsAsync(int invoice) {
            this.GetInvoiceDetailsAsync(invoice, null);
        }
        
        /// <remarks/>
        public void GetInvoiceDetailsAsync(int invoice, object userState) {
            if ((this.GetInvoiceDetailsOperationCompleted == null)) {
                this.GetInvoiceDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetInvoiceDetailsOperationCompleted);
            }
            this.InvokeAsync("GetInvoiceDetails", new object[] {
                        invoice}, this.GetInvoiceDetailsOperationCompleted, userState);
        }
        
        private void OnGetInvoiceDetailsOperationCompleted(object arg) {
            if ((this.GetInvoiceDetailsCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetInvoiceDetailsCompleted(this, new GetInvoiceDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.theblackhawk.co.nz/GenerateTodaysInvoices", RequestNamespace="http://www.theblackhawk.co.nz/", ResponseNamespace="http://www.theblackhawk.co.nz/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GenerateTodaysInvoices() {
            object[] results = this.Invoke("GenerateTodaysInvoices", new object[0]);
            return ((string)(results[0]));
        }
        
        /// <remarks/>
        public void GenerateTodaysInvoicesAsync() {
            this.GenerateTodaysInvoicesAsync(null);
        }
        
        /// <remarks/>
        public void GenerateTodaysInvoicesAsync(object userState) {
            if ((this.GenerateTodaysInvoicesOperationCompleted == null)) {
                this.GenerateTodaysInvoicesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGenerateTodaysInvoicesOperationCompleted);
            }
            this.InvokeAsync("GenerateTodaysInvoices", new object[0], this.GenerateTodaysInvoicesOperationCompleted, userState);
        }
        
        private void OnGenerateTodaysInvoicesOperationCompleted(object arg) {
            if ((this.GenerateTodaysInvoicesCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GenerateTodaysInvoicesCompleted(this, new GenerateTodaysInvoicesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }
        
        /// <remarks/>
        public new void CancelAsync(object userState) {
            base.CancelAsync(userState);
        }
        
        private bool IsLocalFileSystemWebService(string url) {
            if (((url == null) 
                        || (url == string.Empty))) {
                return false;
            }
            System.Uri wsUri = new System.Uri(url);
            if (((wsUri.Port >= 1024) 
                        && (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
                return true;
            }
            return false;
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void GetInvoicesForDeviceSetCompletedEventHandler(object sender, GetInvoicesForDeviceSetCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetInvoicesForDeviceSetCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetInvoicesForDeviceSetCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public System.Data.DataTable Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((System.Data.DataTable)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void GetInvoicesGeneratedTodayCompletedEventHandler(object sender, GetInvoicesGeneratedTodayCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetInvoicesGeneratedTodayCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetInvoicesGeneratedTodayCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public System.Data.DataTable Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((System.Data.DataTable)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void GetInvoiceDetailsCompletedEventHandler(object sender, GetInvoiceDetailsCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetInvoiceDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GetInvoiceDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public System.Data.DataTable Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((System.Data.DataTable)(this.results[0]));
            }
        }
    }
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    public delegate void GenerateTodaysInvoicesCompletedEventHandler(object sender, GenerateTodaysInvoicesCompletedEventArgs e);
    
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GenerateTodaysInvoicesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
        
        private object[] results;
        
        internal GenerateTodaysInvoicesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : 
                base(exception, cancelled, userState) {
            this.results = results;
        }
        
        /// <remarks/>
        public string Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
}

#pragma warning restore 1591