Add project files.
parent
ef5fb604ea
commit
76e079e0d1
|
@ -0,0 +1,9 @@
|
|||
<prism:PrismApplication x:Class="WOWS.Framwork.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:local="clr-namespace:WOWS.Framwork">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</prism:PrismApplication>
|
|
@ -0,0 +1,23 @@
|
|||
using WOWS.Framwork.Views;
|
||||
using Prism.Ioc;
|
||||
using Prism.Modularity;
|
||||
using System.Windows;
|
||||
|
||||
namespace WOWS.Framwork
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App
|
||||
{
|
||||
protected override Window CreateShell()
|
||||
{
|
||||
return Container.Resolve<MainWindow>();
|
||||
}
|
||||
|
||||
protected override void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("WOWS.Framwork")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("WOWS.Framwork")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WOWS.Framwork.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WOWS.Framwork.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WOWS.Framwork.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
|
@ -0,0 +1,19 @@
|
|||
using Prism.Mvvm;
|
||||
|
||||
namespace WOWS.Framwork.ViewModels
|
||||
{
|
||||
public class MainWindowViewModel : BindableBase
|
||||
{
|
||||
private string _title = "Prism Application";
|
||||
public string Title
|
||||
{
|
||||
get { return _title; }
|
||||
set { SetProperty(ref _title, value); }
|
||||
}
|
||||
|
||||
public MainWindowViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<Window
|
||||
x:Class="WOWS.Framwork.Views.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:wpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
|
||||
Title="{Binding Title}"
|
||||
Width="1024"
|
||||
Height="760"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True">
|
||||
<Grid />
|
||||
</Window>
|
|
@ -0,0 +1,22 @@
|
|||
using System.Windows;
|
||||
using CefSharp;
|
||||
using CefSharp.Wpf;
|
||||
|
||||
namespace WOWS.Framwork.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
var browser = new ChromiumWebBrowser("https://account.emofid.com/Login?ReturnUrl=%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3Deasy2_client_pkce%26redirect_uri%3Dhttps%253A%252F%252Fd.easytrader.emofid.com%252Fauth-callback%26response_type%3Dcode%26scope%3Deasy2_api%2520openid%26state%3D5dfd704832824540a691e497d4613e3a%26code_challenge%3Do0DJ5QnKxCSL3iXpVcfYXfMxuGDWA5YtwBPel4ujhNg%26code_challenge_method%3DS256%26response_mode%3Dquery");;
|
||||
Content = browser;
|
||||
browser.RequestContext=new RequestContext();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DA191135-C0A1-46F0-AAF3-78C24D17F40A}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WOWS.Framwork</RootNamespace>
|
||||
<AssemblyName>WOWS.Framwork</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="Views\MainWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\MainWindowViewModel.cs" />
|
||||
<Compile Include="Views\MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CefSharp.Wpf">
|
||||
<Version>83.4.20</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Prism.Unity" Version="7.2.0.1422" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,51 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30204.135
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WolfOfWallStreet", "WolfOfWallStreet\WolfOfWallStreet.csproj", "{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WOWS.Framwork", "WOWS.Framwork\WOWS.Framwork.csproj", "{DA191135-C0A1-46F0-AAF3-78C24D17F40A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Debug|x86.Build.0 = Debug|x64
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Release|x64.ActiveCfg = Release|x64
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Release|x64.Build.0 = Release|x64
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C9BEAE1F-FA3B-4611-8C3C-6BBDDC56328F}.Release|x86.Build.0 = Release|Any CPU
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Debug|x86.Build.0 = Debug|x86
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Release|x64.Build.0 = Release|Any CPU
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Release|x86.ActiveCfg = Release|x86
|
||||
{DA191135-C0A1-46F0-AAF3-78C24D17F40A}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {002E1374-F31C-4832-9309-8D77A547CBD2}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,40 @@
|
|||
<prism:PrismApplication
|
||||
x:Class="WolfOfWallStreet.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:WolfOfWallStreet"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:prism="http://prismlibrary.com/">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
<FontFamily x:Key="IranSans">../Resources/Fonts/IranSansMedium.ttf #IRANSans Medium</FontFamily>
|
||||
<FontFamily x:Key="Shabnam">../Resources/Fonts/Shabnam.ttf #Shabnam</FontFamily>
|
||||
<FontFamily x:Key="ShabnamBold">../Resources/Fonts/Shabnam-Bold.ttf #Shabnam Bold</FontFamily>
|
||||
<FontFamily x:Key="MaterialFontIcon">../Resources/Fonts/materialdesignicons-webfont.ttf #Material Design Icons</FontFamily>
|
||||
|
||||
<Style TargetType="materialDesign:Card">
|
||||
<Setter Property="materialDesign:ShadowAssist.ShadowDepth" Value="Depth0" />
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}" />
|
||||
</Style>
|
||||
|
||||
<ResourceDictionary x:Key="Material">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
</Application.Resources>
|
||||
</prism:PrismApplication>
|
|
@ -0,0 +1,34 @@
|
|||
using Prism.Ioc;
|
||||
using WolfOfWallStreet.Views;
|
||||
using System.Windows;
|
||||
using WolfOfWallStreet.Services;
|
||||
using WolfOfWallStreet.Services.Contracts;
|
||||
using WolfOfWallStreet.ViewModels;
|
||||
using WolfOfWallStreet.Views.Controllers;
|
||||
|
||||
namespace WolfOfWallStreet
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App
|
||||
{
|
||||
protected override Window CreateShell()
|
||||
{
|
||||
return Container.Resolve<MainWindow>();
|
||||
}
|
||||
|
||||
protected override void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
containerRegistry.RegisterForNavigation<MainPage,MainPageViewModel>();
|
||||
containerRegistry.RegisterForNavigation<OnlinePlusController,OnlinePlusControllerViewModel>();
|
||||
containerRegistry.RegisterForNavigation<SymbolsController,SymbolsControllerViewModel>();
|
||||
containerRegistry.RegisterForNavigation<EasyTraderController,EasyTraderControllerViewModel>();
|
||||
containerRegistry.RegisterForNavigation<MofidOnlineController,MofidOnlineControllerViewModel>();
|
||||
containerRegistry.Register<SettingsServices>();
|
||||
containerRegistry.Register<IEasyTraderService, EasyTraderService>();
|
||||
containerRegistry.Register<IMofidOnlineService, MofidOnlineService>();
|
||||
containerRegistry.Register<IOnlinePlusService, OnlinePlusService>();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,144 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Extensions
|
||||
{
|
||||
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static bool HasValue(this string value, bool ignoreWhiteSpace = true)
|
||||
{
|
||||
return ignoreWhiteSpace ? !String.IsNullOrWhiteSpace(value) : !String.IsNullOrEmpty(value);
|
||||
}
|
||||
|
||||
public static int ToInt(this string value)
|
||||
{
|
||||
return Convert.ToInt32(value);
|
||||
}
|
||||
|
||||
public static decimal ToDecimal(this string value)
|
||||
{
|
||||
return Convert.ToDecimal(value);
|
||||
}
|
||||
|
||||
public static string ToNumeric(this int value)
|
||||
{
|
||||
return value.ToString("N0"); //"123,456"
|
||||
}
|
||||
|
||||
public static string ToNumeric(this decimal value)
|
||||
{
|
||||
return value.ToString("N0");
|
||||
}
|
||||
|
||||
public static string ToCurrency(this int value)
|
||||
{
|
||||
//fa-IR => current culture currency symbol => ریال
|
||||
//123456 => "123,123ریال"
|
||||
return value.ToString("C0");
|
||||
}
|
||||
|
||||
public static string ToCurrency(this decimal value)
|
||||
{
|
||||
return value.ToString("C0");
|
||||
}
|
||||
|
||||
public static string En2Fa(this string str)
|
||||
{
|
||||
return str.Replace("0", "۰")
|
||||
.Replace("1", "۱")
|
||||
.Replace("2", "۲")
|
||||
.Replace("3", "۳")
|
||||
.Replace("4", "۴")
|
||||
.Replace("5", "۵")
|
||||
.Replace("6", "۶")
|
||||
.Replace("7", "۷")
|
||||
.Replace("8", "۸")
|
||||
.Replace("9", "۹");
|
||||
}
|
||||
|
||||
public static string Fa2En(this string str)
|
||||
{
|
||||
return str.Replace("۰", "0")
|
||||
.Replace("۱", "1")
|
||||
.Replace("۲", "2")
|
||||
.Replace("۳", "3")
|
||||
.Replace("۴", "4")
|
||||
.Replace("۵", "5")
|
||||
.Replace("۶", "6")
|
||||
.Replace("۷", "7")
|
||||
.Replace("۸", "8")
|
||||
.Replace("۹", "9")
|
||||
//iphone numeric
|
||||
.Replace("٠", "0")
|
||||
.Replace("١", "1")
|
||||
.Replace("٢", "2")
|
||||
.Replace("٣", "3")
|
||||
.Replace("٤", "4")
|
||||
.Replace("٥", "5")
|
||||
.Replace("٦", "6")
|
||||
.Replace("٧", "7")
|
||||
.Replace("٨", "8")
|
||||
.Replace("٩", "9");
|
||||
}
|
||||
|
||||
public static string FixPersianChars(this string str)
|
||||
{
|
||||
return str.Replace("ﮎ", "ک")
|
||||
.Replace("ﮏ", "ک")
|
||||
.Replace("ﮐ", "ک")
|
||||
.Replace("ﮑ", "ک")
|
||||
.Replace("ك", "ک")
|
||||
.Replace("ي", "ی")
|
||||
.Replace(" ", " ")
|
||||
.Replace("", " ")
|
||||
.Replace("ھ", "ه");//.Replace("ئ", "ی");
|
||||
}
|
||||
|
||||
public static string CleanString(this string str)
|
||||
{
|
||||
return str.Trim().FixPersianChars().Fa2En().NullIfEmpty();
|
||||
}
|
||||
|
||||
public static string NullIfEmpty(this string str)
|
||||
{
|
||||
return str?.Length == 0 ? null : str;
|
||||
}
|
||||
|
||||
public static string FixEmail(string email)
|
||||
{
|
||||
return email.Trim().ToLower();
|
||||
}
|
||||
|
||||
public static string GenerateGuid(int numOfCharacter)
|
||||
{
|
||||
return Guid.NewGuid().ToString("N").Substring(0, numOfCharacter);
|
||||
}
|
||||
|
||||
public static string CombineWith(this string[] array, char character)
|
||||
{
|
||||
string newString = "";
|
||||
foreach (var item in array)
|
||||
{
|
||||
if (newString == "")
|
||||
newString = item;
|
||||
else
|
||||
newString = newString + character + item;
|
||||
}
|
||||
return newString;
|
||||
}
|
||||
|
||||
public static int GetNumOfWeek(this string week)
|
||||
{
|
||||
string[] weekArray = { "شنبه", "یکشنبه", "دوشنبه", "سه شنبه", "چهار شنبه", "پنج شنبه", "جمعه" };
|
||||
return Array.IndexOf(weekArray, week);
|
||||
}
|
||||
|
||||
public static string[] GetMonth()
|
||||
{
|
||||
string[] month = { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند" };
|
||||
return month;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using HandyControl.Controls;
|
||||
|
||||
namespace WolfOfWallStreet.Helper
|
||||
{
|
||||
public static class ScrollHelper
|
||||
{
|
||||
public static bool GetAutoScroll(DependencyObject obj)
|
||||
{
|
||||
return (bool)obj.GetValue(AutoScrollProperty);
|
||||
}
|
||||
|
||||
public static void SetAutoScroll(DependencyObject obj, bool value)
|
||||
{
|
||||
obj.SetValue(AutoScrollProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AutoScrollProperty =
|
||||
DependencyProperty.RegisterAttached("AutoScroll", typeof(bool), typeof(ScrollHelper), new PropertyMetadata(false, AutoScrollPropertyChanged));
|
||||
|
||||
private static void AutoScrollPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var scrollViewer = d as ScrollViewer;
|
||||
|
||||
if (scrollViewer != null && (bool)e.NewValue)
|
||||
{
|
||||
scrollViewer.ScrollToBottom();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models
|
||||
{
|
||||
public class Account
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string Email { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models.EasyTrader
|
||||
{
|
||||
public class EasyTraderDraft
|
||||
{
|
||||
|
||||
public string isin { get; set; }
|
||||
public int financeId { get; set; }
|
||||
public int quantity { get; set; }
|
||||
public int price { get; set; }
|
||||
public int easyState { get; set; }
|
||||
public int side { get; set; }
|
||||
public int validityType { get; set; }
|
||||
public object validityDateJalali { get; set; }
|
||||
public string stockSymbol { get; set; }
|
||||
public int easySource { get; set; }
|
||||
public bool cautionAgreementSelected { get; set; }
|
||||
public string referenceKey { get; set; }
|
||||
public string responseErrorMessage { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class OnlinePlusDraft
|
||||
{
|
||||
public bool IsSymbolCautionAgreement { get; set; }
|
||||
public bool CautionAgreementSelected { get; set; }
|
||||
public bool IsSymbolSepahAgreement { get; set; }
|
||||
public bool SepahAgreementSelected { get; set; }
|
||||
public int orderCount { get; set; }
|
||||
public int orderPrice { get; set; }
|
||||
public int FinancialProviderId { get; set; }
|
||||
public string minimumQuantity { get; set; }
|
||||
public int maxShow { get; set; }
|
||||
public int orderId { get; set; }
|
||||
public string isin { get; set; }
|
||||
public int orderSide { get; set; }
|
||||
public int orderValidity { get; set; }
|
||||
public object orderValiditydate { get; set; }
|
||||
public bool shortSellIsEnabled { get; set; }
|
||||
public int shortSellIncentivePercent { get; set; }
|
||||
|
||||
public string Cocies { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models.EasyTrader
|
||||
{
|
||||
public class EasyTraderOrderResult
|
||||
{
|
||||
public bool isSuccessfull { get; set; }
|
||||
public string message { get; set; }
|
||||
public int omsOrderId { get; set; }
|
||||
public DateTime orderEntryDate { get; set; }
|
||||
public string orderEntryDateJalali { get; set; }
|
||||
public object omsErrorDescription { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models.EasyTrader
|
||||
{
|
||||
public class EasyTraderSymbol
|
||||
{
|
||||
public double minQuantityOrder { get; set; }
|
||||
public double maxQuantityOrder { get; set; }
|
||||
public int lowAllowedPrice { get; set; }
|
||||
public int highAllowedPrice { get; set; }
|
||||
public int bidPrice { get; set; }
|
||||
public int askPrice { get; set; }
|
||||
public bool isCaution { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models.MofidOnline
|
||||
{
|
||||
public class MofidOnlineOrder
|
||||
{
|
||||
public string Mode { get; set; }
|
||||
public string SymbolId { get; set; }
|
||||
public string OrderPrice { get; set; }
|
||||
public string OrderType { get; set; }
|
||||
public string OrderSide { get; set; }
|
||||
public string OrderValidity { get; set; }
|
||||
public string OrderValiditydate { get; set; }
|
||||
public string OrderTotalQuantity { get; set; }
|
||||
public string TriggerPrice { get; set; }
|
||||
public string MinimumQuantity { get; set; }
|
||||
public string MaxShown { get; set; }
|
||||
public string BourseCode { get; set; }
|
||||
public string isin { get; set; }
|
||||
public string pk { get; set; }
|
||||
public string OrderMode { get; set; }
|
||||
public string orderid { get; set; }
|
||||
public string OrderExpectedQuantity { get; set; }
|
||||
public object ts { get; set; }
|
||||
public string cs { get; set; }
|
||||
public string ss { get; set; }
|
||||
public string SymbolNsc { get; set; }
|
||||
public bool SendSMS { get; set; }
|
||||
public string browserTime { get; set; }
|
||||
public string IsSymbolInAgreement { get; set; }
|
||||
public bool AcceptedAgreement { get; set; }
|
||||
|
||||
public string Cookies { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Media;
|
||||
using MD.PersianDateTime.Standard;
|
||||
|
||||
namespace WolfOfWallStreet.Models.MofidOnline
|
||||
{
|
||||
public class MofidOnlineOrderResult
|
||||
{
|
||||
|
||||
public bool haserror { get; set; }
|
||||
public string Value { get; set; }
|
||||
public List<object> MetaData { get; set; }
|
||||
public bool IsFinish { get; set; }
|
||||
public int LastDate { get; set; }
|
||||
public bool ResetOrder { get; set; }
|
||||
|
||||
public DateTime GetDateTime { get; set; }
|
||||
|
||||
public string GetDateTimeStr
|
||||
{
|
||||
get
|
||||
{
|
||||
PersianDateTime dateTime = new PersianDateTime(GetDateTime);
|
||||
return dateTime.ToString("hh:mm:ss:fff");
|
||||
}
|
||||
}
|
||||
public string IsSuccessStr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (haserror==false)
|
||||
return "بلی";
|
||||
return "خیر";
|
||||
}
|
||||
}
|
||||
|
||||
public Brush StatusColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (haserror==false)
|
||||
return Brushes.ForestGreen;
|
||||
else
|
||||
return Brushes.OrangeRed;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models.MofidOnline
|
||||
{
|
||||
public class MofidOnlineSymbol
|
||||
{
|
||||
public bool isFuture { get; set; }
|
||||
public string nc { get; set; }
|
||||
public int ltp { get; set; }
|
||||
public int cp { get; set; }
|
||||
public int ht { get; set; }
|
||||
public int lt { get; set; }
|
||||
public int st { get; set; }
|
||||
public int gs { get; set; }
|
||||
public int pcp { get; set; }
|
||||
public string gc { get; set; }
|
||||
public int nst { get; set; }
|
||||
public int nt { get; set; }
|
||||
public long tv { get; set; }
|
||||
public string ltd { get; set; }
|
||||
public int mxp { get; set; }
|
||||
public int minprod { get; set; }
|
||||
public double pv { get; set; }
|
||||
public int vs { get; set; }
|
||||
public int hp { get; set; }
|
||||
public int lp { get; set; }
|
||||
public int rp { get; set; }
|
||||
public int bv { get; set; }
|
||||
public string est { get; set; }
|
||||
public int cp12 { get; set; }
|
||||
public string ect { get; set; }
|
||||
public int mp { get; set; }
|
||||
public string mt { get; set; }
|
||||
public int cpv { get; set; }
|
||||
public double cpvp { get; set; }
|
||||
public int lpv { get; set; }
|
||||
public double lpvp { get; set; }
|
||||
public int th { get; set; }
|
||||
public int tl { get; set; }
|
||||
public bool iscu { get; set; }
|
||||
public bool isagsp { get; set; }
|
||||
public bool iso { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models.OnlinePlus
|
||||
{
|
||||
public class OnlinePlusAccount
|
||||
{
|
||||
|
||||
public string Name { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string email { get; set; }
|
||||
public string Title { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models.OnlinePlus
|
||||
{
|
||||
public class OnlinePlusOrder
|
||||
{
|
||||
public bool IsSymbolCautionAgreement { get; set; }
|
||||
public bool CautionAgreementSelected { get; set; }
|
||||
public bool IsSymbolSepahAgreement { get; set; }
|
||||
public bool SepahAgreementSelected { get; set; }
|
||||
public int orderCount { get; set; }
|
||||
public int orderPrice { get; set; }
|
||||
public int FinancialProviderId { get; set; }
|
||||
public string minimumQuantity { get; set; }
|
||||
public int maxShow { get; set; }
|
||||
public int orderId { get; set; }
|
||||
public string isin { get; set; }
|
||||
public int orderSide { get; set; }
|
||||
public int orderValidity { get; set; }
|
||||
public object orderValiditydate { get; set; }
|
||||
public bool shortSellIsEnabled { get; set; }
|
||||
public int shortSellIncentivePercent { get; set; }
|
||||
|
||||
public string Cookies { get; set; }
|
||||
public string Rand { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Media;
|
||||
using MD.PersianDateTime.Standard;
|
||||
|
||||
namespace WolfOfWallStreet.Models.OnlinePlus
|
||||
{
|
||||
public class OnlinePlusOrderResult
|
||||
{
|
||||
public bool IsSuccessfull { get; set; }
|
||||
public string MessageDesc { get; set; }
|
||||
public object MessageCode { get; set; }
|
||||
public object Data { get; set; }
|
||||
public int Version { get; set; }
|
||||
public DateTime GetDateTime { get; set; }
|
||||
|
||||
public string GetDateTimeStr
|
||||
{
|
||||
get
|
||||
{
|
||||
PersianDateTime dateTime = new PersianDateTime(GetDateTime);
|
||||
return dateTime.ToString("hh:mm:ss:fff");
|
||||
}
|
||||
}
|
||||
|
||||
public string IsSuccessStr
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsSuccessfull)
|
||||
return "بلی";
|
||||
return "خیر";
|
||||
}
|
||||
}
|
||||
|
||||
public Brush StatusColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsSuccessfull)
|
||||
return Brushes.ForestGreen;
|
||||
else
|
||||
return Brushes.OrangeRed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models.OnlinePlus
|
||||
{
|
||||
public class OnlinePlusRoot<T>
|
||||
{
|
||||
|
||||
public bool IsSuccessfull { get; set; }
|
||||
public object MessageDesc { get; set; }
|
||||
public object MessageCode { get; set; }
|
||||
public T Data { get; set; }
|
||||
public int Version { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models.OnlinePlus
|
||||
{
|
||||
|
||||
public class OnlinePlusSymbol
|
||||
{
|
||||
public OnlinePlusSymbolInfo symbolinfo { get; set; }
|
||||
public OnlinePlusSymbolQueue symbolqueue { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
public class OnlinePlusSymbolInfo
|
||||
{
|
||||
public bool isFuture { get; set; }
|
||||
public string nc { get; set; }
|
||||
public int ltp { get; set; }
|
||||
public int cp { get; set; }
|
||||
public int ht { get; set; }
|
||||
public int lt { get; set; }
|
||||
public int st { get; set; }
|
||||
public int gs { get; set; }
|
||||
public int pcp { get; set; }
|
||||
public string gc { get; set; }
|
||||
public int nst { get; set; }
|
||||
public int nt { get; set; }
|
||||
public long tv { get; set; }
|
||||
public string ltd { get; set; }
|
||||
public int mxp { get; set; }
|
||||
public int minprod { get; set; }
|
||||
public double pv { get; set; }
|
||||
public int vs { get; set; }
|
||||
public int hp { get; set; }
|
||||
public int lp { get; set; }
|
||||
public int rp { get; set; }
|
||||
public int bv { get; set; }
|
||||
public string est { get; set; }
|
||||
public int cp12 { get; set; }
|
||||
public string ect { get; set; }
|
||||
public double opts { get; set; }
|
||||
public int mp { get; set; }
|
||||
public object mt { get; set; }
|
||||
public int cpv { get; set; }
|
||||
public double cpvp { get; set; }
|
||||
public int lpv { get; set; }
|
||||
public double lpvp { get; set; }
|
||||
public int th { get; set; }
|
||||
public int tl { get; set; }
|
||||
public bool iscu { get; set; }
|
||||
public bool isagsp { get; set; }
|
||||
public string ic { get; set; }
|
||||
public bool iso { get; set; }
|
||||
}
|
||||
|
||||
public class OnlinePlusSymbolValue
|
||||
{
|
||||
public int BestBuyPrice { get; set; }
|
||||
public int BestSellPrice { get; set; }
|
||||
public int BestSellQuantity { get; set; }
|
||||
public int BestBuyQuantity { get; set; }
|
||||
public int NoBestBuy { get; set; }
|
||||
public int NoBestSell { get; set; }
|
||||
public string NSCCode { get; set; }
|
||||
public int Place { get; set; }
|
||||
}
|
||||
|
||||
public class OnlinePlusSymbolQueue
|
||||
{
|
||||
public List<OnlinePlusSymbolValue> Value { get; set; }
|
||||
|
||||
public OnlinePlusSymbolValue FValue
|
||||
{
|
||||
get { return Value.First(); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models
|
||||
{
|
||||
public static class Stock
|
||||
{
|
||||
public static int PoonsadHezari { get; set; } = 6000000;
|
||||
public static int YekMelioni { get; set; } = 10000000;
|
||||
public static int YekONimMelioni { get; set; } = 15000000;
|
||||
public static int DoMelioni { get; set; } = 20000000;
|
||||
public static int DoONimMelioni { get; set; } = 25000000;
|
||||
public static int SeMelioni { get; set; } = 30000000;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WolfOfWallStreet.Models
|
||||
{
|
||||
public class Symbol
|
||||
{
|
||||
public string SymbolName { get; set; }
|
||||
public string symbolISIN { get; set; }
|
||||
public int totalNumberOfTrades { get; set; }
|
||||
public double totalTradeValue { get; set; }
|
||||
public double firstTradedPrice { get; set; }
|
||||
public string tradeDate { get; set; }
|
||||
public string marketUnit { get; set; }
|
||||
public double basisVolume { get; set; }
|
||||
public double eps { get; set; }
|
||||
public double pe { get; set; }
|
||||
public double e30 { get; set; }
|
||||
public int lastTradedPrice { get; set; }
|
||||
public DateTime tradeDateTime { get; set; }
|
||||
public object cancelNav { get; set; }
|
||||
public string cancelNavDate { get; set; }
|
||||
public string fYear { get; set; }
|
||||
public double floatPercent { get; set; }
|
||||
public double volume90Avg { get; set; }
|
||||
public int maxPercentChange { get; set; }
|
||||
public double gpe { get; set; }
|
||||
public int closingPrice { get; set; }
|
||||
public double highPrice { get; set; }
|
||||
public double lowPrice { get; set; }
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WolfOfWallStreet.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string Symbols {
|
||||
get {
|
||||
return ((string)(this["Symbols"]));
|
||||
}
|
||||
set {
|
||||
this["Symbols"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="WolfOfWallStreet.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Symbols" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WolfOfWallStreet.Services.Contracts
|
||||
{
|
||||
public interface IBrokerService
|
||||
{
|
||||
Task SendOrder();
|
||||
Task<T> GetSymbolInfo<T>(string isin);
|
||||
Task<T> GetSymbolOrderBase<T>(string isin);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Models.EasyTrader;
|
||||
|
||||
namespace WolfOfWallStreet.Services.Contracts
|
||||
{
|
||||
public interface IEasyTraderService
|
||||
{
|
||||
Task<EasyTraderOrderResult> SendOrder(string auth, EasyTraderDraft draft);
|
||||
Task<EasyTraderDraft> GetSymbolInfo(string auth,string isin);
|
||||
Task<EasyTraderDraft> GetSymbolOrderBase(string auth, Symbol symbol, long stockPrice);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Models.MofidOnline;
|
||||
|
||||
namespace WolfOfWallStreet.Services.Contracts
|
||||
{
|
||||
public interface IMofidOnlineService
|
||||
{
|
||||
Task<MofidOnlineOrderResult> SendOrder(MofidOnlineOrder draft);
|
||||
Task<MofidOnlineSymbol> GetSymbolOrderBase(Symbol symbol, long stockPrice);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Models.OnlinePlus;
|
||||
|
||||
namespace WolfOfWallStreet.Services.Contracts
|
||||
{
|
||||
public interface IOnlinePlusService
|
||||
{
|
||||
Task<OnlinePlusOrderResult> SendOrder(OnlinePlusOrder draft);
|
||||
Task<OnlinePlusSymbol> GetSymbolOrderBase(Symbol symbol, long stockPrice);
|
||||
Task<OnlinePlusAccount> GetAccounTask(string cookiesOrAuth);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using RestSharp;
|
||||
using WolfOfWallStreet.Extensions;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Models.EasyTrader;
|
||||
using WolfOfWallStreet.Services.Contracts;
|
||||
namespace WolfOfWallStreet.Services
|
||||
{
|
||||
public class EasyTraderService : IEasyTraderService
|
||||
{
|
||||
private int server = 11;
|
||||
public async Task<EasyTraderOrderResult> SendOrder(string auth, EasyTraderDraft draft)
|
||||
{
|
||||
RestClient loginClient = new RestClient();
|
||||
RestRequest draftRequest =
|
||||
new RestRequest(new Uri($"https://api.cl3.mofid.dev/easy/api/OmsOrder"), Method.POST);
|
||||
draftRequest.AddHeader("Accept", "application/json, text/plain, */*");
|
||||
draftRequest.AddHeader("Authorization", auth);
|
||||
draftRequest.AddHeader("User-Agent",
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 OPR/68.0.3618.173");
|
||||
draftRequest.AddHeader("Referer", "https://d.easytrader.emofid.com/");
|
||||
draftRequest.AddHeader("Content-Type", "application/json");
|
||||
draftRequest.AddJsonBody(new EasyTraderDraft
|
||||
{
|
||||
cautionAgreementSelected = false,
|
||||
easySource = 1,
|
||||
easyState = 7,
|
||||
financeId = 1,
|
||||
isin = draft.isin,
|
||||
price = draft.price,
|
||||
quantity = draft.quantity,
|
||||
referenceKey = $"{StringExtensions.GenerateGuid(8)}-3ff5-{StringExtensions.GenerateGuid(4)}-99f4-{StringExtensions.GenerateGuid(8)}",
|
||||
side = 0,
|
||||
stockSymbol = draft.stockSymbol,
|
||||
validityDateJalali = null,
|
||||
validityType = 74
|
||||
});
|
||||
var res = loginClient.Execute<EasyTraderOrderResult>(draftRequest,Method.POST);
|
||||
if (res.IsSuccessful)
|
||||
{
|
||||
return res.Data;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<EasyTraderDraft> GetSymbolInfo(string auth, string isin)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task<EasyTraderDraft> GetSymbolOrderBase(string auth, Symbol symbol, long stockPrice)
|
||||
{
|
||||
RestClient loginClient = new RestClient();
|
||||
RestRequest draftRequest =
|
||||
new RestRequest(new Uri($"https://d{server}.emofid.com/easy/api/MarketData/GetSymbolDetailsData/{symbol.symbolISIN}/StockOrderData"), Method.GET);
|
||||
draftRequest.AddHeader("Accept", "application/json, text/plain, */*");
|
||||
draftRequest.AddHeader("Authorization", auth);
|
||||
draftRequest.AddHeader("User-Agent",
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 OPR/68.0.3618.173");
|
||||
draftRequest.AddHeader("Referer", "https://d.easytrader.emofid.com/");
|
||||
draftRequest.AddHeader("Content-Type", "application/json");
|
||||
var res = await loginClient.ExecuteGetAsync<EasyTraderSymbol>(draftRequest);
|
||||
if (res.IsSuccessful)
|
||||
{
|
||||
return new EasyTraderDraft
|
||||
{
|
||||
price = (int)res.Data.highAllowedPrice,
|
||||
stockSymbol = symbol.SymbolName,
|
||||
quantity = (int)(stockPrice / res.Data.highAllowedPrice) + 2,
|
||||
isin = symbol.symbolISIN
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using RestSharp;
|
||||
using WolfOfWallStreet.Extensions;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Models.MofidOnline;
|
||||
using WolfOfWallStreet.Models.OnlinePlus;
|
||||
using WolfOfWallStreet.Services.Contracts;
|
||||
|
||||
namespace WolfOfWallStreet.Services
|
||||
{
|
||||
public class MofidOnlineService : IMofidOnlineService
|
||||
{
|
||||
public async Task<MofidOnlineOrderResult> SendOrder(MofidOnlineOrder draft)
|
||||
{
|
||||
RestClient client = new RestClient();
|
||||
RestRequest request = new RestRequest(new Uri($"https://mofidonline.com/9/0/SiteCustomerHandler.ashx?lan=fa&.rand=2c70981681bb45138629b0f1b82be55d"), Method.POST);
|
||||
request.AddHeader("authority", "mofidonline.com");
|
||||
request.AddHeader("method", "POST");
|
||||
request.AddHeader("path", $"/9/0/SiteCustomerHandler.ashx?lan=fa&.rand={StringExtensions.GenerateGuid(32)}");
|
||||
request.AddHeader("scheme", "https");
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("accept-encoding", "gzip, deflate, br");
|
||||
request.AddHeader("accept-language", "en-US,en;q=0.9");
|
||||
request.AddHeader("content-length", "170");
|
||||
request.AddHeader("origin", "https://mofidonline.com");
|
||||
request.AddHeader("referer", "https://mofidonline.com/Customer/AddOrder?cr=fbff775e469a4e4d8922e6cc0fe80215&lan=fa");
|
||||
request.AddHeader("sec-fetch-dest", "empty");
|
||||
request.AddHeader("sec-fetch-mode", "cors");
|
||||
request.AddHeader("content-type", "application/x-www-form-urlencoded; charset=UTF-8");
|
||||
request.AddHeader("sec-fetch-site", "same-origin");
|
||||
request.AddHeader("user-agent",
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 OPR/69.0.3686.95");
|
||||
request.AddHeader("x-requested-with", "XMLHttpRequest");
|
||||
foreach (var str in draft.Cookies.Split(' '))
|
||||
{
|
||||
var value = str.Split('=').Last();
|
||||
request.AddCookie(str.Split('=').First(), value.Substring(0, value.Length - 1));
|
||||
}
|
||||
request.AddJsonBody(new MofidOnlineOrder
|
||||
{
|
||||
Mode = "buysell",
|
||||
SymbolId = draft.SymbolId,
|
||||
OrderPrice = draft.OrderPrice,
|
||||
OrderType = "76",
|
||||
OrderSide = "65",
|
||||
OrderValidity = "74",
|
||||
OrderValiditydate = "",
|
||||
OrderTotalQuantity = draft.OrderTotalQuantity,
|
||||
TriggerPrice = "",
|
||||
MinimumQuantity = "",
|
||||
MaxShown = "",
|
||||
BourseCode = "",
|
||||
isin = "",
|
||||
pk = "TBRFinancialDataProvider",
|
||||
OrderMode = "add",
|
||||
orderid = "0",
|
||||
OrderExpectedQuantity = "0",
|
||||
ts = null,
|
||||
cs = "",
|
||||
ss = null,
|
||||
SymbolNsc = draft.SymbolNsc,
|
||||
SendSMS = false,
|
||||
browserTime = DateTime.Now.ToString("T"),
|
||||
IsSymbolInAgreement = "false",
|
||||
AcceptedAgreement = false
|
||||
});
|
||||
|
||||
var rest = client.Execute<MofidOnlineOrderResult>(request, Method.POST);
|
||||
if (rest.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
if (rest.Data != null)
|
||||
return rest.Data;
|
||||
else
|
||||
{
|
||||
var data = JsonConvert.DeserializeObject<MofidOnlineOrderResult>(rest.Content);
|
||||
data.GetDateTime = DateTime.Now;
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<MofidOnlineSymbol> GetSymbolOrderBase(Symbol symbol, long stockPrice)
|
||||
{
|
||||
RestClient client = new RestClient();
|
||||
RestRequest request = new RestRequest(new Uri($"https://core.tadbirrlc.com//StockFutureInfoHandler.ashx?%7B%22Type%22:%22getSymbolFullInfo%22,%22la%22:%22fa%22,%22nscCode%22:%22{symbol.symbolISIN}%22%7D&"), Method.GET);
|
||||
request.AddHeader("authority", "core.tadbirrlc.com");
|
||||
request.AddHeader("method", "POST");
|
||||
request.AddHeader("path", $"//StockFutureInfoHandler.ashx");
|
||||
request.AddHeader("scheme", "https");
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("accept-encoding", "gzip, deflate, br");
|
||||
request.AddHeader("accept-language", "en-US,en;q=0.9");
|
||||
request.AddHeader("content-length", "170");
|
||||
request.AddHeader("origin", "https://mofidonline.com");
|
||||
request.AddHeader("referer", " https://mofidonline.com/Customer/AddOrder?cr=fbff775e469a4e4d8922e6cc0fe80215&lan=fa");
|
||||
request.AddHeader("sec-fetch-dest", "empty");
|
||||
request.AddHeader("sec-fetch-mode", "cors");
|
||||
request.AddHeader("content-type", "application/x-www-form-urlencoded; charset=UTF-8");
|
||||
request.AddHeader("sec-fetch-site", "same-origin");
|
||||
request.AddHeader("user-agent",
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 OPR/69.0.3686.95");
|
||||
request.AddHeader("x-requested-with", "XMLHttpRequest");
|
||||
|
||||
var rest = client.Execute<MofidOnlineSymbol>(request, Method.GET);
|
||||
if (rest.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
MofidOnlineSymbol data;
|
||||
if (rest.Data != null)
|
||||
data = rest.Data;
|
||||
else
|
||||
data = Newtonsoft.Json.JsonConvert.DeserializeObject<MofidOnlineSymbol>(rest.Content);
|
||||
data.Quantity = (int)(stockPrice / data.ht)+2;
|
||||
return data;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using RestSharp;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Models.OnlinePlus;
|
||||
using WolfOfWallStreet.Services.Contracts;
|
||||
|
||||
namespace WolfOfWallStreet.Services
|
||||
{
|
||||
public class OnlinePlusService : IOnlinePlusService
|
||||
{
|
||||
public async Task<OnlinePlusOrderResult> SendOrder(OnlinePlusOrder draft)
|
||||
{
|
||||
RestClient client = new RestClient();
|
||||
RestRequest request = new RestRequest(new Uri($"https://api2.mofidonline.com/Web/V1/Order/Post"), Method.POST);
|
||||
request.AddHeader("authority", "api2.mofidonline.com");
|
||||
request.AddHeader("method", "POST");
|
||||
request.AddHeader("path", "/Web/V1/Order/Post");
|
||||
request.AddHeader("scheme", "https");
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("accept-encoding", "gzip, deflate, br");
|
||||
request.AddHeader("accept-language", "en-US,en;q=0.9");
|
||||
request.AddHeader("content-length", "170");
|
||||
request.AddHeader("authorization", "BasicAuthentication 2cc57a2a-a099-4ce5-8cb8-ef139fabe973");
|
||||
request.AddHeader("origin", "https://onlineplus.mofidonline.com");
|
||||
request.AddHeader("referer", "https://onlineplus.mofidonline.com/Home/Default/page-1");
|
||||
request.AddHeader("sec-fetch-dest", "empty");
|
||||
request.AddHeader("sec-fetch-mode", "cors");
|
||||
request.AddHeader("content-type", "application/json");
|
||||
request.AddHeader("sec-fetch-site", "same-origin");
|
||||
request.AddHeader("user-agent",
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 OPR/69.0.3686.95");
|
||||
request.AddHeader("x-requested-with", "XMLHttpRequest");
|
||||
request.AddJsonBody(new OnlinePlusOrder
|
||||
{
|
||||
CautionAgreementSelected = false,
|
||||
FinancialProviderId = 1,
|
||||
IsSymbolCautionAgreement = false,
|
||||
IsSymbolSepahAgreement = false,
|
||||
SepahAgreementSelected = false,
|
||||
isin = draft.isin,
|
||||
maxShow = 0,
|
||||
minimumQuantity = "",
|
||||
orderCount = draft.orderCount,
|
||||
orderId = 0,
|
||||
orderPrice = draft.orderPrice,
|
||||
orderSide = 65,
|
||||
orderValidity = 74,
|
||||
orderValiditydate = null,
|
||||
shortSellIncentivePercent = 0,
|
||||
shortSellIsEnabled = false,
|
||||
});
|
||||
|
||||
var rest = client.Execute<OnlinePlusOrderResult>(request,Method.POST);
|
||||
if (rest.IsSuccessful)
|
||||
{
|
||||
var date = rest.Data;
|
||||
date.GetDateTime = DateTime.Now;
|
||||
if (date.MessageDesc!=null&&date.MessageDesc.Contains("محدودیت ارسال سفارش در ثانیه"))
|
||||
return null;
|
||||
return date;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public async Task<OnlinePlusSymbol> GetSymbolOrderBase(Symbol symbol, long stockPrice)
|
||||
{
|
||||
RestClient client = new RestClient();
|
||||
RestRequest request = new RestRequest(new Uri($"https://core.tadbirrlc.com//StockFutureInfoHandler.ashx?%7B%22Type%22:%22getLightSymbolInfoAndQueue%22,%22la%22:%22Fa%22,%22nscCode%22:%22{symbol.symbolISIN}%22%7D&jsoncallback="), Method.GET);
|
||||
|
||||
request.AddHeader("authority", "onlineplus.mofidonline.com");
|
||||
request.AddHeader("method", "POST");
|
||||
request.AddHeader("path", "/Customer/SendOrder");
|
||||
request.AddHeader("scheme", "https");
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("accept-encoding", "gzip, deflate, br");
|
||||
request.AddHeader("accept-language", "en-US,en;q=0.9");
|
||||
request.AddHeader("content-length", "170");
|
||||
request.AddHeader("origin", "https://onlineplus.mofidonline.com");
|
||||
request.AddHeader("referer", "https://onlineplus.mofidonline.com/Home/Default/page-1");
|
||||
request.AddHeader("sec-fetch-dest", "empty");
|
||||
request.AddHeader("sec-fetch-mode", "cors");
|
||||
request.AddHeader("content-type", "application/json");
|
||||
request.AddHeader("sec-fetch-site", "same-origin");
|
||||
request.AddHeader("user-agent",
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 OPR/69.0.3686.95");
|
||||
request.AddHeader("x-requested-with", "XMLHttpRequest");
|
||||
|
||||
var res = client.Execute<OnlinePlusSymbol>(request, Method.GET);
|
||||
if (res.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
var data = Newtonsoft.Json.JsonConvert.DeserializeObject<OnlinePlusSymbol>(res.Content);
|
||||
data.Quantity = (int)(stockPrice / data.symbolinfo.ht);
|
||||
return data;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<OnlinePlusAccount> GetAccounTask(string cookiesOrAuth)
|
||||
{
|
||||
RestClient client = new RestClient();
|
||||
RestRequest request = new RestRequest(new Uri($"https://www.mofidonline.com/Handlers/GetAccountRemain.ashx"), Method.POST);
|
||||
request.AddHeader("authority", "www.mofidonline.com");
|
||||
request.AddHeader("method", "GET");
|
||||
request.AddHeader("path", "/Handlers/GetAccountRemain.ashx");
|
||||
request.AddHeader("scheme", "https");
|
||||
request.AddHeader("Accept", "*/*");
|
||||
request.AddHeader("accept-encoding", "gzip, deflate, br");
|
||||
request.AddHeader("accept-language", "en-US,en;q=0.9");
|
||||
request.AddHeader("referer", "https://www.mofidonline.com/Home/userprofile");
|
||||
request.AddHeader("sec-fetch-dest", "empty");
|
||||
request.AddHeader("sec-fetch-mode", "cors");
|
||||
request.AddHeader("content-type", "application/json");
|
||||
request.AddHeader("sec-fetch-site", "same-origin");
|
||||
request.AddHeader("user-agent",
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36 OPR/69.0.3686.95");
|
||||
request.AddHeader("x-requested-with", "XMLHttpRequest");
|
||||
foreach (var str in cookiesOrAuth.Split(' '))
|
||||
{
|
||||
var value = str.Split('=').Last();
|
||||
request.AddCookie(str.Split('=').First(), value.Substring(0, value.Length - 1));
|
||||
}
|
||||
|
||||
var rest = client.Execute<OnlinePlusRoot<OnlinePlusAccount>>(request, Method.POST);
|
||||
if (rest.IsSuccessful)
|
||||
{
|
||||
var date = rest.Data.Data;
|
||||
return date;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Properties;
|
||||
|
||||
namespace WolfOfWallStreet.Services
|
||||
{
|
||||
public class SettingsServices
|
||||
{
|
||||
public SettingsServices()
|
||||
{
|
||||
List<Symbol> Symbols = new List<Symbol>();
|
||||
try
|
||||
{
|
||||
Symbols = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Symbol>>(Settings.Default.Symbols);
|
||||
if(Symbols==null)
|
||||
Symbols = new List<Symbol>();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Symbols = new List<Symbol>();
|
||||
}
|
||||
|
||||
if (Symbols.Count == 0)
|
||||
{
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "سیتا",
|
||||
symbolISIN = "IRO1SITA0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "آریا",
|
||||
symbolISIN = "IRO3APOZ0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "پیزد",
|
||||
symbolISIN = "IRO3YZTZ0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "آبادا",
|
||||
symbolISIN = "IRO1NBAB0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "شتران",
|
||||
symbolISIN = "IRO1PTEH0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "های وب",
|
||||
symbolISIN = "IRO1HWEB0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "خگستر",
|
||||
symbolISIN = "IRO1GOST0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "شگویا",
|
||||
symbolISIN = "IRO3TPEZ0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "ولپارس",
|
||||
symbolISIN = "IRO1LPRS0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "ونیکی",
|
||||
symbolISIN = "IRO1NIKI0001"
|
||||
});
|
||||
Symbols.Add(new Symbol
|
||||
{
|
||||
SymbolName = "شستا",
|
||||
symbolISIN = "IRO1TAMN0001"
|
||||
});
|
||||
Settings.Default.Symbols = Newtonsoft.Json.JsonConvert.SerializeObject(Symbols);
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
public List<Symbol> GetSymbols()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var symbols = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Symbol>>(Settings.Default.Symbols);
|
||||
return symbols;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return new List<Symbol>();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddSymbol(Symbol symbol)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var symbols = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Symbol>>(Settings.Default.Symbols);
|
||||
symbols.Add(symbol);
|
||||
Settings.Default.Symbols = Newtonsoft.Json.JsonConvert.SerializeObject(symbols);
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
var symbols = new List<Symbol>();
|
||||
symbols.Add(symbol);
|
||||
Settings.Default.Symbols = Newtonsoft.Json.JsonConvert.SerializeObject(symbols);
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RemoveSymbol(Symbol symbol)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var symbols = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Symbol>>(Settings.Default.Symbols);
|
||||
symbols.Remove(symbols.FirstOrDefault(s=>s.symbolISIN==symbol.symbolISIN));
|
||||
Settings.Default.Symbols = Newtonsoft.Json.JsonConvert.SerializeObject(symbols);
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
using Prism.Commands;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Models.EasyTrader;
|
||||
using WolfOfWallStreet.Properties;
|
||||
using WolfOfWallStreet.Services;
|
||||
using WolfOfWallStreet.Services.Contracts;
|
||||
|
||||
namespace WolfOfWallStreet.ViewModels
|
||||
{
|
||||
public class EasyTraderControllerViewModel : ViewModelBase
|
||||
{
|
||||
private readonly SettingsServices _settingsServices;
|
||||
private readonly IEasyTraderService _easyTraderService;
|
||||
private EasyTraderDraft easyTraderDraft;
|
||||
public EasyTraderDraft EasyTraderDraft
|
||||
{
|
||||
get { return easyTraderDraft; }
|
||||
set { SetProperty(ref easyTraderDraft, value); }
|
||||
}
|
||||
|
||||
private string auth;
|
||||
public string Auth
|
||||
{
|
||||
get { return auth; }
|
||||
set { SetProperty(ref auth, value , nameof(Auth)); }
|
||||
}
|
||||
private string email;
|
||||
public string Email
|
||||
{
|
||||
get { return email; }
|
||||
set { SetProperty(ref email, value, nameof(Email)); }
|
||||
}
|
||||
private string phoneNumber;
|
||||
public string PhoneNumber
|
||||
{
|
||||
get { return phoneNumber; }
|
||||
set { SetProperty(ref phoneNumber, value, nameof(PhoneNumber)); }
|
||||
}
|
||||
|
||||
public bool Ordered { get; set; } = true;
|
||||
private int server;
|
||||
public int Server
|
||||
{
|
||||
get { return server; }
|
||||
set { SetProperty(ref server, value); }
|
||||
}
|
||||
|
||||
public ObservableCollection<Symbol> Symbols { get; set; } = new ObservableCollection<Symbol>();
|
||||
public ICommand SelectSymbolCommand { get; set; }
|
||||
public ICommand SendOrderCommand { get; set; }
|
||||
public ICommand StopOrderCommand { get; set; }
|
||||
public ICommand ClearOrdersCommand { get; set; }
|
||||
public ObservableCollection<EasyTraderOrderResult> Results { get; set; }=new ObservableCollection<EasyTraderOrderResult>();
|
||||
|
||||
public EasyTraderControllerViewModel(SettingsServices settingsServices , IEasyTraderService easyTraderService)
|
||||
{
|
||||
_settingsServices = settingsServices;
|
||||
_easyTraderService = easyTraderService;
|
||||
_settingsServices.GetSymbols().ForEach(s => Symbols.Add(s));
|
||||
|
||||
}
|
||||
|
||||
public override void InitialCommand()
|
||||
{
|
||||
base.InitialCommand();
|
||||
SelectSymbolCommand= new DelegateCommand<Symbol>(async symbol =>
|
||||
{
|
||||
EasyTraderDraft = await _easyTraderService.GetSymbolOrderBase(Auth, symbol, 11000000);
|
||||
});
|
||||
SendOrderCommand = new DelegateCommand(async () =>
|
||||
{
|
||||
Ordered = true;
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Thread thread = new Thread(SendOrder);
|
||||
thread.Start();
|
||||
}
|
||||
});
|
||||
StopOrderCommand = new DelegateCommand(() => { Ordered = false; });
|
||||
ClearOrdersCommand = new DelegateCommand(() => { Results.Clear(); });
|
||||
}
|
||||
|
||||
async void SendOrder()
|
||||
{
|
||||
|
||||
while (Ordered)
|
||||
{
|
||||
var res = await _easyTraderService.SendOrder(Auth, EasyTraderDraft);
|
||||
Application.Current.Dispatcher.Invoke(() => Results.Add(res));
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool SetProperty<T>(ref T storage, T value, string propertyName = null)
|
||||
{
|
||||
bool flag = base.SetProperty(ref storage, value, propertyName);
|
||||
if (propertyName == nameof(Auth))
|
||||
{
|
||||
DecodeJwt();
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
private void DecodeJwt()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(auth))
|
||||
{
|
||||
var stream = auth.Replace("Bearer","").Trim();
|
||||
/*var handler = new JwtSecurityTokenHandler();var
|
||||
jsonToken = handler.ReadToken(stream);
|
||||
var tokenS = handler.ReadToken(stream) as JwtSecurityToken;*/
|
||||
var token = new System.IdentityModel.Tokens.Jwt.JwtSecurityToken(stream);
|
||||
Email = token.Claims.FirstOrDefault(c => c.Type == "email")?.Value;
|
||||
PhoneNumber = token.Claims.FirstOrDefault(c => c.Type == "phone_number")?.Value;
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
using Prism.Commands;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using RestSharp;
|
||||
using WolfOfWallStreet.Extensions;
|
||||
using WolfOfWallStreet.Models;
|
||||
using MessageBox = HandyControl.Controls.MessageBox;
|
||||
|
||||
namespace WolfOfWallStreet.ViewModels
|
||||
{
|
||||
public class MainPageViewModel : ViewModelBase
|
||||
{
|
||||
public MainPageViewModel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
using Prism.Mvvm;
|
||||
using Prism.Regions;
|
||||
using WolfOfWallStreet.Views;
|
||||
|
||||
namespace WolfOfWallStreet.ViewModels
|
||||
{
|
||||
public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
public MainWindowViewModel(IRegionManager manager):base(manager)
|
||||
{
|
||||
RegionManager.RegisterViewWithRegion("ContentRegion", typeof(MainPage));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
using Prism.Commands;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Models.MofidOnline;
|
||||
using WolfOfWallStreet.Models.OnlinePlus;
|
||||
using WolfOfWallStreet.Services;
|
||||
using WolfOfWallStreet.Services.Contracts;
|
||||
using MessageBox = HandyControl.Controls.MessageBox;
|
||||
|
||||
namespace WolfOfWallStreet.ViewModels
|
||||
{
|
||||
public class MofidOnlineControllerViewModel : ViewModelBase
|
||||
{
|
||||
private readonly SettingsServices _settingsServices;
|
||||
private readonly IMofidOnlineService _mofidOnlineService;
|
||||
public MofidOnlineOrder MoOrder { get; set; } = new MofidOnlineOrder();
|
||||
public bool Ordered = true;
|
||||
public ICommand SendOrderCommand { get; set; }
|
||||
public ICommand SelectSymbolCommand { get; set; }
|
||||
public ICommand StopOrderCommand { get; set; }
|
||||
public ICommand ClearOrdersCommand { get; set; }
|
||||
public int Stock { get; set; }
|
||||
|
||||
private MofidOnlineSymbol _mofidOnlineSymbol;
|
||||
public MofidOnlineSymbol MofidOnlineSymbol
|
||||
{
|
||||
get { return _mofidOnlineSymbol; }
|
||||
set { SetProperty(ref _mofidOnlineSymbol, value); }
|
||||
}
|
||||
|
||||
public ObservableCollection<Symbol> Symbols { get; set; } = new ObservableCollection<Symbol>();
|
||||
public ObservableCollection<MofidOnlineOrderResult> OrderResults { get; set; } = new ObservableCollection<MofidOnlineOrderResult>();
|
||||
public MofidOnlineControllerViewModel(SettingsServices settingsServices , IMofidOnlineService mofidOnlineService)
|
||||
{
|
||||
_settingsServices = settingsServices;
|
||||
_mofidOnlineService = mofidOnlineService;
|
||||
_settingsServices.GetSymbols().ForEach(s=>Symbols.Add(s));
|
||||
MoOrder.Cookies =
|
||||
"_ga=GA1.2.425920926.1593494313; _gid=GA1.2.467195288.1596362017; ASP.NET_SessionId=umwh11qs2uqamsejqzylsow5; crisp-client%2Fsession%2Fe95056ad-2681-452d-976d-0c2a304165c9=session_1cd28bbf-3aa4-4c96-b069-313739c186a0; Token=5d18d4ca-6e0a-4821-8e43-03347dfd2aa2; .ASPXAUTH=D35126B56A8F94324B69FC0A9389F5B4CC6DDF28F8CDAFC4903D8962BFC57CA15A98712B461428FEBD51D7729EA10C77A3B9406EA2EAE241DCDE583BF5C09A3AD8F1FF4AC8963E3BA764B1FED54C8D1FB8B70803F5D9B1507B2313D521AF6A72E657F74A3E707E563CAF60C20BB47017B5A5BD7A012F96C2B4BE5ADC8D51705A7888E255F90EE7BDDCACC953CD8C7DA09A1C2CDD; LS6_https_1603_https%3A%2F%2Fpush2v7.etadbir.com%2F=|485_TadbirConnection|; LS6_https_1603_TadbirConnection=|485|; LS6_https_1603_485_TadbirConnection=1596619228044|C|LS6__mofidonline_com_485_TadbirConnection|mofidonline.com";
|
||||
|
||||
}
|
||||
|
||||
public override void InitialCommand()
|
||||
{
|
||||
base.InitialCommand();
|
||||
SelectSymbolCommand = new DelegateCommand<Symbol>(async (symbol) =>
|
||||
{
|
||||
MofidOnlineSymbol = await _mofidOnlineService.GetSymbolOrderBase(symbol, Stock);
|
||||
});
|
||||
SendOrderCommand = new DelegateCommand(async () =>
|
||||
{
|
||||
Ordered = true;
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
Thread thr = new Thread(SendOrder);
|
||||
thr.Start();
|
||||
}
|
||||
});
|
||||
StopOrderCommand = new DelegateCommand(() => Ordered=false);
|
||||
ClearOrdersCommand = new DelegateCommand(()=>OrderResults.Clear());
|
||||
}
|
||||
|
||||
async void SendOrder()
|
||||
{
|
||||
while (Ordered)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(MoOrder.Cookies))
|
||||
throw new Exception("کوکی های درخواست را وارد کنید");
|
||||
MoOrder.OrderPrice = MofidOnlineSymbol.ht.ToString();
|
||||
MoOrder.OrderTotalQuantity = MofidOnlineSymbol.Quantity.ToString();
|
||||
MoOrder.SymbolNsc = MofidOnlineSymbol.nc;
|
||||
MoOrder.SymbolId = "";
|
||||
MofidOnlineOrderResult res;
|
||||
res = await _mofidOnlineService.SendOrder(MoOrder);
|
||||
if (res != null)
|
||||
{
|
||||
if(res.Value.Contains("محدودیت ارسال سفارش در ثانیه") == false)
|
||||
Application.Current.Dispatcher.Invoke(() => OrderResults.Add(res));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
using Prism.Commands;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Models.OnlinePlus;
|
||||
using WolfOfWallStreet.Services;
|
||||
using WolfOfWallStreet.Services.Contracts;
|
||||
using MessageBox = HandyControl.Controls.MessageBox;
|
||||
|
||||
namespace WolfOfWallStreet.ViewModels
|
||||
{
|
||||
public class OnlinePlusControllerViewModel : ViewModelBase
|
||||
{
|
||||
private readonly IOnlinePlusService _onlinePlusService;
|
||||
private readonly SettingsServices _settingsServices;
|
||||
public int Stock { get; set; }
|
||||
public OnlinePlusOrder OpOrder { get; set; } = new OnlinePlusOrder();
|
||||
public bool Ordered = true;
|
||||
public ICommand SendOrderCommand { get; set; }
|
||||
public ICommand SelectSymbolCommand { get; set; }
|
||||
public ICommand StopOrderCommand { get; set; }
|
||||
public ICommand ClearOrdersCommand { get; set; }
|
||||
|
||||
private OnlinePlusSymbol _onlinePlusSymbol;
|
||||
public OnlinePlusSymbol OnlinePlusSymbol
|
||||
{
|
||||
get { return _onlinePlusSymbol; }
|
||||
set { SetProperty(ref _onlinePlusSymbol, value); }
|
||||
}
|
||||
private string _cookies;
|
||||
public string Cookies
|
||||
{
|
||||
get { return _cookies; }
|
||||
set { SetProperty(ref _cookies, value , nameof(Cookies)); }
|
||||
}
|
||||
|
||||
private OnlinePlusAccount _account;
|
||||
public OnlinePlusAccount Account
|
||||
{
|
||||
get { return _account; }
|
||||
set { SetProperty(ref _account, value, nameof(Account)); }
|
||||
}
|
||||
|
||||
public ObservableCollection<Symbol> Symbols { get; set; } = new ObservableCollection<Symbol>();
|
||||
public ObservableCollection<OnlinePlusOrderResult> PlusOrderResults { get; set; } = new ObservableCollection<OnlinePlusOrderResult>();
|
||||
public OnlinePlusControllerViewModel(IOnlinePlusService onlinePlusService, SettingsServices settingsServices)
|
||||
{
|
||||
_onlinePlusService = onlinePlusService;
|
||||
_settingsServices = settingsServices;
|
||||
_settingsServices.GetSymbols().ForEach(s => Symbols.Add(s));
|
||||
|
||||
}
|
||||
|
||||
public override void InitialCommand()
|
||||
{
|
||||
base.InitialCommand();
|
||||
SendOrderCommand = new DelegateCommand(async () =>
|
||||
{
|
||||
Ordered = true;
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
Thread thr = new Thread(Order);
|
||||
thr.Start();
|
||||
}
|
||||
});
|
||||
StopOrderCommand = new DelegateCommand(async () => { Ordered = false; });
|
||||
SelectSymbolCommand = new DelegateCommand<Symbol>(async (symbol) =>
|
||||
{
|
||||
OnlinePlusSymbol = await _onlinePlusService.GetSymbolOrderBase(symbol, Stock);
|
||||
});
|
||||
ClearOrdersCommand = new DelegateCommand(()=>PlusOrderResults.Clear());
|
||||
}
|
||||
|
||||
async void Order()
|
||||
{
|
||||
while (Ordered)
|
||||
{
|
||||
try
|
||||
{
|
||||
OpOrder.Cookies = Cookies;
|
||||
if (string.IsNullOrEmpty(OpOrder.Cookies))
|
||||
throw new Exception("کوکی های درخواست را وارد کنید");
|
||||
OpOrder.orderCount = OnlinePlusSymbol.Quantity;
|
||||
OpOrder.orderPrice = OnlinePlusSymbol.symbolinfo.ht;
|
||||
OpOrder.isin = OnlinePlusSymbol.symbolinfo.nc;
|
||||
OnlinePlusOrderResult res;
|
||||
res = await _onlinePlusService.SendOrder(OpOrder);
|
||||
if(res!=null)
|
||||
Application.Current.Dispatcher.Invoke(() => PlusOrderResults.Add(res));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(e.Message);
|
||||
Ordered = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool SetProperty<T>(ref T storage, T value, string propertyName = null)
|
||||
{
|
||||
var flag = base.SetProperty(ref storage, value, propertyName);
|
||||
if(propertyName==nameof(Cookies))
|
||||
Account = _onlinePlusService.GetAccounTask(Cookies).Result;
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
using Prism.Commands;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Input;
|
||||
using HandyControl.Controls;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.Services;
|
||||
|
||||
namespace WolfOfWallStreet.ViewModels
|
||||
{
|
||||
public class SymbolsControllerViewModel : ViewModelBase
|
||||
{
|
||||
private readonly SettingsServices _settingsServices;
|
||||
|
||||
public ObservableCollection<Symbol> Symbols { get; set; } = new ObservableCollection<Symbol>();
|
||||
public Symbol Symbol { get; set; } = new Symbol();
|
||||
public ICommand AddSymbolCommand { get; set; }
|
||||
public ICommand RemoveSymbolCommand { get; set; }
|
||||
public SymbolsControllerViewModel(SettingsServices settingsServices)
|
||||
{
|
||||
_settingsServices = settingsServices;
|
||||
_settingsServices.GetSymbols().ForEach(s=>Symbols.Add(s));
|
||||
}
|
||||
|
||||
public override void InitialCommand()
|
||||
{
|
||||
base.InitialCommand();
|
||||
AddSymbolCommand = new DelegateCommand((() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
if (string.IsNullOrEmpty(Symbol.symbolISIN))
|
||||
throw new Exception("لطفا isin را وارد کنید");
|
||||
if (string.IsNullOrEmpty(Symbol.SymbolName))
|
||||
throw new Exception("لطفا نام سهم را وارد کنید");
|
||||
_settingsServices.AddSymbol(Symbol);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(e.Message);
|
||||
}
|
||||
}));
|
||||
RemoveSymbolCommand = new DelegateCommand<Symbol>(symbol =>
|
||||
{
|
||||
_settingsServices.RemoveSymbol(symbol);
|
||||
Symbols.Remove(symbol);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Prism.Mvvm;
|
||||
using Prism.Regions;
|
||||
using Prism.Services.Dialogs;
|
||||
|
||||
namespace WolfOfWallStreet.ViewModels
|
||||
{
|
||||
|
||||
public class ViewModelBase : BindableBase
|
||||
{
|
||||
private string _title;
|
||||
public string Title
|
||||
{
|
||||
get { return _title; }
|
||||
set { SetProperty(ref _title, value); }
|
||||
}
|
||||
public IRegionManager RegionManager { get; }
|
||||
public ViewModelBase()
|
||||
{
|
||||
Initialize();
|
||||
InitialCommand();
|
||||
}
|
||||
public ViewModelBase(IRegionManager regionManager)
|
||||
{
|
||||
RegionManager = regionManager;
|
||||
Initialize();
|
||||
InitialCommand();
|
||||
}
|
||||
public virtual void InitialCommand()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,198 @@
|
|||
<UserControl
|
||||
x:Class="WolfOfWallStreet.Views.Controllers.EasyTraderController"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:helper="clr-namespace:WolfOfWallStreet.Helper"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
FlowDirection="RightToLeft">
|
||||
|
||||
<Grid>
|
||||
|
||||
<Grid Grid.Column="0" Margin="10,10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<hc:ScrollViewer
|
||||
Grid.Row="0"
|
||||
Padding="0,15"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
Orientation="Horizontal">
|
||||
<ItemsControl ItemsSource="{Binding Symbols}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
<hc:Tag
|
||||
Margin="4,0"
|
||||
Padding="25,0"
|
||||
Content="{Binding SymbolName}"
|
||||
Selectable="True"
|
||||
Selected="SymbolTag_OnSelected"
|
||||
ShowCloseButton="False" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</hc:ScrollViewer>
|
||||
|
||||
<StackPanel Grid.Row="1" Margin="0,10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="0" />
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="Auth"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=Auth}" />
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="ایمیل"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=Email}"
|
||||
TextAlignment="Center" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="5,10,0,10"
|
||||
hc:InfoElement.Placeholder="شماره تلفن"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=PhoneNumber}"
|
||||
TextAlignment="Center" />
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="100" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="isin"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=EasyTraderDraft.isin}" />
|
||||
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="5,10,0,10"
|
||||
hc:InfoElement.Placeholder="نام سهم"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=EasyTraderDraft.stockSymbol}"
|
||||
TextAlignment="Center" />
|
||||
</Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="قیمت"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=EasyTraderDraft.price}" />
|
||||
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="10,10,0,10"
|
||||
hc:InfoElement.Placeholder="تعداد"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=EasyTraderDraft.quantity}" />
|
||||
</Grid>
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="نام دقیق نماد"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=EasyTraderDraft.stockSymbol}" />
|
||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
||||
<Button
|
||||
Padding="35,0"
|
||||
Command="{Binding SendOrderCommand}"
|
||||
Content="شروع ارسال سفارش"
|
||||
Style="{StaticResource ButtonInfo}" />
|
||||
|
||||
<Button
|
||||
Margin="10,0,0,0"
|
||||
Padding="35,0"
|
||||
Command="{Binding StopOrderCommand}"
|
||||
Content="پایان"
|
||||
Style="{StaticResource ButtonDanger}" />
|
||||
|
||||
<Button
|
||||
Margin="10,0,0,0"
|
||||
Padding="35,0"
|
||||
Command="{Binding ClearOrdersCommand}"
|
||||
Content="پاک کردن لیست"
|
||||
Style="{StaticResource ButtonWarning}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<hc:ScrollViewer Grid.Row="2" helper:ScrollHelper.AutoScroll="True">
|
||||
<ItemsControl ItemsSource="{Binding Results}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<materialDesign:Card
|
||||
Width="200"
|
||||
Height="250"
|
||||
Margin="8"
|
||||
Padding="8"
|
||||
Background="#eee"
|
||||
UniformCornerRadius="8">
|
||||
<StackPanel>
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock HorizontalAlignment="Center" Text="پیغام" />
|
||||
<TextBlock HorizontalAlignment="Center" Text="{Binding message}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock HorizontalAlignment="Center" Text="پیغام ثبت سفارش" />
|
||||
<TextBlock HorizontalAlignment="Center" Text="{Binding omsErrorDescription}" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock HorizontalAlignment="Center" Text="تاریخ : " />
|
||||
<TextBlock HorizontalAlignment="Center" Text="{Binding orderEntryDate}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock HorizontalAlignment="Center" Text="تاریخ : " />
|
||||
<TextBlock HorizontalAlignment="Center" Text="{Binding orderEntryDate}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</hc:ScrollViewer>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Controls;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.ViewModels;
|
||||
|
||||
namespace WolfOfWallStreet.Views.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for EasyTraderController
|
||||
/// </summary>
|
||||
public partial class EasyTraderController : UserControl
|
||||
{
|
||||
private Tag selecteTag;
|
||||
public EasyTraderController()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SymbolButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
if (sender is Button btn && btn.DataContext is Symbol symbol)
|
||||
(DataContext as EasyTraderControllerViewModel)?.SelectSymbolCommand.Execute(symbol);
|
||||
}
|
||||
|
||||
private void SymbolTag_OnSelected(object? sender, EventArgs e)
|
||||
{
|
||||
if (selecteTag != null)
|
||||
{
|
||||
selecteTag.IsSelected = false;
|
||||
}
|
||||
if (sender is Tag tag && tag.DataContext is Symbol symbol && DataContext is EasyTraderControllerViewModel viewModel)
|
||||
{
|
||||
viewModel.SelectSymbolCommand.Execute(symbol);
|
||||
selecteTag = tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,191 @@
|
|||
<UserControl
|
||||
x:Class="WolfOfWallStreet.Views.Controllers.MofidOnlineController"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:helper="clr-namespace:WolfOfWallStreet.Helper"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:models="clr-namespace:WolfOfWallStreet.Models"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
FlowDirection="RightToLeft">
|
||||
|
||||
<Grid Margin="10,10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<hc:ScrollViewer
|
||||
Grid.Row="0"
|
||||
Padding="0,0,0,15"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
Orientation="Horizontal">
|
||||
<ItemsControl ItemsSource="{Binding Symbols}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<hc:Tag
|
||||
Margin="4,0"
|
||||
Padding="25,0"
|
||||
Content="{Binding SymbolName}"
|
||||
Selectable="True"
|
||||
Selected="SymbolTag_OnSelected"
|
||||
ShowCloseButton="False" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</hc:ScrollViewer>
|
||||
<hc:ButtonGroup Grid.Row="1" Style="{StaticResource ButtonGroupSolid}">
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="500 هزاری"
|
||||
DataContext="{x:Static models:Stock.PoonsadHezari}" />
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="1 ملیونی"
|
||||
DataContext="{x:Static models:Stock.YekMelioni}"
|
||||
IsChecked="True" />
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="1.5 ملیونی"
|
||||
DataContext="{x:Static models:Stock.YekONimMelioni}" />
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="2 ملیونی"
|
||||
DataContext="{x:Static models:Stock.DoMelioni}" />
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="2.5 ملیون"
|
||||
DataContext="{x:Static models:Stock.DoONimMelioni}" />
|
||||
</hc:ButtonGroup>
|
||||
<StackPanel Grid.Row="2" Margin="0,10">
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="Cookies"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=MoOrder.Cookies, Mode=TwoWay}" />
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="isin"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=MofidOnlineSymbol.nc}" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="قیمت"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=MofidOnlineSymbol.ht}" />
|
||||
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="10,10,0,10"
|
||||
hc:InfoElement.Placeholder="تعداد"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=MofidOnlineSymbol.Quantity}" />
|
||||
</Grid>
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="نام دقیق نماد"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=MofidOnlineSymbol.est}" />
|
||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
||||
<Button
|
||||
Padding="35,0"
|
||||
Command="{Binding SendOrderCommand}"
|
||||
Content="شروع ارسال سفارش"
|
||||
Style="{StaticResource ButtonInfo}" />
|
||||
|
||||
<Button
|
||||
Margin="10,0,0,0"
|
||||
Padding="35,0"
|
||||
Command="{Binding StopOrderCommand}"
|
||||
Content="پایان"
|
||||
Style="{StaticResource ButtonDanger}" />
|
||||
|
||||
<Button
|
||||
Margin="10,0,0,0"
|
||||
Padding="35,0"
|
||||
Command="{Binding ClearOrdersCommand}"
|
||||
Content="پاک کردن لیست"
|
||||
Style="{StaticResource ButtonWarning}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<hc:ScrollViewer Grid.Row="3" helper:ScrollHelper.AutoScroll="True">
|
||||
<ItemsControl HorizontalAlignment="Center" ItemsSource="{Binding OrderResults}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<materialDesign:Card
|
||||
Width="200"
|
||||
Height="220"
|
||||
Margin="8"
|
||||
Padding="8"
|
||||
Background="{Binding StatusColor}"
|
||||
Foreground="White"
|
||||
UniformCornerRadius="8">
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
FontFamily="{StaticResource ShabnamBold}"
|
||||
FontSize="15"
|
||||
Text="موفقیت امیز"
|
||||
TextAlignment="Center" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="{Binding IsSuccessStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
FontFamily="{StaticResource ShabnamBold}"
|
||||
FontSize="15"
|
||||
Text="پیغام"
|
||||
TextAlignment="Center" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="{Binding Value}"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
FontFamily="{StaticResource ShabnamBold}"
|
||||
FontSize="15"
|
||||
Text="زمان دریافت"
|
||||
TextAlignment="Center" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="{Binding GetDateTimeStr}"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</hc:ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Controls;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.ViewModels;
|
||||
|
||||
namespace WolfOfWallStreet.Views.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MofidOnlineController
|
||||
/// </summary>
|
||||
public partial class MofidOnlineController : UserControl
|
||||
{
|
||||
private Tag selecteTag;
|
||||
|
||||
public MofidOnlineController()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SymbolTag_OnSelected(object sender, EventArgs e)
|
||||
{
|
||||
if (selecteTag != null)
|
||||
{
|
||||
selecteTag.IsSelected = false;
|
||||
}
|
||||
if (sender is Tag tag && tag.DataContext is Symbol symbol && DataContext is MofidOnlineControllerViewModel viewModel)
|
||||
{
|
||||
viewModel.SelectSymbolCommand.Execute(symbol);
|
||||
selecteTag = tag;
|
||||
}
|
||||
}
|
||||
|
||||
private void StackToggleButton_OnChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is RadioButton radioButton && radioButton.DataContext is int stock &&
|
||||
DataContext is MofidOnlineControllerViewModel viewModel)
|
||||
viewModel.Stock = stock;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,216 @@
|
|||
<UserControl
|
||||
x:Class="WolfOfWallStreet.Views.Controllers.OnlinePlusController"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:helper="clr-namespace:WolfOfWallStreet.Helper"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:models="clr-namespace:WolfOfWallStreet.Models"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
FlowDirection="RightToLeft">
|
||||
|
||||
<Grid Margin="10,10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="1" Margin="0,10">
|
||||
<hc:ButtonGroup Grid.Row="1" Style="{StaticResource ButtonGroupSolid}">
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="500 هزاری"
|
||||
DataContext="{x:Static models:Stock.PoonsadHezari}" />
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="1 ملیونی"
|
||||
DataContext="{x:Static models:Stock.YekMelioni}"
|
||||
IsChecked="True" />
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="1.5 ملیونی"
|
||||
DataContext="{x:Static models:Stock.YekONimMelioni}" />
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="2 ملیونی"
|
||||
DataContext="{x:Static models:Stock.DoMelioni}" />
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="2.5 ملیون"
|
||||
DataContext="{x:Static models:Stock.DoONimMelioni}" />
|
||||
<RadioButton
|
||||
Checked="StackToggleButton_OnChecked"
|
||||
Content="3 ملیون"
|
||||
DataContext="{x:Static models:Stock.SeMelioni}" />
|
||||
</hc:ButtonGroup>
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="Cookies"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=Cookies, Mode=TwoWay}" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="نام"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=Account.email}"
|
||||
TextAlignment="Center" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="5,10,0,10"
|
||||
hc:InfoElement.Placeholder="ایمیل"
|
||||
IsReadOnly="True"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=Account.Title}"
|
||||
TextAlignment="Center" />
|
||||
</Grid>
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="isin"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=OnlinePlusSymbol.symbolinfo.nc}" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="قیمت"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=OnlinePlusSymbol.symbolinfo.ht}" />
|
||||
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="10,10,0,10"
|
||||
hc:InfoElement.Placeholder="تعداد"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=OnlinePlusSymbol.Quantity}" />
|
||||
</Grid>
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="نام دقیق نماد"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=OnlinePlusSymbol.symbolinfo.est}" />
|
||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
||||
<Button
|
||||
Padding="35,0"
|
||||
Command="{Binding SendOrderCommand}"
|
||||
Content="شروع ارسال سفارش"
|
||||
Style="{StaticResource ButtonInfo}" />
|
||||
|
||||
<Button
|
||||
Margin="10,0,0,0"
|
||||
Padding="35,0"
|
||||
Command="{Binding StopOrderCommand}"
|
||||
Content="پایان"
|
||||
Style="{StaticResource ButtonDanger}" />
|
||||
|
||||
<Button
|
||||
Margin="10,0,0,0"
|
||||
Padding="35,0"
|
||||
Command="{Binding ClearOrdersCommand}"
|
||||
Content="پاک کردن لیست"
|
||||
Style="{StaticResource ButtonWarning}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<hc:ScrollViewer
|
||||
Grid.Row="0"
|
||||
Padding="0,0,0,15"
|
||||
HorizontalScrollBarVisibility="Visible"
|
||||
Orientation="Horizontal">
|
||||
<ItemsControl ItemsSource="{Binding Symbols}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<hc:Tag
|
||||
Margin="4,0"
|
||||
Padding="25,0"
|
||||
Content="{Binding SymbolName}"
|
||||
Selectable="True"
|
||||
Selected="SymbolTag_OnSelected"
|
||||
ShowCloseButton="False" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</hc:ScrollViewer>
|
||||
<hc:ScrollViewer Grid.Row="2" helper:ScrollHelper.AutoScroll="True">
|
||||
<ItemsControl ItemsSource="{Binding PlusOrderResults}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<materialDesign:Card
|
||||
Width="200"
|
||||
Height="220"
|
||||
Margin="8"
|
||||
Padding="8"
|
||||
Background="{Binding StatusColor}"
|
||||
Foreground="White"
|
||||
UniformCornerRadius="8">
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
FontFamily="{StaticResource ShabnamBold}"
|
||||
FontSize="15"
|
||||
Text="موفقیت امیز"
|
||||
TextAlignment="Center" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="{Binding IsSuccessStr}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
FontFamily="{StaticResource ShabnamBold}"
|
||||
FontSize="15"
|
||||
Text="پیغام"
|
||||
TextAlignment="Center" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="{Binding MessageDesc}"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<StackPanel Margin="0,10">
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
FontFamily="{StaticResource ShabnamBold}"
|
||||
FontSize="15"
|
||||
Text="زمان دریافت"
|
||||
TextAlignment="Center" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Center"
|
||||
Text="{Binding GetDateTimeStr}"
|
||||
TextAlignment="Center"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</materialDesign:Card>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</hc:ScrollViewer>
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Controls;
|
||||
using WolfOfWallStreet.ViewModels;
|
||||
|
||||
namespace WolfOfWallStreet.Views.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for OnlinePlusController
|
||||
/// </summary>
|
||||
public partial class OnlinePlusController : UserControl
|
||||
{
|
||||
private Tag selecteTag = null;
|
||||
public OnlinePlusController()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SymbolButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button btn && DataContext is OnlinePlusControllerViewModel viewModel)
|
||||
{
|
||||
viewModel.SelectSymbolCommand.Execute(btn.DataContext);
|
||||
}
|
||||
}
|
||||
|
||||
private void SymbolTag_OnSelected(object sender, EventArgs e)
|
||||
{
|
||||
if (selecteTag != null)
|
||||
{
|
||||
selecteTag.IsSelected = false;
|
||||
}
|
||||
|
||||
if (sender is Tag tag && DataContext is OnlinePlusControllerViewModel viewModel)
|
||||
{
|
||||
viewModel.SelectSymbolCommand.Execute(tag.DataContext);
|
||||
selecteTag = tag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void StackToggleButton_OnChecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
if (sender is RadioButton radioButton && radioButton.DataContext is int stock &&
|
||||
DataContext is OnlinePlusControllerViewModel viewModel)
|
||||
viewModel.Stock = stock;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
<UserControl
|
||||
x:Class="WolfOfWallStreet.Views.Controllers.SymbolsController"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
FlowDirection="RightToLeft">
|
||||
<Grid Margin="10,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox
|
||||
Margin="0,10"
|
||||
hc:InfoElement.Placeholder="Name"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=Symbol.SymbolName, Mode=OneWayToSource}" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Margin="10,10"
|
||||
hc:InfoElement.Placeholder="Isin"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Path=Symbol.symbolISIN, Mode=OneWayToSource}" />
|
||||
<Button
|
||||
Grid.Column="2"
|
||||
Padding="10,0"
|
||||
Command="{Binding AddSymbolCommand}"
|
||||
Content="+"
|
||||
FontSize="18"
|
||||
Style="{StaticResource ButtonSuccess}" />
|
||||
</Grid>
|
||||
<ItemsControl Grid.Row="1" ItemsSource="{Binding Symbols}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<hc:Tag
|
||||
Margin="4,4"
|
||||
Closed="SymbolTag_OnClosed"
|
||||
Content="{Binding SymbolName}"
|
||||
Selectable="False"
|
||||
ShowCloseButton="True" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</UserControl>
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Windows.Controls;
|
||||
using HandyControl.Controls;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.ViewModels;
|
||||
|
||||
namespace WolfOfWallStreet.Views.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for SymbolsController
|
||||
/// </summary>
|
||||
public partial class SymbolsController : UserControl
|
||||
{
|
||||
public SymbolsController()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void SymbolTag_OnClosed(object sender, EventArgs e)
|
||||
{
|
||||
if(sender is Tag tag && tag.DataContext is Symbol symbol && DataContext is SymbolsControllerViewModel viewModel)
|
||||
viewModel.RemoveSymbolCommand.Execute(symbol);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<UserControl
|
||||
x:Class="WolfOfWallStreet.Views.MainPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controllers="clr-namespace:WolfOfWallStreet.Views.Controllers"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
xmlns:views="clr-namespace:WolfOfWallStreet.Views"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
FlowDirection="RightToLeft">
|
||||
<materialDesign:Card HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<TabControl Background="Transparent" Style="{StaticResource TabControlInLine}">
|
||||
<TabItem Header="MofidOnline">
|
||||
<controllers:MofidOnlineController />
|
||||
</TabItem>
|
||||
<TabItem Header="EasyTrader">
|
||||
<controllers:EasyTraderController />
|
||||
</TabItem>
|
||||
<TabItem Header="OnlinePlus">
|
||||
<controllers:OnlinePlusController />
|
||||
</TabItem>
|
||||
<TabItem Header="Symbols">
|
||||
<controllers:SymbolsController />
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</materialDesign:Card>
|
||||
</UserControl>
|
|
@ -0,0 +1,22 @@
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Navigation;
|
||||
using WolfOfWallStreet.Models;
|
||||
using WolfOfWallStreet.ViewModels;
|
||||
|
||||
namespace WolfOfWallStreet.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainPage
|
||||
/// </summary>
|
||||
public partial class MainPage : UserControl
|
||||
{
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<Window
|
||||
x:Class="WolfOfWallStreet.Views.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
Title="{Binding Title}"
|
||||
Width="650"
|
||||
Height="900"
|
||||
prism:ViewModelLocator.AutoWireViewModel="True"
|
||||
FontFamily="{StaticResource Shabnam}">
|
||||
<Grid>
|
||||
<ContentControl prism:RegionManager.RegionName="ContentRegion" />
|
||||
</Grid>
|
||||
</Window>
|
|
@ -0,0 +1,15 @@
|
|||
using System.Windows;
|
||||
|
||||
namespace WolfOfWallStreet.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyName>WolfOfWallStreet</AssemblyName>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Resources\Fonts\fa-regular-400.ttf" />
|
||||
<None Remove="Resources\Fonts\IranSansBlack.ttf" />
|
||||
<None Remove="Resources\Fonts\IranSansBold.ttf" />
|
||||
<None Remove="Resources\Fonts\IranSansMedium.ttf" />
|
||||
<None Remove="Resources\Fonts\Shabnam-Bold.ttf" />
|
||||
<None Remove="Resources\Fonts\Shabnam.ttf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="HandyControls" Version="2.5.3" />
|
||||
<PackageReference Include="MaterialDesignThemes" Version="3.0.1" />
|
||||
<PackageReference Include="Prism.Unity" Version="8.0.0.1740-pre" />
|
||||
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.1.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="Prism.Core" Version="7.2.0.1422" />
|
||||
<PackageReference Include="Prism.Unity" Version="7.2.0.1422" />
|
||||
<PackageReference Include="Prism.Wpf" Version="7.2.0.1422" />
|
||||
<PackageReference Include="RestSharp" Version="106.11.5-alpha.0.2" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.1.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Fonts\fa-regular-400.ttf" />
|
||||
<Resource Include="Resources\Fonts\IranSansBlack.ttf" />
|
||||
<Resource Include="Resources\Fonts\IranSansBold.ttf" />
|
||||
<Resource Include="Resources\Fonts\IranSansMedium.ttf" />
|
||||
<Resource Include="Resources\Fonts\Shabnam-Bold.ttf" />
|
||||
<Resource Include="Resources\Fonts\Shabnam.ttf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Reference in New Issue