diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..6b93cca --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "7.0.3", + "commands": [ + "dotnet-ef" + ] + } + } +} \ No newline at end of file diff --git a/App.razor b/App.razor new file mode 100644 index 0000000..843f201 --- /dev/null +++ b/App.razor @@ -0,0 +1,11 @@ + + + + + + Not found + +

Sorry, there's nothing at this address.

+
+
+
\ No newline at end of file diff --git a/Connected Services/BranchItemLedgerServices/ConnectedService.json b/Connected Services/BranchItemLedgerServices/ConnectedService.json new file mode 100644 index 0000000..7fd3803 --- /dev/null +++ b/Connected Services/BranchItemLedgerServices/ConnectedService.json @@ -0,0 +1,16 @@ +{ + "ExtendedData": { + "inputs": [ + "http://kwapp-srv/CommServices/BranchItemLedgerService.svc" + ], + "collectionTypes": [ + "System.Array", + "System.Collections.Generic.Dictionary`2" + ], + "namespaceMappings": [ + "*, BranchItemLedgerServices" + ], + "targetFramework": "net7.0", + "typeReuseMode": "None" + } +} \ No newline at end of file diff --git a/Connected Services/BranchItemLedgerServices/Reference.cs b/Connected Services/BranchItemLedgerServices/Reference.cs new file mode 100644 index 0000000..605973d --- /dev/null +++ b/Connected Services/BranchItemLedgerServices/Reference.cs @@ -0,0 +1,606 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BranchItemLedgerServices +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="items", Namespace="http://schemas.datacontract.org/2004/07/KWERPService.CommServices")] + [System.Runtime.Serialization.KnownTypeAttribute(typeof(BranchItemLedgerServices.branchitemledger))] + public partial class items : object + { + + private string catCodeField; + + private float ctsField; + + private string goldIDField; + + private float gramsField; + + private string item_descField; + + private long itemcodeField; + + private int karatField; + + private string manrefField; + + private string modelnoField; + + private System.DateTime modifieddateField; + + private double mrpField; + + private string picField; + + private double prevsrpField; + + private string seriescodeField; + + private string sizeField; + + private string sizeunitField; + + private System.DateTime sourceDateField; + + private double srpField; + + private string supCodeField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public string catCode + { + get + { + return this.catCodeField; + } + set + { + this.catCodeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public float cts + { + get + { + return this.ctsField; + } + set + { + this.ctsField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string goldID + { + get + { + return this.goldIDField; + } + set + { + this.goldIDField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public float grams + { + get + { + return this.gramsField; + } + set + { + this.gramsField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string item_desc + { + get + { + return this.item_descField; + } + set + { + this.item_descField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public long itemcode + { + get + { + return this.itemcodeField; + } + set + { + this.itemcodeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int karat + { + get + { + return this.karatField; + } + set + { + this.karatField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string manref + { + get + { + return this.manrefField; + } + set + { + this.manrefField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string modelno + { + get + { + return this.modelnoField; + } + set + { + this.modelnoField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime modifieddate + { + get + { + return this.modifieddateField; + } + set + { + this.modifieddateField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public double mrp + { + get + { + return this.mrpField; + } + set + { + this.mrpField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string pic + { + get + { + return this.picField; + } + set + { + this.picField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public double prevsrp + { + get + { + return this.prevsrpField; + } + set + { + this.prevsrpField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string seriescode + { + get + { + return this.seriescodeField; + } + set + { + this.seriescodeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string size + { + get + { + return this.sizeField; + } + set + { + this.sizeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string sizeunit + { + get + { + return this.sizeunitField; + } + set + { + this.sizeunitField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime sourceDate + { + get + { + return this.sourceDateField; + } + set + { + this.sourceDateField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public double srp + { + get + { + return this.srpField; + } + set + { + this.srpField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string supCode + { + get + { + return this.supCodeField; + } + set + { + this.supCodeField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="branchitemledger", Namespace="http://schemas.datacontract.org/2004/07/KWERPService.CommServices")] + public partial class branchitemledger : BranchItemLedgerServices.items + { + + private int adjustmentField; + + private int beginningqtyField; + + private string brCodeField; + + private System.DateTime creationDateField; + + private System.DateTime editDateField; + + private int endingqtyField; + + private int inqtyField; + + private int outqtyField; + + private string remarksField; + + private int salesField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public int adjustment + { + get + { + return this.adjustmentField; + } + set + { + this.adjustmentField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int beginningqty + { + get + { + return this.beginningqtyField; + } + set + { + this.beginningqtyField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string brCode + { + get + { + return this.brCodeField; + } + set + { + this.brCodeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime creationDate + { + get + { + return this.creationDateField; + } + set + { + this.creationDateField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime editDate + { + get + { + return this.editDateField; + } + set + { + this.editDateField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int endingqty + { + get + { + return this.endingqtyField; + } + set + { + this.endingqtyField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int inqty + { + get + { + return this.inqtyField; + } + set + { + this.inqtyField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int outqty + { + get + { + return this.outqtyField; + } + set + { + this.outqtyField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string remarks + { + get + { + return this.remarksField; + } + set + { + this.remarksField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int sales + { + get + { + return this.salesField; + } + set + { + this.salesField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="BranchItemLedgerServices.IBranchItemLedgerService")] + public interface IBranchItemLedgerService + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchItemLedgerService/TestCall", ReplyAction="http://tempuri.org/IBranchItemLedgerService/TestCallResponse")] + System.Threading.Tasks.Task TestCallAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchItemLedgerService/GetRemoteDataByBrCodeItemcode", ReplyAction="http://tempuri.org/IBranchItemLedgerService/GetRemoteDataByBrCodeItemcodeResponse" + + "")] + System.Threading.Tasks.Task GetRemoteDataByBrCodeItemcodeAsync(string brCode, string itemcode); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchItemLedgerService/GetRemoteDataByBrCodeModelno", ReplyAction="http://tempuri.org/IBranchItemLedgerService/GetRemoteDataByBrCodeModelnoResponse")] + System.Threading.Tasks.Task GetRemoteDataByBrCodeModelnoAsync(string brCode, string modelno); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchItemLedgerService/GetRemoteDataByBrCode", ReplyAction="http://tempuri.org/IBranchItemLedgerService/GetRemoteDataByBrCodeResponse")] + System.Threading.Tasks.Task GetRemoteDataByBrCodeAsync(string brCode); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchItemLedgerService/UpdateRemoteBranchItemLedger", ReplyAction="http://tempuri.org/IBranchItemLedgerService/UpdateRemoteBranchItemLedgerResponse")] + System.Threading.Tasks.Task UpdateRemoteBranchItemLedgerAsync(BranchItemLedgerServices.branchitemledger branchItemLedger); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + public interface IBranchItemLedgerServiceChannel : BranchItemLedgerServices.IBranchItemLedgerService, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + public partial class BranchItemLedgerServiceClient : System.ServiceModel.ClientBase, BranchItemLedgerServices.IBranchItemLedgerService + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public BranchItemLedgerServiceClient() : + base(BranchItemLedgerServiceClient.GetDefaultBinding(), BranchItemLedgerServiceClient.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IBranchItemLedgerService.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public BranchItemLedgerServiceClient(EndpointConfiguration endpointConfiguration) : + base(BranchItemLedgerServiceClient.GetBindingForEndpoint(endpointConfiguration), BranchItemLedgerServiceClient.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public BranchItemLedgerServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(BranchItemLedgerServiceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public BranchItemLedgerServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(BranchItemLedgerServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public BranchItemLedgerServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task TestCallAsync() + { + return base.Channel.TestCallAsync(); + } + + public System.Threading.Tasks.Task GetRemoteDataByBrCodeItemcodeAsync(string brCode, string itemcode) + { + return base.Channel.GetRemoteDataByBrCodeItemcodeAsync(brCode, itemcode); + } + + public System.Threading.Tasks.Task GetRemoteDataByBrCodeModelnoAsync(string brCode, string modelno) + { + return base.Channel.GetRemoteDataByBrCodeModelnoAsync(brCode, modelno); + } + + public System.Threading.Tasks.Task GetRemoteDataByBrCodeAsync(string brCode) + { + return base.Channel.GetRemoteDataByBrCodeAsync(brCode); + } + + public System.Threading.Tasks.Task UpdateRemoteBranchItemLedgerAsync(BranchItemLedgerServices.branchitemledger branchItemLedger) + { + return base.Channel.UpdateRemoteBranchItemLedgerAsync(branchItemLedger); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IBranchItemLedgerService)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IBranchItemLedgerService)) + { + return new System.ServiceModel.EndpointAddress("http://kwapp-srv/CommServices/BranchItemLedgerService.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return BranchItemLedgerServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IBranchItemLedgerService); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return BranchItemLedgerServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IBranchItemLedgerService); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IBranchItemLedgerService, + } + } +} diff --git a/Connected Services/BranchServices/ConnectedService.json b/Connected Services/BranchServices/ConnectedService.json new file mode 100644 index 0000000..0a34e72 --- /dev/null +++ b/Connected Services/BranchServices/ConnectedService.json @@ -0,0 +1,16 @@ +{ + "ExtendedData": { + "inputs": [ + "http://kwapp-srv/CommServices/BranchService.svc" + ], + "collectionTypes": [ + "System.Array", + "System.Collections.Generic.Dictionary`2" + ], + "namespaceMappings": [ + "*, BranchServices" + ], + "targetFramework": "net7.0", + "typeReuseMode": "None" + } +} \ No newline at end of file diff --git a/Connected Services/BranchServices/Reference.cs b/Connected Services/BranchServices/Reference.cs new file mode 100644 index 0000000..8ed9493 --- /dev/null +++ b/Connected Services/BranchServices/Reference.cs @@ -0,0 +1,268 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace BranchServices +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="branch", Namespace="http://schemas.datacontract.org/2004/07/KWERPService.CommServices")] + public partial class branch : object + { + + private string addressField; + + private string brCodeField; + + private string brDescField; + + private string contactInfoField; + + private System.DateTime creationDateField; + + private System.DateTime editDateField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public string address + { + get + { + return this.addressField; + } + set + { + this.addressField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string brCode + { + get + { + return this.brCodeField; + } + set + { + this.brCodeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string brDesc + { + get + { + return this.brDescField; + } + set + { + this.brDescField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string contactInfo + { + get + { + return this.contactInfoField; + } + set + { + this.contactInfoField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime creationDate + { + get + { + return this.creationDateField; + } + set + { + this.creationDateField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime editDate + { + get + { + return this.editDateField; + } + set + { + this.editDateField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="BranchServices.IBranchService")] + public interface IBranchService + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchService/TestCall", ReplyAction="http://tempuri.org/IBranchService/TestCallResponse")] + System.Threading.Tasks.Task TestCallAsync(BranchServices.branch b); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchService/GetData", ReplyAction="http://tempuri.org/IBranchService/GetDataResponse")] + System.Threading.Tasks.Task GetDataAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchService/UpdateBranchInfo", ReplyAction="http://tempuri.org/IBranchService/UpdateBranchInfoResponse")] + System.Threading.Tasks.Task UpdateBranchInfoAsync(BranchServices.branch Branch); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchService/AddBranch", ReplyAction="http://tempuri.org/IBranchService/AddBranchResponse")] + System.Threading.Tasks.Task AddBranchAsync(BranchServices.branch Branch); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchService/DeleteByBranchCode", ReplyAction="http://tempuri.org/IBranchService/DeleteByBranchCodeResponse")] + System.Threading.Tasks.Task DeleteByBranchCodeAsync(string branchCode); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchService/UpdateRemoteData", ReplyAction="http://tempuri.org/IBranchService/UpdateRemoteDataResponse")] + System.Threading.Tasks.Task UpdateRemoteDataAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBranchService/UpdateRemoteBranchData", ReplyAction="http://tempuri.org/IBranchService/UpdateRemoteBranchDataResponse")] + System.Threading.Tasks.Task UpdateRemoteBranchDataAsync(BranchServices.branch Branch); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + public interface IBranchServiceChannel : BranchServices.IBranchService, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + public partial class BranchServiceClient : System.ServiceModel.ClientBase, BranchServices.IBranchService + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public BranchServiceClient() : + base(BranchServiceClient.GetDefaultBinding(), BranchServiceClient.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IBranchService.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public BranchServiceClient(EndpointConfiguration endpointConfiguration) : + base(BranchServiceClient.GetBindingForEndpoint(endpointConfiguration), BranchServiceClient.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public BranchServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(BranchServiceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public BranchServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(BranchServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public BranchServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task TestCallAsync(BranchServices.branch b) + { + return base.Channel.TestCallAsync(b); + } + + public System.Threading.Tasks.Task GetDataAsync() + { + return base.Channel.GetDataAsync(); + } + + public System.Threading.Tasks.Task UpdateBranchInfoAsync(BranchServices.branch Branch) + { + return base.Channel.UpdateBranchInfoAsync(Branch); + } + + public System.Threading.Tasks.Task AddBranchAsync(BranchServices.branch Branch) + { + return base.Channel.AddBranchAsync(Branch); + } + + public System.Threading.Tasks.Task DeleteByBranchCodeAsync(string branchCode) + { + return base.Channel.DeleteByBranchCodeAsync(branchCode); + } + + public System.Threading.Tasks.Task UpdateRemoteDataAsync() + { + return base.Channel.UpdateRemoteDataAsync(); + } + + public System.Threading.Tasks.Task UpdateRemoteBranchDataAsync(BranchServices.branch Branch) + { + return base.Channel.UpdateRemoteBranchDataAsync(Branch); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IBranchService)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IBranchService)) + { + return new System.ServiceModel.EndpointAddress("http://kwapp-srv/CommServices/BranchService.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return BranchServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IBranchService); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return BranchServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IBranchService); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IBranchService, + } + } +} diff --git a/Connected Services/ItemServices/ConnectedService.json b/Connected Services/ItemServices/ConnectedService.json new file mode 100644 index 0000000..b64c9a3 --- /dev/null +++ b/Connected Services/ItemServices/ConnectedService.json @@ -0,0 +1,16 @@ +{ + "ExtendedData": { + "inputs": [ + "http://kwapp-srv/CommServices/ItemService.svc" + ], + "collectionTypes": [ + "System.Array", + "System.Collections.Generic.Dictionary`2" + ], + "namespaceMappings": [ + "*, ItemServices" + ], + "targetFramework": "net7.0", + "typeReuseMode": "None" + } +} \ No newline at end of file diff --git a/Connected Services/ItemServices/Reference.cs b/Connected Services/ItemServices/Reference.cs new file mode 100644 index 0000000..f199f48 --- /dev/null +++ b/Connected Services/ItemServices/Reference.cs @@ -0,0 +1,703 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ItemServices +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="items", Namespace="http://schemas.datacontract.org/2004/07/KWERPService.CommServices")] + public partial class items : object + { + + private string catCodeField; + + private float ctsField; + + private string goldIDField; + + private float gramsField; + + private string item_descField; + + private long itemcodeField; + + private int karatField; + + private string manrefField; + + private string modelnoField; + + private System.DateTime modifieddateField; + + private double mrpField; + + private string picField; + + private double prevsrpField; + + private string seriescodeField; + + private string sizeField; + + private string sizeunitField; + + private System.DateTime sourceDateField; + + private double srpField; + + private string supCodeField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public string catCode + { + get + { + return this.catCodeField; + } + set + { + this.catCodeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public float cts + { + get + { + return this.ctsField; + } + set + { + this.ctsField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string goldID + { + get + { + return this.goldIDField; + } + set + { + this.goldIDField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public float grams + { + get + { + return this.gramsField; + } + set + { + this.gramsField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string item_desc + { + get + { + return this.item_descField; + } + set + { + this.item_descField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public long itemcode + { + get + { + return this.itemcodeField; + } + set + { + this.itemcodeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int karat + { + get + { + return this.karatField; + } + set + { + this.karatField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string manref + { + get + { + return this.manrefField; + } + set + { + this.manrefField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string modelno + { + get + { + return this.modelnoField; + } + set + { + this.modelnoField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime modifieddate + { + get + { + return this.modifieddateField; + } + set + { + this.modifieddateField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public double mrp + { + get + { + return this.mrpField; + } + set + { + this.mrpField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string pic + { + get + { + return this.picField; + } + set + { + this.picField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public double prevsrp + { + get + { + return this.prevsrpField; + } + set + { + this.prevsrpField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string seriescode + { + get + { + return this.seriescodeField; + } + set + { + this.seriescodeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string size + { + get + { + return this.sizeField; + } + set + { + this.sizeField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string sizeunit + { + get + { + return this.sizeunitField; + } + set + { + this.sizeunitField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime sourceDate + { + get + { + return this.sourceDateField; + } + set + { + this.sourceDateField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public double srp + { + get + { + return this.srpField; + } + set + { + this.srpField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string supCode + { + get + { + return this.supCodeField; + } + set + { + this.supCodeField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ItemServices.IItemService")] + public interface IItemService + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/TestCall", ReplyAction="http://tempuri.org/IItemService/TestCallResponse")] + System.Threading.Tasks.Task TestCallAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetData", ReplyAction="http://tempuri.org/IItemService/GetDataResponse")] + System.Threading.Tasks.Task GetDataAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetTopData", ReplyAction="http://tempuri.org/IItemService/GetTopDataResponse")] + System.Threading.Tasks.Task GetTopDataAsync(int limit); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetDataByItemcode", ReplyAction="http://tempuri.org/IItemService/GetDataByItemcodeResponse")] + System.Threading.Tasks.Task GetDataByItemcodeAsync(long itemcode); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetDataByModelno", ReplyAction="http://tempuri.org/IItemService/GetDataByModelnoResponse")] + System.Threading.Tasks.Task GetDataByModelnoAsync(string modelno); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByModelnos", ReplyAction="http://tempuri.org/IItemService/GetItemListByModelnosResponse")] + System.Threading.Tasks.Task GetItemListByModelnosAsync(string[] modelnos); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByModelnoStartsWith", ReplyAction="http://tempuri.org/IItemService/GetItemListByModelnoStartsWithResponse")] + System.Threading.Tasks.Task GetItemListByModelnoStartsWithAsync(string modelno); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByDescription", ReplyAction="http://tempuri.org/IItemService/GetItemListByDescriptionResponse")] + System.Threading.Tasks.Task GetItemListByDescriptionAsync(string description); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/GetItemListByDynamicParameter", ReplyAction="http://tempuri.org/IItemService/GetItemListByDynamicParameterResponse")] + System.Threading.Tasks.Task GetItemListByDynamicParameterAsync(string SQLFilters); + + // CODEGEN: Generating message contract since the operation has multiple return values. + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/AddItem", ReplyAction="http://tempuri.org/IItemService/AddItemResponse")] + System.Threading.Tasks.Task AddItemAsync(ItemServices.AddItemRequest request); + + // CODEGEN: Generating message contract since the operation has multiple return values. + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/UpdateItemDetails", ReplyAction="http://tempuri.org/IItemService/UpdateItemDetailsResponse")] + System.Threading.Tasks.Task UpdateItemDetailsAsync(ItemServices.UpdateItemDetailsRequest request); + + // CODEGEN: Generating message contract since the operation has multiple return values. + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/UpdateItemSRP", ReplyAction="http://tempuri.org/IItemService/UpdateItemSRPResponse")] + System.Threading.Tasks.Task UpdateItemSRPAsync(ItemServices.UpdateItemSRPRequest request); + + // CODEGEN: Generating message contract since the operation has multiple return values. + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/UpdateItemMRPSRP", ReplyAction="http://tempuri.org/IItemService/UpdateItemMRPSRPResponse")] + System.Threading.Tasks.Task UpdateItemMRPSRPAsync(ItemServices.UpdateItemMRPSRPRequest request); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/UpdateItemImage", ReplyAction="http://tempuri.org/IItemService/UpdateItemImageResponse")] + System.Threading.Tasks.Task UpdateItemImageAsync(long itemcode, string imgPath); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IItemService/SendByteImage", ReplyAction="http://tempuri.org/IItemService/SendByteImageResponse")] + System.Threading.Tasks.Task SendByteImageAsync(byte[] img); + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="AddItem", WrapperNamespace="http://tempuri.org/", IsWrapped=true)] + public partial class AddItemRequest + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)] + public ItemServices.items item; + + public AddItemRequest() + { + } + + public AddItemRequest(ItemServices.items item) + { + this.item = item; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="AddItemResponse", WrapperNamespace="http://tempuri.org/", IsWrapped=true)] + public partial class AddItemResponse + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)] + public bool AddItemResult; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)] + public long itemcode; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=2)] + public string modelno; + + public AddItemResponse() + { + } + + public AddItemResponse(bool AddItemResult, long itemcode, string modelno) + { + this.AddItemResult = AddItemResult; + this.itemcode = itemcode; + this.modelno = modelno; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="UpdateItemDetails", WrapperNamespace="http://tempuri.org/", IsWrapped=true)] + public partial class UpdateItemDetailsRequest + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)] + public ItemServices.items item; + + public UpdateItemDetailsRequest() + { + } + + public UpdateItemDetailsRequest(ItemServices.items item) + { + this.item = item; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="UpdateItemDetailsResponse", WrapperNamespace="http://tempuri.org/", IsWrapped=true)] + public partial class UpdateItemDetailsResponse + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)] + public int UpdateItemDetailsResult; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)] + public string ERROR_MSG; + + public UpdateItemDetailsResponse() + { + } + + public UpdateItemDetailsResponse(int UpdateItemDetailsResult, string ERROR_MSG) + { + this.UpdateItemDetailsResult = UpdateItemDetailsResult; + this.ERROR_MSG = ERROR_MSG; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="UpdateItemSRP", WrapperNamespace="http://tempuri.org/", IsWrapped=true)] + public partial class UpdateItemSRPRequest + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)] + public ItemServices.items[] itemList; + + public UpdateItemSRPRequest() + { + } + + public UpdateItemSRPRequest(ItemServices.items[] itemList) + { + this.itemList = itemList; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="UpdateItemSRPResponse", WrapperNamespace="http://tempuri.org/", IsWrapped=true)] + public partial class UpdateItemSRPResponse + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)] + public int UpdateItemSRPResult; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)] + public string ERROR_MSG; + + public UpdateItemSRPResponse() + { + } + + public UpdateItemSRPResponse(int UpdateItemSRPResult, string ERROR_MSG) + { + this.UpdateItemSRPResult = UpdateItemSRPResult; + this.ERROR_MSG = ERROR_MSG; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="UpdateItemMRPSRP", WrapperNamespace="http://tempuri.org/", IsWrapped=true)] + public partial class UpdateItemMRPSRPRequest + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)] + public ItemServices.items[] itemList; + + public UpdateItemMRPSRPRequest() + { + } + + public UpdateItemMRPSRPRequest(ItemServices.items[] itemList) + { + this.itemList = itemList; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.MessageContractAttribute(WrapperName="UpdateItemMRPSRPResponse", WrapperNamespace="http://tempuri.org/", IsWrapped=true)] + public partial class UpdateItemMRPSRPResponse + { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=0)] + public int UpdateItemMRPSRPResult; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://tempuri.org/", Order=1)] + public string ERROR_MSG; + + public UpdateItemMRPSRPResponse() + { + } + + public UpdateItemMRPSRPResponse(int UpdateItemMRPSRPResult, string ERROR_MSG) + { + this.UpdateItemMRPSRPResult = UpdateItemMRPSRPResult; + this.ERROR_MSG = ERROR_MSG; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + public interface IItemServiceChannel : ItemServices.IItemService, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + public partial class ItemServiceClient : System.ServiceModel.ClientBase, ItemServices.IItemService + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public ItemServiceClient() : + base(ItemServiceClient.GetDefaultBinding(), ItemServiceClient.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IItemService.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public ItemServiceClient(EndpointConfiguration endpointConfiguration) : + base(ItemServiceClient.GetBindingForEndpoint(endpointConfiguration), ItemServiceClient.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public ItemServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(ItemServiceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public ItemServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(ItemServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public ItemServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task TestCallAsync() + { + return base.Channel.TestCallAsync(); + } + + public System.Threading.Tasks.Task GetDataAsync() + { + return base.Channel.GetDataAsync(); + } + + public System.Threading.Tasks.Task GetTopDataAsync(int limit) + { + return base.Channel.GetTopDataAsync(limit); + } + + public System.Threading.Tasks.Task GetDataByItemcodeAsync(long itemcode) + { + return base.Channel.GetDataByItemcodeAsync(itemcode); + } + + public System.Threading.Tasks.Task GetDataByModelnoAsync(string modelno) + { + return base.Channel.GetDataByModelnoAsync(modelno); + } + + public System.Threading.Tasks.Task GetItemListByModelnosAsync(string[] modelnos) + { + return base.Channel.GetItemListByModelnosAsync(modelnos); + } + + public System.Threading.Tasks.Task GetItemListByModelnoStartsWithAsync(string modelno) + { + return base.Channel.GetItemListByModelnoStartsWithAsync(modelno); + } + + public System.Threading.Tasks.Task GetItemListByDescriptionAsync(string description) + { + return base.Channel.GetItemListByDescriptionAsync(description); + } + + public System.Threading.Tasks.Task GetItemListByDynamicParameterAsync(string SQLFilters) + { + return base.Channel.GetItemListByDynamicParameterAsync(SQLFilters); + } + + public System.Threading.Tasks.Task AddItemAsync(ItemServices.AddItemRequest request) + { + return base.Channel.AddItemAsync(request); + } + + public System.Threading.Tasks.Task UpdateItemDetailsAsync(ItemServices.UpdateItemDetailsRequest request) + { + return base.Channel.UpdateItemDetailsAsync(request); + } + + public System.Threading.Tasks.Task UpdateItemSRPAsync(ItemServices.UpdateItemSRPRequest request) + { + return base.Channel.UpdateItemSRPAsync(request); + } + + public System.Threading.Tasks.Task UpdateItemMRPSRPAsync(ItemServices.UpdateItemMRPSRPRequest request) + { + return base.Channel.UpdateItemMRPSRPAsync(request); + } + + public System.Threading.Tasks.Task UpdateItemImageAsync(long itemcode, string imgPath) + { + return base.Channel.UpdateItemImageAsync(itemcode, imgPath); + } + + public System.Threading.Tasks.Task SendByteImageAsync(byte[] img) + { + return base.Channel.SendByteImageAsync(img); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IItemService)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IItemService)) + { + return new System.ServiceModel.EndpointAddress("http://kwapp-srv/CommServices/ItemService.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return ItemServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IItemService); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return ItemServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IItemService); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IItemService, + } + } +} diff --git a/Connected Services/UserInfoServices/ConnectedService.json b/Connected Services/UserInfoServices/ConnectedService.json new file mode 100644 index 0000000..660974c --- /dev/null +++ b/Connected Services/UserInfoServices/ConnectedService.json @@ -0,0 +1,16 @@ +{ + "ExtendedData": { + "inputs": [ + "http://kwapp-srv/CommServices/UserInfoService.svc" + ], + "collectionTypes": [ + "System.Array", + "System.Collections.Generic.Dictionary`2" + ], + "namespaceMappings": [ + "*, UserInfoServices" + ], + "targetFramework": "net7.0", + "typeReuseMode": "None" + } +} \ No newline at end of file diff --git a/Connected Services/UserInfoServices/Reference.cs b/Connected Services/UserInfoServices/Reference.cs new file mode 100644 index 0000000..7d24e1f --- /dev/null +++ b/Connected Services/UserInfoServices/Reference.cs @@ -0,0 +1,297 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace UserInfoServices +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="userinfo", Namespace="http://schemas.datacontract.org/2004/07/KWERPService.CommServices")] + public partial class userinfo : object + { + + private string addressField; + + private string branchField; + + private string contactInfoField; + + private System.DateTime creationDateField; + + private System.DateTime editDateField; + + private string fullNameField; + + private string passField; + + private int userlvlField; + + private string usernameField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public string address + { + get + { + return this.addressField; + } + set + { + this.addressField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string branch + { + get + { + return this.branchField; + } + set + { + this.branchField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string contactInfo + { + get + { + return this.contactInfoField; + } + set + { + this.contactInfoField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime creationDate + { + get + { + return this.creationDateField; + } + set + { + this.creationDateField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.DateTime editDate + { + get + { + return this.editDateField; + } + set + { + this.editDateField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string fullName + { + get + { + return this.fullNameField; + } + set + { + this.fullNameField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string pass + { + get + { + return this.passField; + } + set + { + this.passField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int userlvl + { + get + { + return this.userlvlField; + } + set + { + this.userlvlField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public string username + { + get + { + return this.usernameField; + } + set + { + this.usernameField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="UserInfoServices.IUserInfoService")] + public interface IUserInfoService + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUserInfoService/TestCall", ReplyAction="http://tempuri.org/IUserInfoService/TestCallResponse")] + System.Threading.Tasks.Task TestCallAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUserInfoService/AuthenticateUser", ReplyAction="http://tempuri.org/IUserInfoService/AuthenticateUserResponse")] + System.Threading.Tasks.Task AuthenticateUserAsync(UserInfoServices.userinfo userAttemptingToLogin); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUserInfoService/GetUserInfoByUsername", ReplyAction="http://tempuri.org/IUserInfoService/GetUserInfoByUsernameResponse")] + System.Threading.Tasks.Task GetUserInfoByUsernameAsync(string username); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUserInfoService/GetData", ReplyAction="http://tempuri.org/IUserInfoService/GetDataResponse")] + System.Threading.Tasks.Task GetDataAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IUserInfoService/md5Encoding", ReplyAction="http://tempuri.org/IUserInfoService/md5EncodingResponse")] + System.Threading.Tasks.Task md5EncodingAsync(string originalPassword); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + public interface IUserInfoServiceChannel : UserInfoServices.IUserInfoService, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] + public partial class UserInfoServiceClient : System.ServiceModel.ClientBase, UserInfoServices.IUserInfoService + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public UserInfoServiceClient() : + base(UserInfoServiceClient.GetDefaultBinding(), UserInfoServiceClient.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IUserInfoService.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public UserInfoServiceClient(EndpointConfiguration endpointConfiguration) : + base(UserInfoServiceClient.GetBindingForEndpoint(endpointConfiguration), UserInfoServiceClient.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public UserInfoServiceClient(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(UserInfoServiceClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public UserInfoServiceClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(UserInfoServiceClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public UserInfoServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task TestCallAsync() + { + return base.Channel.TestCallAsync(); + } + + public System.Threading.Tasks.Task AuthenticateUserAsync(UserInfoServices.userinfo userAttemptingToLogin) + { + return base.Channel.AuthenticateUserAsync(userAttemptingToLogin); + } + + public System.Threading.Tasks.Task GetUserInfoByUsernameAsync(string username) + { + return base.Channel.GetUserInfoByUsernameAsync(username); + } + + public System.Threading.Tasks.Task GetDataAsync() + { + return base.Channel.GetDataAsync(); + } + + public System.Threading.Tasks.Task md5EncodingAsync(string originalPassword) + { + return base.Channel.md5EncodingAsync(originalPassword); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IUserInfoService)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IUserInfoService)) + { + return new System.ServiceModel.EndpointAddress("http://kwapp-srv/CommServices/UserInfoService.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return UserInfoServiceClient.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IUserInfoService); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return UserInfoServiceClient.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IUserInfoService); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IUserInfoService, + } + } +} diff --git a/Data/UserServices.cs b/Data/UserServices.cs new file mode 100644 index 0000000..e2f138b --- /dev/null +++ b/Data/UserServices.cs @@ -0,0 +1,13 @@ +namespace KWWebInvApp.Data +{ + public class UserServices + { + public UserInfoServices.userinfo? CurrentUser { get; set; } = null; + + public bool IsAuthenticated() + { + if (CurrentUser == null) return false; + else return true; + } + } +} diff --git a/Data/WeatherForecast.cs b/Data/WeatherForecast.cs new file mode 100644 index 0000000..71edc53 --- /dev/null +++ b/Data/WeatherForecast.cs @@ -0,0 +1,13 @@ +namespace KWWebInvApp.Data +{ + public class WeatherForecast + { + public DateTime Date { get; set; } + + public int TemperatureC { get; set; } + + public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); + + public string? Summary { get; set; } + } +} diff --git a/Data/WeatherForecastService.cs b/Data/WeatherForecastService.cs new file mode 100644 index 0000000..4281c6a --- /dev/null +++ b/Data/WeatherForecastService.cs @@ -0,0 +1,21 @@ +namespace KWWebInvApp.Data +{ + public class WeatherForecastService + { + private static readonly string[] Summaries = new[] + { + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; + + public Task GetForecastAsync(DateTime startDate) + { + var rng = new Random(); + return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = startDate.AddDays(index), + TemperatureC = rng.Next(-20, 55), + Summary = Summaries[rng.Next(Summaries.Length)] + }).ToArray()); + } + } +} diff --git a/KWWebInvApp.csproj b/KWWebInvApp.csproj new file mode 100644 index 0000000..55306c8 --- /dev/null +++ b/KWWebInvApp.csproj @@ -0,0 +1,18 @@ + + + + net7.0 + enable + enable + + + + + + + + + + + + diff --git a/KWWebInvApp.sln b/KWWebInvApp.sln new file mode 100644 index 0000000..a36387d --- /dev/null +++ b/KWWebInvApp.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KWWebInvApp", "KWWebInvApp.csproj", "{720C48E7-70D0-4942-853F-36FE24851446}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {720C48E7-70D0-4942-853F-36FE24851446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {720C48E7-70D0-4942-853F-36FE24851446}.Debug|Any CPU.Build.0 = Debug|Any CPU + {720C48E7-70D0-4942-853F-36FE24851446}.Release|Any CPU.ActiveCfg = Release|Any CPU + {720C48E7-70D0-4942-853F-36FE24851446}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6AAFD446-85BE-4ED0-BCFF-1840619BCA26} + EndGlobalSection +EndGlobal diff --git a/MessageDialogs/WarningDialog.razor b/MessageDialogs/WarningDialog.razor new file mode 100644 index 0000000..bef8640 --- /dev/null +++ b/MessageDialogs/WarningDialog.razor @@ -0,0 +1,22 @@ + + + @ContentText + + + @ButtonText + + + + +@code { + [CascadingParameter] MudDialogInstance MudDialog { get; set; } + + [Parameter] public string ContentText { get; set; } + + [Parameter] public string ButtonText { get; set; } + + [Parameter] public Color Color { get; set; } + + void Submit() => MudDialog.Close(DialogResult.Ok(true)); + void Cancel() => MudDialog.Cancel(); +} \ No newline at end of file diff --git a/Pages/BranchMaintenance/InventoryCorrection.razor b/Pages/BranchMaintenance/InventoryCorrection.razor new file mode 100644 index 0000000..8d6efaa --- /dev/null +++ b/Pages/BranchMaintenance/InventoryCorrection.razor @@ -0,0 +1,200 @@ +@page "/brmaintenance/invtycorrection" +@using KWWebInvApp.Data; + +@inject IDialogService DialogService; +@inject UserServices userService; + +Branch Inventory Correction +Branch Inventory Correction +Select a specific branch and select the table to edit from the grid. + + + + + + + + + + + + + Get Record + + + + + + + +@if (branchItemLedger != null && branchItemLedger.modelno != null) +{ + Inventory details of @selectedBranch branch + + + + + + + + @branchItemLedger.itemcode + + + @branchItemLedger.remarks + + + Edit the details below + + + + + + + + + + + + + + + + + + + + + + + Update Record + Reset + + + + + +} +else +{ + No Record to Show +} + +@code { + BranchServices.branch[]? branchList; + string? selectedBranch, selectedModelNo; + BranchItemLedgerServices.branchitemledger? branchItemLedger = null; + bool disableStatusGetRecord = false, disableStatusSave = true; + + + BranchServices.BranchServiceClient branchServiceClient = new(); + ItemServices.ItemServiceClient itemServiceClient = new(); + BranchItemLedgerServices.BranchItemLedgerServiceClient branchItemLedgerServiceClient = new(); + + protected override async Task OnInitializedAsync() + { + branchList = await branchServiceClient.GetDataAsync(); + } + + async Task> SearchBranch(string value) + { + await Task.Delay(1); + + if (string.IsNullOrEmpty(value)) + return branchList.Select(c=>c.brCode); + + return branchList.Where(c => c.brCode.Contains(value, StringComparison.InvariantCultureIgnoreCase)).Select(c=>c.brCode); + } + + async Task> SearchModelNo(string value) + { + ItemServices.items[] itemList; + + if (string.IsNullOrEmpty(value) || value.Length < 2) + { + itemList = await itemServiceClient.GetTopDataAsync(10); + return itemList.Select(c => c.modelno); + } + + itemList = await itemServiceClient.GetItemListByModelnoStartsWithAsync(value); + return itemList.Select(c => c.modelno); + } + + async Task GetRecord() + { + if(string.IsNullOrEmpty(selectedBranch)) + { + var dialogParam = new DialogParameters(); + dialogParam.Add("ContentText", "No branch. Please enter in the Branch field."); + dialogParam.Add("ButtonText", "OK"); + dialogParam.Add("Color", Color.Error); + + DialogService.Show("No Branch", dialogParam); + return; + } + + if (string.IsNullOrEmpty(selectedModelNo)) + { + var dialogParam = new DialogParameters(); + dialogParam.Add("ContentText", "No model number. Please enter in the Model Number field"); + dialogParam.Add("ButtonText", "OK"); + dialogParam.Add("Color", Color.Error); + + DialogService.Show("No Mode Number", dialogParam); + return; + } + + disableStatusGetRecord = true; + disableStatusSave = true; + + branchItemLedger = await branchItemLedgerServiceClient.GetRemoteDataByBrCodeModelnoAsync(selectedBranch, selectedModelNo); + + disableStatusGetRecord = false; + disableStatusSave = false; + } + + async Task SaveBranchItemLedger() + { + if (branchItemLedger == null) + return; + + disableStatusGetRecord = true; + disableStatusSave = true; + + branchItemLedger.remarks = $"|Manually edit by {userService?.CurrentUser?.fullName}. {DateTime.Now:MM/dd/yyyy} [{branchItemLedger.beginningqty} {branchItemLedger.inqty} {branchItemLedger.outqty} {branchItemLedger.sales} {branchItemLedger.adjustment} {branchItemLedger.endingqty}]"; + + int result = await branchItemLedgerServiceClient.UpdateRemoteBranchItemLedgerAsync(branchItemLedger); + + if(result > 0) + { + var dialogParam = new DialogParameters(); + dialogParam.Add("ContentText", "Successfully updated the record"); + dialogParam.Add("ButtonText", "OK"); + dialogParam.Add("Color", Color.Info); + + DialogService.Show("Success", dialogParam); + + await ResetUpdateBranchItemLedger(); + } + else + { + var dialogParam = new DialogParameters(); + dialogParam.Add("ContentText", "Failed to update the record"); + dialogParam.Add("ButtonText", "OK"); + dialogParam.Add("Color", Color.Error); + + DialogService.Show("Failed", dialogParam); + + disableStatusGetRecord = false; + disableStatusSave = false; + } + } + + async Task ResetUpdateBranchItemLedger() + { + await Task.Delay(1); + + disableStatusGetRecord = false; + disableStatusSave = true; + branchItemLedger = null; + } +} diff --git a/Pages/Branches.razor b/Pages/Branches.razor new file mode 100644 index 0000000..2e74c7e --- /dev/null +++ b/Pages/Branches.razor @@ -0,0 +1,40 @@ +@page "/branches" + +

Branches

+ +Branches + +List of Branches + +@if (branchList == null) +{ + +} +else +{ + + + Branch Code + Description + Summary + + + @context.brCode + @context.brDesc + @context.address + + + + + +} + +@code { + public BranchServices.branch[]? branchList; + + protected override async Task OnInitializedAsync() + { + BranchServices.BranchServiceClient branchServiceClient = new(); + branchList = await branchServiceClient.GetDataAsync(); + } +} diff --git a/Pages/Counter.razor b/Pages/Counter.razor new file mode 100644 index 0000000..0cc164c --- /dev/null +++ b/Pages/Counter.razor @@ -0,0 +1,17 @@ +@page "/counter" + +Counter + +Counter +Current count: @currentCount +Click me + + +@code { + private int currentCount = 0; + + private void IncrementCount() + { + currentCount++; + } +} diff --git a/Pages/Error.cshtml b/Pages/Error.cshtml new file mode 100644 index 0000000..55b9220 --- /dev/null +++ b/Pages/Error.cshtml @@ -0,0 +1,42 @@ +@page +@model KWWebInvApp.Pages.ErrorModel + + + + + + + + Error + + + + + +
+
+

Error.

+

An error occurred while processing your request.

+ + @if (Model.ShowRequestId) + { +

+ Request ID: @Model.RequestId +

+ } + +

Development Mode

+

+ Swapping to the Development environment displays detailed information about the error that occurred. +

+

+ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +

+
+
+ + + diff --git a/Pages/Error.cshtml.cs b/Pages/Error.cshtml.cs new file mode 100644 index 0000000..cf3f17f --- /dev/null +++ b/Pages/Error.cshtml.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using System.Diagnostics; + +namespace KWWebInvApp.Pages +{ + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + [IgnoreAntiforgeryToken] + public class ErrorModel : PageModel + { + public string? RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + private readonly ILogger _logger; + + public ErrorModel(ILogger logger) + { + _logger = logger; + } + + public void OnGet() + { + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; + } + } +} diff --git a/Pages/FetchData.razor b/Pages/FetchData.razor new file mode 100644 index 0000000..f3e8085 --- /dev/null +++ b/Pages/FetchData.razor @@ -0,0 +1,42 @@ +@page "/fetchdata" +@using KWWebInvApp.Data +@inject WeatherForecastService ForecastService + +Weather forecast + +Weather forecast +This component demonstrates fetching data from the server. +@if (forecasts == null) +{ + +} +else +{ + + + Date + Temp. (C) + Temp. (F) + Summary + + + @context.Date + @context.TemperatureC + @context.TemperatureF + @context.Summary + + + + + +} + + +@code { + private WeatherForecast[]? forecasts; + + protected override async Task OnInitializedAsync() + { + forecasts = await ForecastService.GetForecastAsync(DateTime.Now); + } +} diff --git a/Pages/Index.razor b/Pages/Index.razor new file mode 100644 index 0000000..04e2e56 --- /dev/null +++ b/Pages/Index.razor @@ -0,0 +1,16 @@ +@page "/" +@using KWWebInvApp.Data +@inject UserServices userServices +@inject NavigationManager navigationManager + + +Index + +Karat World Inventory +Welcome Karat World inventory system. A web based application. +You can find documentation and examples on our website here: www.mudblazor.com + +@code +{ + +} diff --git a/Pages/Items/ItemDetails.razor b/Pages/Items/ItemDetails.razor new file mode 100644 index 0000000..f5c265c --- /dev/null +++ b/Pages/Items/ItemDetails.razor @@ -0,0 +1,7 @@ +@page "/items/itemdetails" + +

Item Details

+ +@code { + +} diff --git a/Pages/Items/ItemSearch.razor b/Pages/Items/ItemSearch.razor new file mode 100644 index 0000000..d09c097 --- /dev/null +++ b/Pages/Items/ItemSearch.razor @@ -0,0 +1,7 @@ +@page "/items/tracesearch" + +

ItemSearch

+ +@code { + +} diff --git a/Pages/Items/TraceHistory.razor b/Pages/Items/TraceHistory.razor new file mode 100644 index 0000000..9ce539b --- /dev/null +++ b/Pages/Items/TraceHistory.razor @@ -0,0 +1,7 @@ +@page "/items/tracehistory" + +

TraceHistory

+ +@code { + +} diff --git a/Pages/_Host.cshtml b/Pages/_Host.cshtml new file mode 100644 index 0000000..c424aa0 --- /dev/null +++ b/Pages/_Host.cshtml @@ -0,0 +1,8 @@ +@page "/" +@namespace KWWebInvApp.Pages +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@{ + Layout = "_Layout"; +} + + \ No newline at end of file diff --git a/Pages/_Layout.cshtml b/Pages/_Layout.cshtml new file mode 100644 index 0000000..05c4213 --- /dev/null +++ b/Pages/_Layout.cshtml @@ -0,0 +1,31 @@ +@using Microsoft.AspNetCore.Components.Web +@namespace KWWebInvApp.Pages +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers + + + + + + + + + + + + + @RenderBody() + +
+ + An error has occurred. This application may no longer respond until reloaded. + + + An unhandled exception has occurred. See browser dev tools for details. + + Reload + 🗙 +
+ + + + diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..076c785 --- /dev/null +++ b/Program.cs @@ -0,0 +1,37 @@ +using KWWebInvApp.Data; +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Hosting.StaticWebAssets; +using MudBlazor.Services; + +var builder = WebApplication.CreateBuilder(args); + +StaticWebAssetsLoader.UseStaticWebAssets(builder.Environment, builder.Configuration); + +// Add services to the container. +builder.Services.AddRazorPages(); +builder.Services.AddServerSideBlazor(); +builder.Services.AddSingleton(); +builder.Services.AddSingleton(); +builder.Services.AddMudServices(); + +var app = builder.Build(); + +// Configure the HTTP request pipeline. +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); +} + +app.UseHttpsRedirection(); + +app.UseStaticFiles(); + +app.UseRouting(); + +app.MapBlazorHub(); +app.MapFallbackToPage("/_Host"); + +app.Run(); \ No newline at end of file diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json new file mode 100644 index 0000000..cf4e319 --- /dev/null +++ b/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:61949", + "sslPort": 44393 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "KWWebInvApp": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:5001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Shared/Login.razor b/Shared/Login.razor new file mode 100644 index 0000000..97b810b --- /dev/null +++ b/Shared/Login.razor @@ -0,0 +1,81 @@ +@using KWWebInvApp.Data +@inject UserServices userService +@inject IDialogService DialogService +@inject NavigationManager navigationManager + + + + + + + Login + Welcome to Merchandise and SAC System + @if (error != null) + { + @error + } + + + + + @submitButtonText + Reset + + + + + + + + +@code { + + bool submitButtonDisabled = false; + string? pass, error, submitButtonText = "Login"; + UserInfoServices.userinfo userAttemtingToLogin = new(); + + //protected override async Task OnInitializedAsync() + //{ + + //} + + async Task SubmitLogin() + { + error = null; + + if (String.IsNullOrEmpty(userAttemtingToLogin.username) || String.IsNullOrEmpty(pass)) + { + error = "Username and Password is required"; + return; + } + + UserInfoServices.UserInfoServiceClient userInfoServiceClient = new(); + + waitingButton(true); + userAttemtingToLogin.pass = await userInfoServiceClient.md5EncodingAsync(pass); + userService.CurrentUser = await userInfoServiceClient.AuthenticateUserAsync(userAttemtingToLogin); + waitingButton(); + + if (userService.CurrentUser == null) + error = "Invalid Username or Password"; + else + navigationManager.NavigateTo("/"); + } + + void waitingButton(bool waiting = false) + { + if(waiting) + { + submitButtonDisabled = true; + submitButtonText = "Please Wait..."; + } + else + { + submitButtonDisabled = false; + submitButtonText = "Login"; + } + } +} diff --git a/Shared/MainLayout.razor b/Shared/MainLayout.razor new file mode 100644 index 0000000..47fa0f1 --- /dev/null +++ b/Shared/MainLayout.razor @@ -0,0 +1,59 @@ +@inherits LayoutComponentBase +@using KWWebInvApp.Data +@inject UserServices userServices +@inject NavigationManager navigationManager + + + + + + + + @if (userServices.IsAuthenticated()) + { + + + + + + } + + + @if (userServices.IsAuthenticated()) + { + + + KW Web App + + + + + + @Body + + + } + else + { + + + + + + } + + +@code { + bool _drawerOpen = true; + + void DrawerToggle() + { + _drawerOpen = !_drawerOpen; + } + + void Logout() + { + userServices.CurrentUser = null; + navigationManager.NavigateTo("/"); + } +} \ No newline at end of file diff --git a/Shared/NavMenu.razor b/Shared/NavMenu.razor new file mode 100644 index 0000000..83a2107 --- /dev/null +++ b/Shared/NavMenu.razor @@ -0,0 +1,14 @@ + + Home + + Item Details + Item Search + Trace History + + + Inventory Correction + + + diff --git a/_Imports.razor b/_Imports.razor new file mode 100644 index 0000000..019f42d --- /dev/null +++ b/_Imports.razor @@ -0,0 +1,11 @@ +@using System.Net.Http +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Components.Authorization +@using Microsoft.AspNetCore.Components.Forms +@using Microsoft.AspNetCore.Components.Routing +@using Microsoft.AspNetCore.Components.Web +@using Microsoft.AspNetCore.Components.Web.Virtualization +@using Microsoft.JSInterop +@using MudBlazor +@using KWWebInvApp +@using KWWebInvApp.Shared diff --git a/appsettings.Development.json b/appsettings.Development.json new file mode 100644 index 0000000..5173757 --- /dev/null +++ b/appsettings.Development.json @@ -0,0 +1,10 @@ +{ + "DetailedErrors": true, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + } +} diff --git a/appsettings.json b/appsettings.json new file mode 100644 index 0000000..d9d9a9b --- /dev/null +++ b/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +} diff --git a/wwwroot/favicon.ico b/wwwroot/favicon.ico new file mode 100644 index 0000000..1239223 Binary files /dev/null and b/wwwroot/favicon.ico differ