Browse Source

avvalin

confirmation-email
unknown 11 years ago
parent
commit
0a0bab439d
10 changed files with 259 additions and 6 deletions
  1. +2
    -2
      Sevomin.Models/App.config
  2. +12
    -1
      Sevomin.Models/Avalin.cs
  3. +2
    -2
      Sevomin.Models/Dovomin.cs
  4. +19
    -0
      Sevomin.Models/Helpers/EmailValidationAttribute.cs
  5. +29
    -0
      Sevomin.Models/Migrations/201403270733330_Avvalin-update.Designer.cs
  6. +28
    -0
      Sevomin.Models/Migrations/201403270733330_Avvalin-update.cs
  7. +126
    -0
      Sevomin.Models/Migrations/201403270733330_Avvalin-update.resx
  8. +17
    -0
      Sevomin.Models/Repositories/IRepository.cs
  9. +9
    -1
      Sevomin.Models/Sevomin.Models.csproj
  10. +15
    -0
      Sevomin.WebFrontend/Web.config

+ 2
- 2
Sevomin.Models/App.config View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>


+ 12
- 1
Sevomin.Models/Avalin.cs View File

@ -1,15 +1,26 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Sevomin.Models.Helpers;
namespace Sevomin.Models
{
[Table("Avalin")]
public class Avalin : User
{
[Required]
public string CompanyName { get; set; }
[Required]
[StringLength(12)]
public string NationalId { get; set; }
[StringLength(10)]
public string RegisterId { get; set; }
public string Address { get; set; }
public string CompanyPhoneNumber { get; set; }
[EmailValidation(ErrorMessage="ای میل معتبر نیست")]
public string EMail { get; set; }
public Avalin()
{


+ 2
- 2
Sevomin.Models/Dovomin.cs View File

@ -13,10 +13,10 @@ namespace Sevomin.Models
}
public Dovomin(string userName, string fistName, string lastName)
public Dovomin(string userName, string firstName, string lastName)
: base(userName)
{
this.FirstName = FirstName;
this.FirstName = firstName;
this.LastName = lastName;
}
}


+ 19
- 0
Sevomin.Models/Helpers/EmailValidationAttribute.cs View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sevomin.Models.Helpers
{
using System.ComponentModel.DataAnnotations;
public class EmailValidationAttribute : RegularExpressionAttribute
{
public EmailValidationAttribute()
: base(@"^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-zA-Z0-9]{1}[a-zA-Z0-9\-]{0,62}[a-zA-Z0-9]{1})|[a-zA-Z])\.)+[a-zA-Z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$")
{
}
}
}

+ 29
- 0
Sevomin.Models/Migrations/201403270733330_Avvalin-update.Designer.cs View File

@ -0,0 +1,29 @@
// <auto-generated />
namespace Sevomin.Models.Migrations
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.1.0-30225")]
public sealed partial class Avvalinupdate : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(Avvalinupdate));
string IMigrationMetadata.Id
{
get { return "201403270733330_Avvalin-update"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}

+ 28
- 0
Sevomin.Models/Migrations/201403270733330_Avvalin-update.cs View File

@ -0,0 +1,28 @@
namespace Sevomin.Models.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class Avvalinupdate : DbMigration
{
public override void Up()
{
AddColumn("dbo.Avalin", "RegisterId", c => c.String(maxLength: 10));
AddColumn("dbo.Avalin", "Address", c => c.String());
AddColumn("dbo.Avalin", "CompanyPhoneNumber", c => c.String());
AddColumn("dbo.Avalin", "EMail", c => c.String());
AlterColumn("dbo.Avalin", "CompanyName", c => c.String(nullable: false));
AlterColumn("dbo.Avalin", "NationalId", c => c.String(maxLength: 12));
}
public override void Down()
{
AlterColumn("dbo.Avalin", "NationalId", c => c.String(nullable: false));
AlterColumn("dbo.Avalin", "CompanyName", c => c.String());
DropColumn("dbo.Avalin", "EMail");
DropColumn("dbo.Avalin", "CompanyPhoneNumber");
DropColumn("dbo.Avalin", "Address");
DropColumn("dbo.Avalin", "RegisterId");
}
}
}

