il, ilce tablosu eklendi.

This commit is contained in:
2025-08-09 23:14:48 +03:00
parent 4796beac49
commit 2ab4d14a58
12 changed files with 773 additions and 126 deletions

View File

@@ -21,14 +21,14 @@ namespace DugunSalonu
{
await db.kullanici.AddAsync(new Kullanici
{
Adi = txtAdi.Text,
Soyadi = txtSoyadi.Text,
KullaniciAdi = txtKullaniciAdi.Text,
Parola = txtParola.Text,
Aktif = true,
Admin = false,
CepTel = txtCeptel.Text,
Eposta = txtEposta.Text
adi = txtAdi.Text,
soyadi = txtSoyadi.Text,
kullaniciadi = txtKullaniciAdi.Text,
parola = txtParola.Text,
aktif = true,
admin = false,
ceptel = txtCeptel.Text,
eposta = txtEposta.Text
});
await db.SaveChangesAsync();
FormTemizle();

View File

@@ -29,7 +29,7 @@ namespace DugunSalonu
{
using (dugunsalonuContext db = new dugunsalonuContext())
{
var user = await db.kullanici.Where(k => k.KullaniciAdi == txtKullanici.Text && k.Aktif == true && k.Parola == txtSifre.Text).FirstOrDefaultAsync();
var user = await db.kullanici.Where(k => k.kullaniciadi == txtKullanici.Text && k.aktif == true && k.parola == txtSifre.Text).FirstOrDefaultAsync();
if (user != null)
{
FrmAddKullanici f1 = new FrmAddKullanici();

152
Migrations/20250809145150_mg7.Designer.cs generated Normal file
View File

@@ -0,0 +1,152 @@
// <auto-generated />
using DugunSalonu.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace DugunSalonu.Migrations
{
[DbContext(typeof(dugunsalonuContext))]
[Migration("20250809145150_mg7")]
partial class mg7
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.7")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("DugunSalonu.Models.Il", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("adi")
.IsRequired()
.HasColumnType("text");
b.HasKey("id");
b.ToTable("il");
});
modelBuilder.Entity("DugunSalonu.Models.Kullanici", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("adi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("admin")
.HasColumnType("boolean");
b.Property<bool>("aktif")
.HasColumnType("boolean");
b.Property<string>("ceptel")
.HasMaxLength(10)
.HasColumnType("character varying(10)");
b.Property<string>("eposta")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("kullaniciadi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("parola")
.IsRequired()
.HasColumnType("text");
b.Property<string>("soyadi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("id");
b.ToTable("kullanici");
});
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("CepTel")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("character varying(10)");
b.Property<string>("adi")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<string>("adres")
.HasMaxLength(250)
.HasColumnType("character varying(250)");
b.Property<string>("eposta")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("ilceid")
.HasColumnType("integer");
b.Property<int?>("ilid")
.HasColumnType("integer");
b.Property<string>("telefon")
.HasColumnType("text");
b.Property<string>("vergidairesi")
.HasColumnType("text");
b.Property<string>("verginumarasi")
.HasColumnType("text");
b.Property<string>("webadres")
.HasColumnType("text");
b.HasKey("id");
b.HasIndex("ilid");
b.ToTable("salon");
});
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
{
b.HasOne("DugunSalonu.Models.Il", "il")
.WithMany()
.HasForeignKey("ilid");
b.Navigation("il");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,250 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DugunSalonu.Migrations
{
/// <inheritdoc />
public partial class mg7 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_salon_il_ılıd",
table: "salon");
migrationBuilder.DropColumn(
name: "ılce",
table: "salon");
migrationBuilder.RenameColumn(
name: "ceptel",
table: "salon",
newName: "CepTel");
migrationBuilder.RenameColumn(
name: "ılıd",
table: "salon",
newName: "ilid");
migrationBuilder.RenameColumn(
name: "ıd",
table: "salon",
newName: "id");
migrationBuilder.RenameIndex(
name: "IX_salon_ılıd",
table: "salon",
newName: "IX_salon_ilid");
migrationBuilder.RenameColumn(
name: "ıd",
table: "kullanici",
newName: "id");
migrationBuilder.RenameColumn(
name: "ıd",
table: "il",
newName: "id");
migrationBuilder.AlterColumn<string>(
name: "webadres",
table: "salon",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "verginumarasi",
table: "salon",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "vergidairesi",
table: "salon",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "telefon",
table: "salon",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "adres",
table: "salon",
type: "character varying(250)",
maxLength: 250,
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "adi",
table: "salon",
type: "character varying(150)",
maxLength: 150,
nullable: false,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<int>(
name: "ilid",
table: "salon",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AddColumn<int>(
name: "ilceid",
table: "salon",
type: "integer",
nullable: true);
migrationBuilder.AddForeignKey(
name: "FK_salon_il_ilid",
table: "salon",
column: "ilid",
principalTable: "il",
principalColumn: "id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_salon_il_ilid",
table: "salon");
migrationBuilder.DropColumn(
name: "ilceid",
table: "salon");
migrationBuilder.RenameColumn(
name: "CepTel",
table: "salon",
newName: "ceptel");
migrationBuilder.RenameColumn(
name: "ilid",
table: "salon",
newName: "ılıd");
migrationBuilder.RenameColumn(
name: "id",
table: "salon",
newName: "ıd");
migrationBuilder.RenameIndex(
name: "IX_salon_ilid",
table: "salon",
newName: "IX_salon_ılıd");
migrationBuilder.RenameColumn(
name: "id",
table: "kullanici",
newName: "ıd");
migrationBuilder.RenameColumn(
name: "id",
table: "il",
newName: "ıd");
migrationBuilder.AlterColumn<string>(
name: "webadres",
table: "salon",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "verginumarasi",
table: "salon",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "vergidairesi",
table: "salon",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "telefon",
table: "salon",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "adres",
table: "salon",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(250)",
oldMaxLength: 250,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "adi",
table: "salon",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(150)",
oldMaxLength: 150);
migrationBuilder.AlterColumn<int>(
name: "ılıd",
table: "salon",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AddColumn<int>(
name: "ılce",
table: "salon",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddForeignKey(
name: "FK_salon_il_ılıd",
table: "salon",
column: "ılıd",
principalTable: "il",
principalColumn: "ıd",
onDelete: ReferentialAction.Cascade);
}
}
}

173
Migrations/20250809153336_mg8.Designer.cs generated Normal file
View File

@@ -0,0 +1,173 @@
// <auto-generated />
using DugunSalonu.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace DugunSalonu.Migrations
{
[DbContext(typeof(dugunsalonuContext))]
[Migration("20250809153336_mg8")]
partial class mg8
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.7")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("DugunSalonu.Models.Il", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("adi")
.IsRequired()
.HasColumnType("text");
b.HasKey("id");
b.ToTable("il");
});
modelBuilder.Entity("DugunSalonu.Models.Ilce", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("adi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("ilid")
.HasColumnType("integer");
b.HasKey("id");
b.ToTable("ilce");
});
modelBuilder.Entity("DugunSalonu.Models.Kullanici", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("adi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<bool>("admin")
.HasColumnType("boolean");
b.Property<bool>("aktif")
.HasColumnType("boolean");
b.Property<string>("ceptel")
.HasMaxLength(10)
.HasColumnType("character varying(10)");
b.Property<string>("eposta")
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("kullaniciadi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("parola")
.IsRequired()
.HasColumnType("text");
b.Property<string>("soyadi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.HasKey("id");
b.ToTable("kullanici");
});
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("CepTel")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("character varying(10)");
b.Property<string>("adi")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<string>("adres")
.HasMaxLength(250)
.HasColumnType("character varying(250)");
b.Property<string>("eposta")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("ilceid")
.HasColumnType("integer");
b.Property<int?>("ilid")
.HasColumnType("integer");
b.Property<string>("telefon")
.HasColumnType("text");
b.Property<string>("vergidairesi")
.HasColumnType("text");
b.Property<string>("verginumarasi")
.HasColumnType("text");
b.Property<string>("webadres")
.HasColumnType("text");
b.HasKey("id");
b.HasIndex("ilid");
b.ToTable("salon");
});
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
{
b.HasOne("DugunSalonu.Models.Il", "il")
.WithMany()
.HasForeignKey("ilid");
b.Navigation("il");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace DugunSalonu.Migrations
{
/// <inheritdoc />
public partial class mg8 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ilce",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
adi = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
ilid = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ilce", x => x.id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ilce");
}
}
}

View File

@@ -23,139 +23,135 @@ namespace DugunSalonu.Migrations
modelBuilder.Entity("DugunSalonu.Models.Il", b =>
{
b.Property<int>("Id")
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("ıd");
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("Adi")
b.Property<string>("adi")
.IsRequired()
.HasColumnType("text")
.HasColumnName("adi");
.HasColumnType("text");
b.HasKey("Id");
b.HasKey("id");
b.ToTable("il");
});
modelBuilder.Entity("DugunSalonu.Models.Ilce", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("adi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<int>("ilid")
.HasColumnType("integer");
b.HasKey("id");
b.ToTable("ilce");
});
modelBuilder.Entity("DugunSalonu.Models.Kullanici", b =>
{
b.Property<int>("Id")
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("ıd");
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("Adi")
b.Property<string>("adi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("adi");
.HasColumnType("character varying(50)");
b.Property<bool>("Admin")
.HasColumnType("boolean")
.HasColumnName("admin");
b.Property<bool>("admin")
.HasColumnType("boolean");
b.Property<bool>("Aktif")
.HasColumnType("boolean")
.HasColumnName("aktif");
b.Property<bool>("aktif")
.HasColumnType("boolean");
b.Property<string>("CepTel")
b.Property<string>("ceptel")
.HasMaxLength(10)
.HasColumnType("character varying(10)")
.HasColumnName("ceptel");
.HasColumnType("character varying(10)");
b.Property<string>("Eposta")
b.Property<string>("eposta")
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("eposta");
.HasColumnType("character varying(50)");
b.Property<string>("KullaniciAdi")
b.Property<string>("kullaniciadi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("kullaniciadi");
.HasColumnType("character varying(50)");
b.Property<string>("Parola")
b.Property<string>("parola")
.IsRequired()
.HasColumnType("text")
.HasColumnName("parola");
.HasColumnType("text");
b.Property<string>("Soyadi")
b.Property<string>("soyadi")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)")
.HasColumnName("soyadi");
.HasColumnType("character varying(50)");
b.HasKey("Id");
b.HasKey("id");
b.ToTable("kullanici");
});
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
{
b.Property<int>("Id")
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("ıd");
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Adi")
.IsRequired()
.HasColumnType("text")
.HasColumnName("adi");
b.Property<string>("Adres")
.IsRequired()
.HasColumnType("text")
.HasColumnName("adres");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
b.Property<string>("CepTel")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("character varying(10)")
.HasColumnName("ceptel");
.HasColumnType("character varying(10)");
b.Property<string>("Eposta")
b.Property<string>("adi")
.IsRequired()
.HasColumnType("text")
.HasColumnName("eposta");
.HasMaxLength(150)
.HasColumnType("character varying(150)");
b.Property<int>("IlId")
.HasColumnType("integer")
.HasColumnName("ılıd");
b.Property<string>("adres")
.HasMaxLength(250)
.HasColumnType("character varying(250)");
b.Property<int>("Ilce")
.HasColumnType("integer")
.HasColumnName("ılce");
b.Property<string>("Telefon")
b.Property<string>("eposta")
.IsRequired()
.HasColumnType("text")
.HasColumnName("telefon");
.HasColumnType("text");
b.Property<string>("VergiDairesi")
.IsRequired()
.HasColumnType("text")
.HasColumnName("vergidairesi");
b.Property<int?>("ilceid")
.HasColumnType("integer");
b.Property<string>("VergiNumarasi")
.IsRequired()
.HasColumnType("text")
.HasColumnName("verginumarasi");
b.Property<int?>("ilid")
.HasColumnType("integer");
b.Property<string>("WebAdres")
.IsRequired()
.HasColumnType("text")
.HasColumnName("webadres");
b.Property<string>("telefon")
.HasColumnType("text");
b.HasKey("Id");
b.Property<string>("vergidairesi")
.HasColumnType("text");
b.HasIndex("IlId");
b.Property<string>("verginumarasi")
.HasColumnType("text");
b.Property<string>("webadres")
.HasColumnType("text");
b.HasKey("id");
b.HasIndex("ilid");
b.ToTable("salon");
});
@@ -164,9 +160,7 @@ namespace DugunSalonu.Migrations
{
b.HasOne("DugunSalonu.Models.Il", "il")
.WithMany()
.HasForeignKey("IlId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("ilid");
b.Navigation("il");
});

View File

@@ -10,13 +10,11 @@ namespace DugunSalonu.Models
public class Il
{
public Il()
{
salons = new HashSet<Salon>();
}
public Il() => salons = new HashSet<Salon>();
[Key]
public int Id { get; set; }
public string Adi { get; set; }
public int id { get; set; }
public string adi { get; set; }
ICollection<Salon>? salons { get; set; }
}

29
Models/Ilce.cs Normal file
View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DugunSalonu.Models
{
internal class Ilce
{
public Ilce()
{
il = new HashSet<Salon>();
}
[Key]
public int id { get; set; }
[Required]
[MaxLength(50)]
public required string adi { get; set; }
[Required]
public required int ilid { get; set; }
ICollection<Salon>? il { get; set; }
ICollection<Salon>? ilce { get; set; }
}
}

View File

@@ -11,27 +11,28 @@ namespace DugunSalonu.Models
internal class Kullanici
{
[Key]
public int Id { get; set; }
public int id { get; set; }
[MaxLength(50), MinLength(5)]
[Required]
public required string kullaniciadi { get; set; }
[Required]
[MaxLength(50)]
public required string adi { get; set; }
[Required]
[MaxLength(50)]
public required string soyadi { get; set; }
public required string KullaniciAdi { get; set; }
public string adisoyadi { get { return $"{adi} {soyadi}"; } }
[Required]
public required string parola { get; set; }
[MaxLength(50)]
public required string Adi { get; set; }
[Required]
[MaxLength(50)]
public required string Soyadi { get; set; }
public string AdiSoyadi { get { return $"{Adi} {Soyadi}"; } }
[Required]
public required string Parola { get; set; }
[MaxLength(50)]
public string? Eposta { get; set; }
public string? eposta { get; set; }
[MaxLength(10), MinLength(10)]
public string? CepTel { get; set; }
public bool Aktif { get; set; }
public bool Admin { get; set; }
public string? ceptel { get; set; }
public bool aktif { get; set; }
public bool admin { get; set; }
}
}

View File

@@ -10,20 +10,33 @@ namespace DugunSalonu.Models
public class Salon
{
[Key]
public int Id { get; set; }
public string Adi { get; set; }
public string Adres { get; set; }
public int IlId { get; set; }
public int Ilce { get; set; }
public string Eposta { get; set; }
public string VergiDairesi { get; set; }
public string VergiNumarasi { get; set; }
public string Telefon { get; set; }
public int id { get; set; }
[Required]
[MaxLength(150)]
[MinLength(5)]
public required string adi { get; set; }
[MaxLength(250)]
public string? adres { get; set; }
public int? ilid { get; set; }
public int? ilceid { get; set; }
[Required]
public required string eposta { get; set; }
public string? vergidairesi { get; set; }
public string? verginumarasi { get; set; }
public string? telefon { get; set; }
[Required]
[MaxLength(10), MinLength(10)]
public string CepTel { get; set; }
public string WebAdres { get; set; }
public required string CepTel { get; set; }
public string? webadres { get; set; }
public Il? il { get; set; }
}
}

View File

@@ -15,6 +15,7 @@ namespace DugunSalonu.Models
public DbSet<Salon> salon { get; set; }
public DbSet<Il> il { get; set; }
public DbSet<Ilce> ilce { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
@@ -22,7 +23,7 @@ namespace DugunSalonu.Models
base.OnConfiguring(optionsBuilder);
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
/*protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
@@ -38,6 +39,6 @@ namespace DugunSalonu.Models
// İsteğe bağlı: Tablo isimlerini de büyük harfe dönüştür (eğer istiyorsanız)
entityType.SetTableName(entityType.GetTableName().ToLower());
}
}
}*/
}
}