Add project files.
This commit is contained in:
25
ComboValue/Class1.cs
Normal file
25
ComboValue/Class1.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComboValue
|
||||
{
|
||||
public class ComboboxValue
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
public ComboboxValue(int id, string name)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
61
ComboValue/ComboValue.csproj
Normal file
61
ComboValue/ComboValue.csproj
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>90afd5a7-5ac1-4a3a-a202-5c97ee9deb1d</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>ComboValue</RootNamespace>
|
||||
<AssemblyName>ComboValue</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<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' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System"/>
|
||||
|
||||
<Reference Include="System.Core"/>
|
||||
<Reference Include="System.Xml.Linq"/>
|
||||
<Reference Include="System.Data.DataSetExtensions"/>
|
||||
|
||||
|
||||
<Reference Include="Microsoft.CSharp"/>
|
||||
|
||||
<Reference Include="System.Data"/>
|
||||
|
||||
<Reference Include="System.Net.Http"/>
|
||||
|
||||
<Reference Include="System.Xml"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
|
||||
</Project>
|
||||
36
ComboValue/Properties/AssemblyInfo.cs
Normal file
36
ComboValue/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 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("ComboValue")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("ComboValue")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[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)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("90afd5a7-5ac1-4a3a-a202-5c97ee9deb1d")]
|
||||
|
||||
// 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")]
|
||||
181
Owf.Controls.DigitalDisplayControl/DigitalDisplayControl.cs
Normal file
181
Owf.Controls.DigitalDisplayControl/DigitalDisplayControl.cs
Normal file
@@ -0,0 +1,181 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Owf.Controls
|
||||
{
|
||||
public partial class DigitalDisplayControl : UserControl
|
||||
{
|
||||
private Color _digitColor = Color.GreenYellow;
|
||||
[Browsable(true), DefaultValue("Color.GreenYellow")]
|
||||
public Color DigitColor
|
||||
{
|
||||
get { return _digitColor; }
|
||||
set { _digitColor = value; Invalidate(); }
|
||||
}
|
||||
|
||||
private string _digitText = "88.88";
|
||||
[Browsable(true), DefaultValue("88.88")]
|
||||
public string DigitText
|
||||
{
|
||||
get { return _digitText; }
|
||||
set { _digitText = value; Invalidate(); }
|
||||
}
|
||||
|
||||
public DigitalDisplayControl()
|
||||
{
|
||||
this.SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
this.SetStyle(ControlStyles.ResizeRedraw, true);
|
||||
this.SetStyle(ControlStyles.UserPaint, true);
|
||||
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
|
||||
InitializeComponent();
|
||||
this.BackColor = Color.Transparent;
|
||||
}
|
||||
|
||||
private void DigitalGauge_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||
|
||||
SevenSegmentHelper sevenSegmentHelper = new SevenSegmentHelper(e.Graphics);
|
||||
|
||||
SizeF digitSizeF = sevenSegmentHelper.GetStringSize(_digitText, Font);
|
||||
float scaleFactor = Math.Min(ClientSize.Width / digitSizeF.Width, ClientSize.Height / digitSizeF.Height);
|
||||
Font font = new Font(Font.FontFamily, scaleFactor * Font.SizeInPoints);
|
||||
digitSizeF = sevenSegmentHelper.GetStringSize(_digitText, font);
|
||||
|
||||
using (SolidBrush brush = new SolidBrush(_digitColor))
|
||||
{
|
||||
using (SolidBrush lightBrush = new SolidBrush(Color.FromArgb(20, _digitColor)))
|
||||
{
|
||||
sevenSegmentHelper.DrawDigits(
|
||||
_digitText, font, brush, lightBrush,
|
||||
(ClientSize.Width - digitSizeF.Width) / 2,
|
||||
(ClientSize.Height - digitSizeF.Height) / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SevenSegmentHelper
|
||||
{
|
||||
Graphics _graphics;
|
||||
|
||||
// Indicates what segments are illuminated for all 10 digits
|
||||
static byte[,] _segmentData = {{1, 1, 1, 0, 1, 1, 1},
|
||||
{0, 0, 1, 0, 0, 1, 0},
|
||||
{1, 0, 1, 1, 1, 0, 1},
|
||||
{1, 0, 1, 1, 0, 1, 1},
|
||||
{0, 1, 1, 1, 0, 1, 0},
|
||||
{1, 1, 0, 1, 0, 1, 1},
|
||||
{1, 1, 0, 1, 1, 1, 1},
|
||||
{1, 0, 1, 0, 0, 1, 0},
|
||||
{1, 1, 1, 1, 1, 1, 1},
|
||||
{1, 1, 1, 1, 0, 1, 1}};
|
||||
|
||||
// Points that define each of the seven segments
|
||||
readonly Point[][] _segmentPoints = new Point[7][];
|
||||
|
||||
public SevenSegmentHelper(Graphics graphics)
|
||||
{
|
||||
this._graphics = graphics;
|
||||
_segmentPoints[0] = new Point[] {new Point( 3, 2), new Point(39, 2), new Point(31, 10), new Point(11, 10)};
|
||||
_segmentPoints[1] = new Point[] {new Point( 2, 3), new Point(10, 11), new Point(10, 31), new Point( 2, 35)};
|
||||
_segmentPoints[2] = new Point[] {new Point(40, 3), new Point(40, 35), new Point(32, 31), new Point(32, 11)};
|
||||
_segmentPoints[3] = new Point[] {new Point( 3, 36), new Point(11, 32), new Point(31, 32), new Point(39, 36), new Point(31, 40), new Point(11, 40)};
|
||||
_segmentPoints[4] = new Point[] {new Point( 2, 37), new Point(10, 41), new Point(10, 61), new Point( 2, 69)};
|
||||
_segmentPoints[5] = new Point[] {new Point(40, 37), new Point(40, 69), new Point(32, 61), new Point(32, 41)};
|
||||
_segmentPoints[6] = new Point[] {new Point(11, 62), new Point(31, 62), new Point(39, 70), new Point( 3, 70)};
|
||||
}
|
||||
|
||||
public SizeF GetStringSize(string text, Font font)
|
||||
{
|
||||
SizeF sizef = new SizeF(0, _graphics.DpiX * font.SizeInPoints / 72);
|
||||
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
{
|
||||
if (Char.IsDigit(text[i]))
|
||||
sizef.Width += 42 * _graphics.DpiX * font.SizeInPoints / 72 / 72;
|
||||
else if (text[i] == ':' || text[i] == '.')
|
||||
sizef.Width += 12 * _graphics.DpiX * font.SizeInPoints / 72 / 72;
|
||||
}
|
||||
return sizef;
|
||||
}
|
||||
|
||||
public void DrawDigits(string text, Font font, Brush brush, Brush brushLight, float x, float y)
|
||||
{
|
||||
for (int cnt = 0; cnt < text.Length; cnt++)
|
||||
{
|
||||
// For digits 0-9
|
||||
if (Char.IsDigit(text[cnt]))
|
||||
x = DrawDigit(text[cnt] - '0', font, brush, brushLight, x, y);
|
||||
// For colon :
|
||||
else if (text[cnt] == ':')
|
||||
x = DrawColon(font, brush, x, y);
|
||||
// For dot .
|
||||
else if (text[cnt] == '.')
|
||||
x = DrawDot(font, brush, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
private float DrawDigit(int num, Font font, Brush brush, Brush brushLight, float x, float y)
|
||||
{
|
||||
for (int cnt = 0; cnt < _segmentPoints.Length; cnt++)
|
||||
{
|
||||
if (_segmentData[num, cnt] == 1)
|
||||
{
|
||||
FillPolygon(_segmentPoints[cnt], font, brush, x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
FillPolygon(_segmentPoints[cnt], font, brushLight, x, y);
|
||||
}
|
||||
}
|
||||
return x + 42 * _graphics.DpiX * font.SizeInPoints / 72 / 72;
|
||||
}
|
||||
|
||||
private float DrawDot(Font font, Brush brush, float x, float y)
|
||||
{
|
||||
Point[][] dotPoints = new Point[1][];
|
||||
|
||||
dotPoints[0] = new Point[] {new Point( 2, 64), new Point( 6, 61),
|
||||
new Point(10, 64), new Point( 6, 69)};
|
||||
|
||||
for (int cnt = 0; cnt < dotPoints.Length; cnt++)
|
||||
{
|
||||
FillPolygon(dotPoints[cnt], font, brush, x, y);
|
||||
}
|
||||
return x + 12 * _graphics.DpiX * font.SizeInPoints / 72 / 72;
|
||||
}
|
||||
|
||||
private float DrawColon(Font font, Brush brush, float x, float y)
|
||||
{
|
||||
Point[][] colonPoints = new Point[2][];
|
||||
|
||||
colonPoints[0] = new Point[] {new Point( 2, 21), new Point( 6, 17), new Point(10, 21), new Point( 6, 25)};
|
||||
colonPoints[1] = new Point[] {new Point( 2, 51), new Point( 6, 47), new Point(10, 51), new Point( 6, 55)};
|
||||
|
||||
for (int cnt = 0; cnt < colonPoints.Length; cnt++)
|
||||
{
|
||||
FillPolygon(colonPoints[cnt], font, brush, x, y);
|
||||
}
|
||||
return x + 12 * _graphics.DpiX * font.SizeInPoints / 72 / 72;
|
||||
}
|
||||
|
||||
private void FillPolygon(Point[] polygonPoints, Font font, Brush brush, float x, float y)
|
||||
{
|
||||
PointF[] polygonPointsF = new PointF[polygonPoints.Length];
|
||||
|
||||
for (int cnt = 0; cnt < polygonPoints.Length; cnt++)
|
||||
{
|
||||
polygonPointsF[cnt].X = x + polygonPoints[cnt].X * _graphics.DpiX * font.SizeInPoints / 72 / 72;
|
||||
polygonPointsF[cnt].Y = y + polygonPoints[cnt].Y * _graphics.DpiY * font.SizeInPoints / 72 / 72;
|
||||
}
|
||||
_graphics.FillPolygon(brush, polygonPointsF);
|
||||
}
|
||||
}
|
||||
}
|
||||
47
Owf.Controls.DigitalDisplayControl/DigitalDisplayControl.designer.cs
generated
Normal file
47
Owf.Controls.DigitalDisplayControl/DigitalDisplayControl.designer.cs
generated
Normal file
@@ -0,0 +1,47 @@
|
||||
namespace Owf.Controls
|
||||
{
|
||||
partial class DigitalDisplayControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// DigitalDisplayControl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Transparent;
|
||||
this.Name = "DigitalDisplayControl";
|
||||
this.Size = new System.Drawing.Size(150, 70);
|
||||
this.Paint += new System.Windows.Forms.PaintEventHandler(this.DigitalGauge_Paint);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
120
Owf.Controls.DigitalDisplayControl/DigitalDisplayControl.resx
Normal file
120
Owf.Controls.DigitalDisplayControl/DigitalDisplayControl.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<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" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{5D082F88-4290-4049-9984-FCB126A7BD4E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Owf.Controls.DigitalDisplayControl</RootNamespace>
|
||||
<AssemblyName>Owf.Controls.DigitalDisplayControl</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<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' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DigitalDisplayControl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DigitalDisplayControl.designer.cs">
|
||||
<DependentUpon>DigitalDisplayControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="DigitalDisplayControl.resx">
|
||||
<DependentUpon>DigitalDisplayControl.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 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("Owf.Controls.DigitalDisplayControl")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Owf.Controls.DigitalDisplayControl")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007")]
|
||||
[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)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("464778c1-a779-407b-b4df-d2d61250c05c")]
|
||||
|
||||
// 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 Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
28
hSMS.sln
Normal file
28
hSMS.sln
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.24720.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hSMS", "hSMS\hSMS.csproj", "{E8668B7D-8116-4418-B49D-766C0F31A454}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Owf.Controls.DigitalDisplayControl", "Owf.Controls.DigitalDisplayControl\Owf.Controls.DigitalDisplayControl.csproj", "{5D082F88-4290-4049-9984-FCB126A7BD4E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E8668B7D-8116-4418-B49D-766C0F31A454}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E8668B7D-8116-4418-B49D-766C0F31A454}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E8668B7D-8116-4418-B49D-766C0F31A454}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E8668B7D-8116-4418-B49D-766C0F31A454}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5D082F88-4290-4049-9984-FCB126A7BD4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5D082F88-4290-4049-9984-FCB126A7BD4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5D082F88-4290-4049-9984-FCB126A7BD4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5D082F88-4290-4049-9984-FCB126A7BD4E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
6
hSMS/App.config
Normal file
6
hSMS/App.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
25
hSMS/ComboboxValue.cs
Normal file
25
hSMS/ComboboxValue.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ComboValue
|
||||
{
|
||||
public class ComboboxValue
|
||||
{
|
||||
public int Id { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
|
||||
public ComboboxValue(int id, string name)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
370
hSMS/Form1.Designer.cs
generated
Normal file
370
hSMS/Form1.Designer.cs
generated
Normal file
@@ -0,0 +1,370 @@
|
||||
namespace hSMS
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.txtPass = new System.Windows.Forms.TextBox();
|
||||
this.txtUser = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.Liste = new System.Windows.Forms.ListView();
|
||||
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
||||
this.cmbMesajlar = new System.Windows.Forms.ComboBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.txtMesaj = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.btnGonder = new System.Windows.Forms.Button();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.cmbBirimler = new System.Windows.Forms.ComboBox();
|
||||
this.dgSecili = new Owf.Controls.DigitalDisplayControl();
|
||||
this.dgMM = new Owf.Controls.DigitalDisplayControl();
|
||||
this.dgMUz = new Owf.Controls.DigitalDisplayControl();
|
||||
this.dhKacKontor = new Owf.Controls.DigitalDisplayControl();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.txtPass);
|
||||
this.groupBox1.Controls.Add(this.txtUser);
|
||||
this.groupBox1.Controls.Add(this.label3);
|
||||
this.groupBox1.Controls.Add(this.label2);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 7);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(266, 77);
|
||||
this.groupBox1.TabIndex = 2;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "SMS Kullanıcı Bilgileri";
|
||||
//
|
||||
// txtPass
|
||||
//
|
||||
this.txtPass.Location = new System.Drawing.Point(83, 44);
|
||||
this.txtPass.MaxLength = 30;
|
||||
this.txtPass.Name = "txtPass";
|
||||
this.txtPass.PasswordChar = '*';
|
||||
this.txtPass.Size = new System.Drawing.Size(176, 20);
|
||||
this.txtPass.TabIndex = 1;
|
||||
//
|
||||
// txtUser
|
||||
//
|
||||
this.txtUser.Location = new System.Drawing.Point(83, 17);
|
||||
this.txtUser.Name = "txtUser";
|
||||
this.txtUser.Size = new System.Drawing.Size(176, 20);
|
||||
this.txtUser.TabIndex = 0;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(34, 42);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(43, 13);
|
||||
this.label3.TabIndex = 1;
|
||||
this.label3.Text = "Parola :";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(7, 20);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(70, 13);
|
||||
this.label2.TabIndex = 0;
|
||||
this.label2.Text = "Kullanıcı Adı :";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.dhKacKontor);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 95);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(266, 100);
|
||||
this.groupBox2.TabIndex = 4;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Mevcut SMS Durumu";
|
||||
//
|
||||
// Liste
|
||||
//
|
||||
this.Liste.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.Liste.CheckBoxes = true;
|
||||
this.Liste.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.columnHeader1,
|
||||
this.columnHeader2,
|
||||
this.columnHeader3,
|
||||
this.columnHeader4,
|
||||
this.columnHeader5,
|
||||
this.columnHeader6});
|
||||
this.Liste.Font = new System.Drawing.Font("Trebuchet MS", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||
this.Liste.FullRowSelect = true;
|
||||
this.Liste.GridLines = true;
|
||||
this.Liste.Location = new System.Drawing.Point(288, 39);
|
||||
this.Liste.Name = "Liste";
|
||||
this.Liste.Size = new System.Drawing.Size(588, 506);
|
||||
this.Liste.TabIndex = 4;
|
||||
this.Liste.UseCompatibleStateImageBehavior = false;
|
||||
this.Liste.View = System.Windows.Forms.View.Details;
|
||||
this.Liste.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.Liste_ItemCheck);
|
||||
this.Liste.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.Liste_ItemChecked);
|
||||
//
|
||||
// columnHeader1
|
||||
//
|
||||
this.columnHeader1.Text = "Ad Soyad";
|
||||
this.columnHeader1.Width = 160;
|
||||
//
|
||||
// columnHeader2
|
||||
//
|
||||
this.columnHeader2.Text = "GSM No 1";
|
||||
this.columnHeader2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.columnHeader2.Width = 90;
|
||||
//
|
||||
// columnHeader3
|
||||
//
|
||||
this.columnHeader3.Text = "GSM No 2";
|
||||
this.columnHeader3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.columnHeader3.Width = 90;
|
||||
//
|
||||
// columnHeader4
|
||||
//
|
||||
this.columnHeader4.Text = "T.C.";
|
||||
this.columnHeader4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.columnHeader4.Width = 100;
|
||||
//
|
||||
// columnHeader5
|
||||
//
|
||||
this.columnHeader5.Text = "Kan";
|
||||
this.columnHeader5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// columnHeader6
|
||||
//
|
||||
this.columnHeader6.Text = "Cinsiyet";
|
||||
this.columnHeader6.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 551);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(884, 22);
|
||||
this.statusStrip1.TabIndex = 6;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// groupBox3
|
||||
//
|
||||
this.groupBox3.Controls.Add(this.cmbMesajlar);
|
||||
this.groupBox3.Controls.Add(this.dgMM);
|
||||
this.groupBox3.Controls.Add(this.label4);
|
||||
this.groupBox3.Controls.Add(this.txtMesaj);
|
||||
this.groupBox3.Controls.Add(this.label1);
|
||||
this.groupBox3.Controls.Add(this.dgMUz);
|
||||
this.groupBox3.Location = new System.Drawing.Point(12, 201);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(266, 308);
|
||||
this.groupBox3.TabIndex = 3;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Gönderilecek Mesaj";
|
||||
//
|
||||
// cmbMesajlar
|
||||
//
|
||||
this.cmbMesajlar.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbMesajlar.FlatStyle = System.Windows.Forms.FlatStyle.System;
|
||||
this.cmbMesajlar.FormattingEnabled = true;
|
||||
this.cmbMesajlar.Location = new System.Drawing.Point(5, 19);
|
||||
this.cmbMesajlar.Name = "cmbMesajlar";
|
||||
this.cmbMesajlar.Size = new System.Drawing.Size(254, 21);
|
||||
this.cmbMesajlar.TabIndex = 5;
|
||||
this.cmbMesajlar.SelectedIndexChanged += new System.EventHandler(this.cmbMesajlar_SelectedIndexChanged);
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(7, 276);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(74, 13);
|
||||
this.label4.TabIndex = 3;
|
||||
this.label4.Text = "Kontör Sayısı :";
|
||||
//
|
||||
// txtMesaj
|
||||
//
|
||||
this.txtMesaj.Location = new System.Drawing.Point(5, 46);
|
||||
this.txtMesaj.Multiline = true;
|
||||
this.txtMesaj.Name = "txtMesaj";
|
||||
this.txtMesaj.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||
this.txtMesaj.Size = new System.Drawing.Size(254, 225);
|
||||
this.txtMesaj.TabIndex = 2;
|
||||
this.txtMesaj.TextChanged += new System.EventHandler(this.txtMesaj_TextChanged);
|
||||
this.txtMesaj.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtMesaj_KeyUp);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(154, 277);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(53, 13);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Karakter :";
|
||||
//
|
||||
// btnGonder
|
||||
//
|
||||
this.btnGonder.Location = new System.Drawing.Point(215, 515);
|
||||
this.btnGonder.Name = "btnGonder";
|
||||
this.btnGonder.Size = new System.Drawing.Size(63, 30);
|
||||
this.btnGonder.TabIndex = 3;
|
||||
this.btnGonder.Text = "&Gönder";
|
||||
this.btnGonder.UseVisualStyleBackColor = true;
|
||||
this.btnGonder.Click += new System.EventHandler(this.btnGonder_Click);
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(32, 515);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(57, 13);
|
||||
this.label5.TabIndex = 7;
|
||||
this.label5.Text = "Seçili Kişi :";
|
||||
//
|
||||
// cmbBirimler
|
||||
//
|
||||
this.cmbBirimler.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbBirimler.FlatStyle = System.Windows.Forms.FlatStyle.System;
|
||||
this.cmbBirimler.FormattingEnabled = true;
|
||||
this.cmbBirimler.Location = new System.Drawing.Point(288, 12);
|
||||
this.cmbBirimler.Name = "cmbBirimler";
|
||||
this.cmbBirimler.Size = new System.Drawing.Size(588, 21);
|
||||
this.cmbBirimler.TabIndex = 8;
|
||||
this.cmbBirimler.SelectedIndexChanged += new System.EventHandler(this.cmbBirimler_SelectedIndexChanged);
|
||||
//
|
||||
// dgSecili
|
||||
//
|
||||
this.dgSecili.BackColor = System.Drawing.Color.Transparent;
|
||||
this.dgSecili.DigitColor = System.Drawing.Color.DarkGreen;
|
||||
this.dgSecili.DigitText = "0000";
|
||||
this.dgSecili.Location = new System.Drawing.Point(88, 510);
|
||||
this.dgSecili.Name = "dgSecili";
|
||||
this.dgSecili.Size = new System.Drawing.Size(80, 35);
|
||||
this.dgSecili.TabIndex = 6;
|
||||
//
|
||||
// dgMM
|
||||
//
|
||||
this.dgMM.BackColor = System.Drawing.Color.Transparent;
|
||||
this.dgMM.DigitColor = System.Drawing.Color.MidnightBlue;
|
||||
this.dgMM.DigitText = "01";
|
||||
this.dgMM.Location = new System.Drawing.Point(76, 272);
|
||||
this.dgMM.Name = "dgMM";
|
||||
this.dgMM.Size = new System.Drawing.Size(39, 31);
|
||||
this.dgMM.TabIndex = 4;
|
||||
//
|
||||
// dgMUz
|
||||
//
|
||||
this.dgMUz.BackColor = System.Drawing.Color.Transparent;
|
||||
this.dgMUz.DigitColor = System.Drawing.Color.Brown;
|
||||
this.dgMUz.DigitText = "000";
|
||||
this.dgMUz.Location = new System.Drawing.Point(206, 272);
|
||||
this.dgMUz.Name = "dgMUz";
|
||||
this.dgMUz.Size = new System.Drawing.Size(52, 31);
|
||||
this.dgMUz.TabIndex = 0;
|
||||
//
|
||||
// dhKacKontor
|
||||
//
|
||||
this.dhKacKontor.BackColor = System.Drawing.Color.Transparent;
|
||||
this.dhKacKontor.DigitColor = System.Drawing.Color.OliveDrab;
|
||||
this.dhKacKontor.DigitText = "000000";
|
||||
this.dhKacKontor.Location = new System.Drawing.Point(6, 17);
|
||||
this.dhKacKontor.Name = "dhKacKontor";
|
||||
this.dhKacKontor.Size = new System.Drawing.Size(254, 70);
|
||||
this.dhKacKontor.TabIndex = 0;
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(884, 573);
|
||||
this.Controls.Add(this.cmbBirimler);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.btnGonder);
|
||||
this.Controls.Add(this.dgSecili);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.statusStrip1);
|
||||
this.Controls.Add(this.Liste);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.MinimumSize = new System.Drawing.Size(900, 612);
|
||||
this.Name = "Form1";
|
||||
this.Text = "hSMS";
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox3.ResumeLayout(false);
|
||||
this.groupBox3.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.ListView Liste;
|
||||
private Owf.Controls.DigitalDisplayControl dhKacKontor;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.GroupBox groupBox3;
|
||||
private System.Windows.Forms.TextBox txtMesaj;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private Owf.Controls.DigitalDisplayControl dgMUz;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button btnGonder;
|
||||
private System.Windows.Forms.TextBox txtPass;
|
||||
private System.Windows.Forms.TextBox txtUser;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private Owf.Controls.DigitalDisplayControl dgMM;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader1;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader2;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader3;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader4;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader5;
|
||||
private System.Windows.Forms.ColumnHeader columnHeader6;
|
||||
private System.Windows.Forms.ComboBox cmbMesajlar;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private Owf.Controls.DigitalDisplayControl dgSecili;
|
||||
private System.Windows.Forms.ComboBox cmbBirimler;
|
||||
}
|
||||
}
|
||||
|
||||
173
hSMS/Form1.cs
Normal file
173
hSMS/Form1.cs
Normal file
@@ -0,0 +1,173 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Windows.Forms;
|
||||
using hSMSpaketi;
|
||||
using MySql.Data;
|
||||
using MySql.Data.MySqlClient;
|
||||
using ComboValue;
|
||||
|
||||
namespace hSMS
|
||||
{
|
||||
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void txtMesaj_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
//dgMUz.DigitText = string.Format("{0###}", txtMesaj.Text.Length);
|
||||
dgMUz.DigitText = txtMesaj.Text.Length.ToString("000");
|
||||
if (txtMesaj.Text.Length > 0) dgMM.DigitText = ((txtMesaj.Text.Length / 160)+1 ).ToString("00");
|
||||
}
|
||||
|
||||
private void txtMesaj_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
dgMUz.DigitText = txtMesaj.Text.Length.ToString("000");
|
||||
if (txtMesaj.Text.Length > 0) dgMM.DigitText = ((txtMesaj.Text.Length / 160)+1) .ToString("00");
|
||||
}
|
||||
|
||||
private void KalanKontur()
|
||||
{
|
||||
//sms Paket = sms("61mobs0077", "610077","");
|
||||
string kactane = SMSPaketi.Kackontur(txtUser.Text, txtPass.Text);
|
||||
string[] kac = kactane.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
//if (kac[0] == "OK") dhKacKontor.DigitText = kac[1];
|
||||
dhKacKontor.DigitText = kac[0].ToString();
|
||||
}
|
||||
|
||||
private void mesajdoldur()
|
||||
{
|
||||
hMySQL db = new hMySQL();
|
||||
db.db_connect();
|
||||
cmbMesajlar.Items.Clear();
|
||||
|
||||
foreach (DataRow row in db.sql_select_dt("select * from sms_mesajlar order by dGontar DESC").Rows)
|
||||
{
|
||||
cmbMesajlar.Items.Add(row["dMesaj"].ToString());
|
||||
}
|
||||
|
||||
foreach (DataRow row in db.sql_select_dt("select * from sms_subekodu order by dSubeAdi").Rows)
|
||||
{
|
||||
Liste.Groups.Add(new ListViewGroup(row["dOto"].ToString(),row["dSubeAdi"].ToString()));
|
||||
//cmbBirimler.Items.Add(row["dSubeAdi"].ToString());
|
||||
cmbBirimler.Items.Add(new ComboboxValue(Convert.ToInt32(row["dOto"]), row["dSubeAdi"].ToString()));
|
||||
//cmbMesajlar.SelectedItem = row["dOto].ToString();
|
||||
|
||||
//ComboboxValue tmpComboboxValue = (ComboboxValue)cb.SelectedItem;
|
||||
}
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
Liste.Items.Clear();
|
||||
|
||||
txtUser.Text = "dsi22trb"; // "61mobs0077";
|
||||
txtPass.Text = "Oy333544Y"; // "610077";
|
||||
|
||||
KalanKontur();
|
||||
mesajdoldur();
|
||||
|
||||
|
||||
/* ListViewGroup grup1 = new ListViewGroup("Personeller");
|
||||
ListViewGroup grup2 = new ListViewGroup("Bölge");
|
||||
|
||||
Liste.Groups.Add(grup1);
|
||||
Liste.Groups.Add(grup2);
|
||||
*/
|
||||
|
||||
Random rnd = new Random();
|
||||
hMySQL db = new hMySQL();
|
||||
db.db_connect();
|
||||
foreach (DataRow row in db.sql_select_dt("select * from sms_rehber order by ADSOYAD").Rows)
|
||||
{
|
||||
ListViewItem lv = new ListViewItem(row["ADSOYAD"].ToString(), Liste.Groups[rnd.Next(cmbBirimler.Items.Count)]);
|
||||
lv.SubItems.Add(row["GSMNO"].ToString());
|
||||
lv.SubItems.Add(row["GSMNO1"].ToString());
|
||||
lv.SubItems.Add(row["TC_KIMLIKNO"].ToString());
|
||||
Liste.Items.Add(lv);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btnGonder_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
int i = 0;
|
||||
string ne = "";
|
||||
|
||||
ListView.CheckedListViewItemCollection checkedItems = Liste.CheckedItems;
|
||||
foreach (ListViewItem item in checkedItems)
|
||||
{
|
||||
ne += item.SubItems[1].Text + "," ;
|
||||
}
|
||||
|
||||
/*
|
||||
for (i = 0; i <= Liste.CheckedItems.Count; i++);
|
||||
{
|
||||
ne= ne + Liste.CheckedItems[i].SubItems[1].Text + ",";
|
||||
}
|
||||
*/
|
||||
|
||||
ne = ne.Substring(1, ne.Length - 2);
|
||||
|
||||
String[] numaralar = { ne };
|
||||
//sms smspak = new sms(txtUser.Text, txtPass.Text, "");
|
||||
//smspak.SMSEkle(txtMesaj.Text, numaralar);
|
||||
//String sonuc = smspak.Gonder();
|
||||
|
||||
SMSPaketi smspak = new SMSPaketi(txtUser.Text, txtPass.Text, "DSI22.BOLGE");
|
||||
smspak.addSMS(txtMesaj.Text, numaralar);
|
||||
String sonuc = smspak.gonder();
|
||||
|
||||
MessageBox.Show(sonuc);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Hata: " + ex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* hMySQL db = new hMySQL();
|
||||
db.db_connect();
|
||||
db.insert_values("dMesaj", txtMesaj.Text);
|
||||
db.insert_values("dGonTar", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
db.sql_query(db.sql_insert("sms_mesajlar"));
|
||||
|
||||
mesajdoldur();
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
private void cmbMesajlar_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
txtMesaj.Text = cmbMesajlar.Text;
|
||||
}
|
||||
|
||||
private void Liste_ItemChecked(object sender, ItemCheckedEventArgs e)
|
||||
{
|
||||
dgSecili.DigitText = Liste.CheckedItems.Count.ToString("#0000");
|
||||
}
|
||||
|
||||
private void Liste_ItemCheck(object sender, ItemCheckEventArgs e)
|
||||
{
|
||||
//Liste.Items.gr = grup2;
|
||||
|
||||
}
|
||||
|
||||
private void cmbBirimler_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
ComboboxValue tmpComboboxValue = (ComboboxValue)cmbBirimler.SelectedItem;
|
||||
// MessageBox.Show(tmpComboboxValue.Id.ToString() );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
126
hSMS/Form1.resx
Normal file
126
hSMS/Form1.resx
Normal file
@@ -0,0 +1,126 @@
|
||||
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<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" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>25</value>
|
||||
</metadata>
|
||||
</root>
|
||||
22
hSMS/Program.cs
Normal file
22
hSMS/Program.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace hSMS
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Form1());
|
||||
}
|
||||
}
|
||||
}
|
||||
36
hSMS/Properties/AssemblyInfo.cs
Normal file
36
hSMS/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 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("hSMS")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("hSMS")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[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)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("e8668b7d-8116-4418-b49d-766c0f31a454")]
|
||||
|
||||
// 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")]
|
||||
71
hSMS/Properties/Resources.Designer.cs
generated
Normal file
71
hSMS/Properties/Resources.Designer.cs
generated
Normal file
@@ -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 hSMS.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("hSMS.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
hSMS/Properties/Resources.resx
Normal file
117
hSMS/Properties/Resources.resx
Normal file
@@ -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>
|
||||
30
hSMS/Properties/Settings.Designer.cs
generated
Normal file
30
hSMS/Properties/Settings.Designer.cs
generated
Normal file
@@ -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 hSMS.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
hSMS/Properties/Settings.settings
Normal file
7
hSMS/Properties/Settings.settings
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
311
hSMS/hMySQL.cs
Normal file
311
hSMS/hMySQL.cs
Normal file
@@ -0,0 +1,311 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using MySql.Data;
|
||||
using MySql.Data.MySqlClient;
|
||||
|
||||
|
||||
namespace hSMS
|
||||
{
|
||||
class hMySQL
|
||||
{
|
||||
|
||||
MySqlConnection connection;
|
||||
MySqlCommand command;
|
||||
MySqlDataReader reader;
|
||||
MySqlDataAdapter adapter;
|
||||
DataTable table;
|
||||
|
||||
private string server = "10.122.1.102"; // database hostname.
|
||||
private string database = "dsi22"; // database name
|
||||
private string user = "dsi22"; // database username.
|
||||
private string password = "1q2w3e4r"; // database password
|
||||
|
||||
private string sql = "";
|
||||
private string field = "";
|
||||
private string value = "";
|
||||
private int t = 0;
|
||||
|
||||
private bool conn;
|
||||
|
||||
/*
|
||||
* database connection
|
||||
*
|
||||
* MySql Sunucusuyla bağlanti kurmamızı sağlayan bağlanti fonksiyonu
|
||||
*/
|
||||
|
||||
public void db_connect()
|
||||
{
|
||||
|
||||
this.conn = true;
|
||||
this.connection = new MySqlConnection("server=" + this.server + ";database=" + this.database + ";user=" + this.user + ";password=" + this.password + ";charset=utf8");
|
||||
|
||||
try
|
||||
{
|
||||
this.connection.Open();
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
this.conn = false;
|
||||
|
||||
MessageBox.Show("MysqlServer'ın çalıştığından emin olun. \n" + e.Message,"Bağlantı Hatası", MessageBoxButtons.OK,MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* sql select extra
|
||||
*
|
||||
* SELECT SQL sorgusuna extra sorgu eklemek için kullanılır
|
||||
*/
|
||||
|
||||
public string sql_select_extra(string sql)
|
||||
{
|
||||
|
||||
this.sql = this.sql + " WHERE " + sql;
|
||||
|
||||
return this.sql;
|
||||
|
||||
}
|
||||
|
||||
/* Data Table */
|
||||
public DataTable sql_select_dt(string sql)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
if (this.conn)
|
||||
{
|
||||
try
|
||||
{
|
||||
MySqlDataAdapter ada = new MySqlDataAdapter(sql, this.connection);
|
||||
ada.Fill(dt);
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Sorgunuzu kontrol Ediniz." + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return dt;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* sql select
|
||||
*
|
||||
* Temel SELECT sorgusu oluşturmak için kullanılır
|
||||
*/
|
||||
|
||||
public string sql_select(string tableName, string field)
|
||||
{
|
||||
|
||||
this.sql = "SELECT " + field + " FROM " + tableName;
|
||||
|
||||
return sql;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* sql insert_values
|
||||
*
|
||||
* INSERT SQL sorgusu için değerler girmemizi sağlar
|
||||
*/
|
||||
|
||||
public void insert_values(string field, string value)
|
||||
{
|
||||
|
||||
if (t == 0)
|
||||
{
|
||||
|
||||
this.field = field;
|
||||
this.value = "'" + value + "'";
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
this.field = field + "," + this.field;
|
||||
this.value = "'" + value + "'" + "," + this.value;
|
||||
}
|
||||
t++;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* sql select query reader
|
||||
*
|
||||
* SELECT deyimi yardımıyla MySqlDataReader tipinde result değişkeni yardımıyla döndürür
|
||||
*/
|
||||
|
||||
public MySqlDataReader sql_query_select(string sql)
|
||||
{
|
||||
|
||||
if (this.conn)
|
||||
{
|
||||
try
|
||||
{
|
||||
command = new MySqlCommand(sql, connection);
|
||||
reader = command.ExecuteReader();
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Sorgunuzu kontrol Ediniz." + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
return reader;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* sql query
|
||||
*
|
||||
* insert_values() fonk. ile oluşturulan SQL cümleciğini sorgular.
|
||||
*/
|
||||
|
||||
public int sql_query(string sql)
|
||||
{
|
||||
|
||||
command = new MySqlCommand(sql, connection);
|
||||
|
||||
try
|
||||
{
|
||||
return command.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
MessageBox.Show("Veritabanındaki alan ismini kontrol ediniz." + e.Message, "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* sql insert_values
|
||||
*
|
||||
* insert_values() ile oluşturulan SQL cümleciğini oluşturur.
|
||||
*/
|
||||
|
||||
public string sql_insert(string tableName)
|
||||
{
|
||||
|
||||
this.t = 0;
|
||||
sql = "INSERT INTO " + tableName + " (" + this.field + ") VALUES (" + this.value + ")";
|
||||
|
||||
this.value = "";
|
||||
this.field = "";
|
||||
|
||||
return sql;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* sql update
|
||||
*
|
||||
* sql_update() fonksiyonu için gerekli olan UPDATE SQL cümleciğini oluşturur.
|
||||
*/
|
||||
|
||||
public void update_values(string field, string value)
|
||||
{
|
||||
|
||||
if (this.field == "")
|
||||
{
|
||||
this.field = this.field + field + "='" + value + "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.field = this.field + "," + field + "='" + value + "'";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* sql update_values
|
||||
*
|
||||
* update_values() fonk. ile oluşturulan SQL cümleciğini oluşturur.
|
||||
*/
|
||||
|
||||
public string sql_update(string tableName, string condition)
|
||||
{
|
||||
|
||||
sql = "UPDATE " + tableName + " SET " + this.field + " WHERE " + condition;
|
||||
|
||||
this.value = "";
|
||||
this.field = "";
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
/*
|
||||
* sql delete
|
||||
*
|
||||
* DELETE SQL sorgusunu oluşturmak için kullanılır
|
||||
*/
|
||||
|
||||
public string sql_delete(string tableName, string condition)
|
||||
{
|
||||
|
||||
sql = "DELETE FROM " + tableName + " WHERE " + condition;
|
||||
|
||||
return sql;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* sql datagiridView
|
||||
*
|
||||
* Datagrid için kullanılan SQL sorgusuna uygun sonuçları gösterir.
|
||||
*/
|
||||
|
||||
|
||||
public void sql_adapter(string sql, DataGridView name)
|
||||
{
|
||||
|
||||
adapter = new MySqlDataAdapter(sql, connection);
|
||||
table = new DataTable();
|
||||
|
||||
try
|
||||
{
|
||||
adapter.Fill(table);
|
||||
}
|
||||
|
||||
catch
|
||||
{
|
||||
|
||||
MessageBox.Show("Mysql Sunucunuzun çalışıp çalışmadıgını kontrol ediniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
|
||||
}
|
||||
|
||||
name.DataSource = table;
|
||||
}
|
||||
|
||||
/*
|
||||
* database connection close
|
||||
*
|
||||
* Açık olan bağlantının kapatılmasını sağlar
|
||||
*/
|
||||
|
||||
public void Close()
|
||||
{
|
||||
try
|
||||
{
|
||||
connection.Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// yok bişi
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
101
hSMS/hSMS.csproj
Normal file
101
hSMS/hSMS.csproj
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{E8668B7D-8116-4418-B49D-766C0F31A454}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>hSMS</RootNamespace>
|
||||
<AssemblyName>hSMS</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</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>
|
||||
<ItemGroup>
|
||||
<Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ComboboxValue.cs" />
|
||||
<Compile Include="Form1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.cs">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="hMySQL.cs" />
|
||||
<Compile Include="mutlucell.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="sms.cs" />
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Owf.Controls.DigitalDisplayControl\Owf.Controls.DigitalDisplayControl.csproj">
|
||||
<Project>{5D082F88-4290-4049-9984-FCB126A7BD4E}</Project>
|
||||
<Name>Owf.Controls.DigitalDisplayControl</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
124
hSMS/mutlucell.cs
Normal file
124
hSMS/mutlucell.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
||||
|
||||
namespace hSMS
|
||||
{
|
||||
public class SMSPaketi
|
||||
{
|
||||
public SMSPaketi(String ka, String parola, String org)
|
||||
{
|
||||
start += "<smspack ka=\"" + xmlEncode(ka) + "\" pwd=\"" + xmlEncode(parola)
|
||||
+ "\" org=\"" + xmlEncode(org) + "\">";
|
||||
|
||||
}
|
||||
|
||||
public SMSPaketi(String ka, String parola, String org, DateTime tarih)
|
||||
{
|
||||
start += "<smspack ka=\"" + xmlEncode(ka) + "\" pwd=\"" + xmlEncode(parola) +
|
||||
"\" org=\"" + xmlEncode(org) + "\" tarih=\"" + tarihStr(tarih) + "\">";
|
||||
|
||||
}
|
||||
|
||||
public void addSMS(String mesaj, String[] numaralar)
|
||||
{
|
||||
body += "<mesaj><metin>";
|
||||
body += xmlEncode(mesaj);
|
||||
body += "</metin><nums>";
|
||||
foreach (String s in numaralar)
|
||||
{
|
||||
body += xmlEncode(s) + ",";
|
||||
}
|
||||
body += "</nums></mesaj>";
|
||||
}
|
||||
|
||||
public String xml()
|
||||
{
|
||||
if (body.Length == 0)
|
||||
throw new ArgumentException("SMS paketinede sms yok!");
|
||||
return start + body + end;
|
||||
}
|
||||
|
||||
public String gonder()
|
||||
{
|
||||
WebClient wc = new WebClient();
|
||||
|
||||
string postData = xml();
|
||||
wc.Headers.Add("Content-Type", "text/xml; charset=UTF-8");
|
||||
// Apply ASCII Encoding to obtain the string as a byte array.
|
||||
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
|
||||
byte[] responseArray = wc.UploadData("https://smsgw.mutlucell.com/smsgw-ws/sndblkex", "POST", byteArray);
|
||||
String response = Encoding.UTF8.GetString(responseArray);
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* ka = kullanici adi
|
||||
* parola
|
||||
* id: gonderim sonucu donen paket ID
|
||||
*
|
||||
*/
|
||||
public static String rapor(String ka, String parola, long id)
|
||||
{
|
||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
|
||||
"<smsrapor ka=\"" + ka + "\" pwd=\"" + parola + "\" id=\"" + id + "\" />";
|
||||
WebClient wc = new WebClient();
|
||||
MessageBox.Show(xml);
|
||||
string postData = xml;
|
||||
wc.Headers.Add("Content-Type", "text/xml; charset=UTF-8");
|
||||
// Apply ASCII Encoding to obtain the string as a byte array.
|
||||
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
|
||||
byte[] responseArray = wc.UploadData("https://smsgw.mutlucell.com/smsgw-ws/gtblkrprtex", "POST", byteArray);
|
||||
String response = Encoding.UTF8.GetString(responseArray);
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
private static String tarihStr(DateTime d)
|
||||
{
|
||||
return xmlEncode(d.ToString("yyyy-MM-dd HH:mm"));
|
||||
}
|
||||
|
||||
private static String xmlEncode(String s)
|
||||
{
|
||||
s = s.Replace("&", "&");
|
||||
s = s.Replace("<", "<");
|
||||
s = s.Replace(">", ">");
|
||||
s = s.Replace("'", "'");
|
||||
s = s.Replace("\"", """);
|
||||
return s;
|
||||
}
|
||||
|
||||
public static String Kackontur(String ka, String parola)
|
||||
{
|
||||
try
|
||||
{
|
||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
|
||||
"<smskredi ka =\"" + xmlEncode(ka) + "\" pwd =\"" + xmlEncode(parola) + "\" />";
|
||||
|
||||
WebClient wc = new WebClient();
|
||||
string postData = xml;
|
||||
wc.Headers.Add("Content-Type", "text/xml; charset=UTF-8");
|
||||
// Apply ASCII Encoding to obtain the string as a byte array.
|
||||
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
|
||||
byte[] responseArray = wc.UploadData("https://smsgw.mutlucell.com/smsgw-ws/gtcrdtex", "POST", byteArray);
|
||||
String response = Encoding.UTF8.GetString(responseArray);
|
||||
return response;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string hataVar = "Bağlantınızı kontrol ediniz. " + ex.Message;
|
||||
return hataVar;
|
||||
}
|
||||
}
|
||||
|
||||
private String start = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
||||
private String end = "</smspack>";
|
||||
private String body = "";
|
||||
}
|
||||
|
||||
}
|
||||
217
hSMS/sms.cs
Normal file
217
hSMS/sms.cs
Normal file
@@ -0,0 +1,217 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Net;
|
||||
|
||||
namespace hSMSpaketi
|
||||
{
|
||||
public partial class sms
|
||||
{
|
||||
private String start = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
||||
private String end = "</MainmsgBody>";
|
||||
private String body = "";
|
||||
|
||||
|
||||
public sms(String ka, String parola, String org)
|
||||
{
|
||||
start += "<MainmsgBody>" +
|
||||
"<UserName>" + xmlEncode(ka) + "</UserName>" +
|
||||
"<PassWord>" + xmlEncode(parola) + "</PassWord>" +
|
||||
"<CompanyCode>" + xmlEncode(org) + "</CompanyCode>";
|
||||
}
|
||||
|
||||
public sms(String ka, String parola, String org, DateTime tarih)
|
||||
{
|
||||
start += "<MainmsgBody>" +
|
||||
"<UserName>" + xmlEncode(ka) + "</UserName>" +
|
||||
"<PassWord>" + xmlEncode(parola) + "</PassWord>" +
|
||||
"<CompanyCode>" + xmlEncode(org) + "</CompanyCode>" +
|
||||
"<SDate>" + tarihStr(tarih) + "</SDate>";
|
||||
|
||||
}
|
||||
|
||||
public void SMSEkle(String mesaj, String[] numaralar)
|
||||
{
|
||||
body += "<Type>1</Type>";
|
||||
body += "<Mesgbody><![CDATA[";
|
||||
body += xmlEncode(mesaj);
|
||||
body += "]]></Mesgbody><Numbers>";
|
||||
foreach (String s in numaralar)
|
||||
{
|
||||
body += xmlEncode(s) + ",";
|
||||
}
|
||||
body += "</Numbers>";
|
||||
}
|
||||
|
||||
public String xml()
|
||||
{
|
||||
if (body.Length == 0)
|
||||
throw new ArgumentException("SMS paketinede sms yok!");
|
||||
return start + body + end;
|
||||
}
|
||||
|
||||
|
||||
public String Gonder()
|
||||
{
|
||||
try
|
||||
{
|
||||
WebClient wc = new WebClient();
|
||||
|
||||
string postData = xml();
|
||||
wc.Headers.Add("Content-Type", "text/xml; charset=UTF-8");
|
||||
// Apply ASCII Encoding to obtain the string as a byte array.
|
||||
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
|
||||
byte[] responseArray = wc.UploadData("http://gateway.3gmesaj.com/SendSmsMany.aspx", "POST", byteArray);
|
||||
String response = Encoding.UTF8.GetString(responseArray);
|
||||
return response;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string hataVar = "Bağlantınızı kontrol ediniz. " + ex.Message + "\n * " + HataKontrol(ex.Message);
|
||||
return hataVar;
|
||||
}
|
||||
}
|
||||
|
||||
public static String rapor(String ka, String parola, long id, int tip)
|
||||
{
|
||||
String response = "";
|
||||
try
|
||||
{ /*
|
||||
1 Bekleyen Numaralar(Kullanımda ancak kapsama alanı dışında yada telefon kapalı)
|
||||
2 İletilen Numaralar
|
||||
3 Sistem Hatası(bu numara kullanımda değil yada servis dışı)
|
||||
4 İletilememesinden dolayı zaman aşımı (Xml içinde SDATE ve EDATE değerleri verilmediği takdirde default 24 saattir.)
|
||||
*/
|
||||
String xml = "<ReportMain>" +
|
||||
"<UserName>" + xmlEncode(ka) + "</UserName>" +
|
||||
"<PassWord>" + xmlEncode(parola) + "</PassWord>" +
|
||||
"<CompanyCode>" + xmlEncode(id.ToString()) + "</CompanyCode>" +
|
||||
"<Msgid>" + xmlEncode(id.ToString()) + "</Msgid>" +
|
||||
"<Type>" + xmlEncode(tip.ToString()) +"</Type>" +
|
||||
"<Delm>|</Delm></ReportMain>";
|
||||
|
||||
WebClient wc = new WebClient();
|
||||
//MessageBox.Show(xml);
|
||||
string postData = xml;
|
||||
wc.Headers.Add("Content-Type", "text/xml; charset=UTF-8");
|
||||
// Apply ASCII Encoding to obtain the string as a byte array.
|
||||
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
|
||||
byte[] responseArray = wc.UploadData("https://smsgw.mutlucell.com/smsgw-ws/gtblkrprtex", "POST", byteArray);
|
||||
response = Encoding.UTF8.GetString(responseArray);
|
||||
return response;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string hataVar = "Bağlantınızı kontrol ediniz. " + ex.Message + "\n Hata Kodu :" + HataKontrol(response);
|
||||
return hataVar;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static String tarihStr(DateTime d)
|
||||
{
|
||||
return xmlEncode(d.ToString("yyyy-MM-dd HH:mm"));
|
||||
}
|
||||
|
||||
private static String xmlEncode(String s)
|
||||
{
|
||||
s = s.Replace("&", "&");
|
||||
s = s.Replace("<", "<");
|
||||
s = s.Replace(">", ">");
|
||||
s = s.Replace("'", "'");
|
||||
s = s.Replace("\"", """);
|
||||
return s;
|
||||
}
|
||||
|
||||
public static String Kackontur(String ka, String parola)
|
||||
{
|
||||
try
|
||||
{
|
||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
|
||||
"<Main>" +
|
||||
"<UserName>" + xmlEncode(ka) + "</UserName>" +
|
||||
"<PassWord>" + xmlEncode(parola) + "</PassWord></Main>";
|
||||
|
||||
WebClient wc = new WebClient();
|
||||
string postData = xml;
|
||||
wc.Headers.Add("Content-Type", "text/xml; charset=UTF-8");
|
||||
// Apply ASCII Encoding to obtain the string as a byte array.
|
||||
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
|
||||
byte[] responseArray = wc.UploadData("http://gateway.3gmesaj.com/QueryCredit.aspx", "POST", byteArray);
|
||||
String response = Encoding.UTF8.GetString(responseArray);
|
||||
return response;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string hataVar = "Bağlantınızı kontrol ediniz. " + ex.Message;
|
||||
return hataVar;
|
||||
}
|
||||
}
|
||||
|
||||
public static String HataKontrol(String ghata)
|
||||
{
|
||||
String hata = "";
|
||||
switch (ghata)
|
||||
{
|
||||
case "00":
|
||||
hata = "Kullanıcı Bilgileri Boş";
|
||||
break;
|
||||
case "01":
|
||||
hata = "Kullanıcı Bilgileri Hatalı";
|
||||
break;
|
||||
case "02":
|
||||
hata = "Hesap Kapalı";
|
||||
break;
|
||||
case "03":
|
||||
hata = "Kontör Hatası";
|
||||
break;
|
||||
case "04":
|
||||
hata = "Bayi Kodunuz Hatalı";
|
||||
break;
|
||||
case "05":
|
||||
hata = "Originator Bilginiz Hatalı";
|
||||
break;
|
||||
case "06":
|
||||
hata = "Yapılan İşlem İçin Yetkiniz Yok";
|
||||
break;
|
||||
case "10":
|
||||
hata = "Geçersiz IP Adresi";
|
||||
break;
|
||||
case "14":
|
||||
hata = "Mesaj Metni Girilmemiş";
|
||||
break;
|
||||
case "15":
|
||||
hata = "GSM Numarası Girilmemiş";
|
||||
break;
|
||||
case "20":
|
||||
hata = "Rapor Hazır Değil";
|
||||
break;
|
||||
case "27":
|
||||
hata = "Aylık Atım Limitiniz Yetersiz";
|
||||
break;
|
||||
case "100":
|
||||
hata = "XML Hatası";
|
||||
break;
|
||||
|
||||
}
|
||||
return hata;
|
||||
/*
|
||||
00 Kullanıcı Bilgileri Boş
|
||||
01 Kullanıcı Bilgileri Hatalı
|
||||
02 Hesap Kapalı
|
||||
03 Kontör Hatası
|
||||
04 Bayi Kodunuz Hatalı
|
||||
05 Originator Bilginiz Hatalı
|
||||
06 Yapılan İşlem İçin Yetkiniz Yok
|
||||
10 Geçersiz IP Adresi
|
||||
14 Mesaj Metni Girilmemiş
|
||||
15 GSM Numarası Girilmemiş
|
||||
20 Rapor Hazır Değil
|
||||
27 Aylık Atım Limitiniz Yetersiz
|
||||
100 XML Hatası
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user