+ 126
- 0
Sevomin.Models/Migrations/201403270733330_Avvalin-update.resx View 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>
<data name="Target" xml:space="preserve">
<value>H4sIAAAAAAAEAN1d227jOBJ9X2D/QdDTzCJjO8l2ozewZ5DOZTbYOAnayWDfAlqiHaElSiNRmQSL+bJ52E/aX1hSEiVeZUmWZfeggYbNy6lisYosklXO//747/Snt8C3XmGceCGa2cejiW1B5ISuh9YzO8WrHz7ZP/34179Mr9zgzfqFtTul7UhPlMzsF4yjs/E4cV5gAJJR4DlxmIQrPHLCYAzccHwymfxjfHw8hgTCJliWNf2SIuwFMPtCvl6EyIERToE/D13oJ0U5qVlkqNYdCGASAQfO7AV8DQMPjfKWtnXueyChxf7KtgBCIQaY8Hj2lMAFjkO0XkSkAPiP7xEk7VbAT2DB+1nVvOkwJid0GOOqI4Ny0gSHQUvA49NCLmO5eyfp2qXciOSuiITxOx11Jr2ZfePCrOhL6BMByATPLvyYNp7Z85LEeRLdQTxiHUc55HVM4H4L468jHvHIatzvqNSjk9GE/juyLlIfpzGcIZjiGPhH1kO69D3nX/D9MfwK0ez0eLk6/fThI3BPP/4dnn7gR0rGStoJBaToIQ4jGBPe4Kocv22NxX5juWPZjeuTS4XoEjEJ25q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AAA==</value>
</data>
<data name="DefaultSchema" xml:space="preserve">
<value>dbo</value>
</data>
</root>

+ 17
- 0
Sevomin.Models/Repositories/IRepository.cs View File

@ -0,0 +1,17 @@
using System.Data.Entity.Core.Objects;
namespace Sevomin.Models.Repositories
{
public interface IRepository<K, T>
{
void Add(T entity);
T Find(K identifier);
void Delete(T entity);
void Save(SaveOptions options = SaveOptions.AcceptAllChangesAfterSave);
}
public interface IUserRepository : IRepository<string, User>
{
}
}

+ 9
- 1
Sevomin.Models/Sevomin.Models.csproj View File

@ -58,6 +58,7 @@
<ItemGroup>
<Compile Include="Avalin.cs" />
<Compile Include="Dovomin.cs" />
<Compile Include="Helpers\EmailValidationAttribute.cs" />
<Compile Include="LoginViewModel.cs" />
<Compile Include="Migrations\201403261205298_InitialCreate.cs" />
<Compile Include="Migrations\201403261205298_InitialCreate.Designer.cs">
@ -71,9 +72,13 @@
<Compile Include="Migrations\201403270618585_National_Id_Avalin.Designer.cs">
<DependentUpon>201403270618585_National_Id_Avalin.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201403270733330_Avvalin-update.cs" />
<Compile Include="Migrations\201403270733330_Avvalin-update.Designer.cs">
<DependentUpon>201403270733330_Avvalin-update.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Repository\IRepository.cs" />
<Compile Include="Repositories\IRepository.cs" />
<Compile Include="SignupViewModel.cs" />
<Compile Include="User.cs" />
<Compile Include="UsersDbContext.cs" />
@ -92,6 +97,9 @@
<EmbeddedResource Include="Migrations\201403270618585_National_Id_Avalin.resx">
<DependentUpon>201403270618585_National_Id_Avalin.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201403270733330_Avvalin-update.resx">
<DependentUpon>201403270733330_Avvalin-update.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.


+ 15
- 0
Sevomin.WebFrontend/Web.config View File

@ -4,6 +4,21 @@
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<connectionStrings>
<clear />
<add name="UsersConnectionString" connectionString="Data Source=codiato;Initial Catalog=Sevomin;Integrated Security=True;Pooling=False" providerName="System.Data.SqlClient" />


Loading…
Cancel
Save