using System; using System.Collections.Generic; using Biskilog_Cloud.Shared.Models; using Microsoft.EntityFrameworkCore; namespace ServerManager; public partial class BiskPosContext : DbContext { public BiskPosContext() { } public BiskPosContext(DbContextOptions options) : base(options) { } public virtual DbSet CreditPurchases { get; set; } public virtual DbSet CustomerAccounts { get; set; } public virtual DbSet ProductAltUnits { get; set; } public virtual DbSet RestockLevels { get; set; } public virtual DbSet SystemUserRoles { get; set; } public virtual DbSet TbStocks { get; set; } public virtual DbSet TblBranches { get; set; } public virtual DbSet TblBrands { get; set; } public virtual DbSet TblCancelledTransactions { get; set; } public virtual DbSet TblCarts { get; set; } public virtual DbSet TblCategories { get; set; } public virtual DbSet TblCompanyDetails { get; set; } public virtual DbSet TblCustomers { get; set; } public virtual DbSet TblCustomerPurchases { get; set; } public virtual DbSet TblDeliveryDetails { get; set; } public virtual DbSet TblDeliveryHeads { get; set; } public virtual DbSet TblDeliveryRecipients { get; set; } public virtual DbSet TblDiscountLogs { get; set; } public virtual DbSet TblDrivers { get; set; } public virtual DbSet TblHeldTransactions { get; set; } public virtual DbSet TblInventories { get; set; } public virtual DbSet TblInventoryEntries { get; set; } public virtual DbSet TblInvoices { get; set; } public virtual DbSet TblPriceChanges { get; set; } public virtual DbSet TblProducts { get; set; } public virtual DbSet TblTrucks { get; set; } public virtual DbSet TblTruckAssignments { get; set; } public virtual DbSet TblTruckDriverMappings { get; set; } public virtual DbSet TblTruckInventories { get; set; } public virtual DbSet TblUsers { get; set; } public virtual DbSet TblUserActivities { get; set; } public virtual DbSet UnitOfMeasures { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { entity.HasKey(e => e.ReceiptId); entity.ToTable(tb => tb.HasTrigger("trg_UpdateLastModifiedOnCreditPurchases")); entity.Property(e => e.ReceiptId) .HasMaxLength(120) .HasColumnName("receiptID"); entity.Property(e => e.BranchId) .HasMaxLength(10) .IsUnicode(false) .HasColumnName("branchID"); entity.Property(e => e.CustomerId) .HasMaxLength(120) .HasColumnName("customerID"); entity.Property(e => e.Date).HasColumnName("date"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Paid) .HasColumnType("decimal(19, 2)") .HasColumnName("paid"); entity.Property(e => e.Status) .HasMaxLength(10) .IsUnicode(false) .HasColumnName("status"); entity.Property(e => e.TotalBill) .HasColumnType("decimal(19, 2)") .HasColumnName("totalBill"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable(tb => tb.HasTrigger("trg_UpdateLastModifiedOnCustomerAccounts")); entity.Property(e => e.CountId) .HasMaxLength(120) .HasColumnName("countID"); entity.Property(e => e.Balance) .HasColumnType("decimal(19, 2)") .HasColumnName("balance"); entity.Property(e => e.BranchId) .HasMaxLength(10) .IsUnicode(false) .HasColumnName("branchID"); entity.Property(e => e.Comments) .IsUnicode(false) .HasColumnName("comments"); entity.Property(e => e.Credit) .HasColumnType("decimal(19, 2)") .HasColumnName("credit"); entity.Property(e => e.CustomerId) .HasMaxLength(120) .HasColumnName("customerID"); entity.Property(e => e.Date).HasColumnName("date"); entity.Property(e => e.Debit) .HasColumnType("decimal(19, 2)") .HasColumnName("debit"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.TransactionId) .HasMaxLength(120) .HasColumnName("transactionID"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.DistinctiveCode).HasName("PK_ProductUnitPricing"); entity.ToTable("ProductAltUnit", tb => tb.HasTrigger("trg_UpdateLastModifiedOnProductAltUnit")); entity.Property(e => e.DistinctiveCode) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("distinctiveCode"); entity.Property(e => e.BranchId) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("branchID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Pcode) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("pcode"); entity.Property(e => e.PriceUnit) .HasColumnType("decimal(19, 2)") .HasColumnName("price/unit"); entity.Property(e => e.QuantityUnit).HasColumnName("quantity/unit"); entity.Property(e => e.UnitBarcode) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("unitBarcode"); entity.Property(e => e.UnitCode) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("unitCode"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.ProductId).HasName("PK_ProductRestockLevels"); entity.ToTable(tb => tb.HasTrigger("trg_UpdateLastModifiedOnRestockLevels")); entity.Property(e => e.ProductId) .HasMaxLength(150) .IsUnicode(false) .HasColumnName("productID"); entity.Property(e => e.BranchId) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("branchID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Unit) .HasMaxLength(150) .IsUnicode(false) .HasColumnName("unit"); entity.Property(e => e.WarnLevel).HasColumnName("warnLevel"); }); modelBuilder.Entity(entity => { entity.ToTable("systemUserRoles", tb => tb.HasTrigger("trg_UpdateLastModifiedOnsystemUserRoles")); entity.Property(e => e.Id) .ValueGeneratedNever() .HasColumnName("id"); entity.Property(e => e.Assist).HasColumnName("assist"); entity.Property(e => e.Cashier).HasColumnName("cashier"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Manager).HasColumnName("manager"); entity.Property(e => e.Owner).HasColumnName("owner"); entity.Property(e => e.Roles) .IsUnicode(false) .HasColumnName("roles"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tbStock", tb => tb.HasTrigger("trg_UpdateLastModifiedOntbStock")); entity.Property(e => e.CountId) .HasMaxLength(50) .HasColumnName("countID"); entity.Property(e => e.BranchId) .HasMaxLength(12) .HasColumnName("branchID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Pcode) .HasMaxLength(50) .HasColumnName("pcode"); entity.Property(e => e.Qty).HasColumnName("qty"); entity.Property(e => e.Refno) .HasMaxLength(50) .HasColumnName("refno"); entity.Property(e => e.Sdate) .HasColumnType("date") .HasColumnName("sdate"); entity.Property(e => e.Stockinby) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("stockinby"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.BranchId); entity.ToTable("tblBranches", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblBranches")); entity.Property(e => e.BranchId) .HasMaxLength(12) .HasColumnName("branchID"); entity.Property(e => e.Address) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("address"); entity.Property(e => e.BranchName) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("branchName"); entity.Property(e => e.BranchTelephone) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("branch_telephone"); entity.Property(e => e.City) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("city"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.StateOrProvince) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("state_or_province"); }); modelBuilder.Entity(entity => { entity.ToTable("tblBrand", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblBrand")); entity.Property(e => e.Id) .HasMaxLength(50) .HasColumnName("id"); entity.Property(e => e.BranchId) .HasMaxLength(12) .HasColumnName("branchID"); entity.Property(e => e.Brand) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("brand"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblCancelledTransactions", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblCancelledTransactions")); entity.Property(e => e.CountId) .HasMaxLength(50) .HasColumnName("countID"); entity.Property(e => e.BranchId) .HasMaxLength(50) .HasColumnName("branchID"); entity.Property(e => e.CancelledBy) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("cancelledBy"); entity.Property(e => e.DateCancelled) .HasColumnType("datetime") .HasColumnName("dateCancelled"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Transno) .IsUnicode(false) .HasColumnName("transno"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblCart", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblCart")); entity.Property(e => e.CountId) .HasMaxLength(200) .IsUnicode(false) .HasColumnName("countID"); entity.Property(e => e.Balance) .HasDefaultValueSql("((0))") .HasColumnType("decimal(19, 2)") .HasColumnName("balance"); entity.Property(e => e.BranchId) .HasMaxLength(12) .HasColumnName("branchID"); entity.Property(e => e.Cashier) .HasMaxLength(50) .HasColumnName("cashier"); entity.Property(e => e.Costprice) .HasColumnType("decimal(19, 2)") .HasColumnName("costprice"); entity.Property(e => e.Date).HasColumnName("date"); entity.Property(e => e.Id) .HasMaxLength(50) .HasColumnName("id"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Price) .HasColumnType("decimal(19, 2)") .HasColumnName("price"); entity.Property(e => e.Quantity).HasColumnName("quantity"); entity.Property(e => e.Status) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("status"); entity.Property(e => e.Tendered) .HasDefaultValueSql("((0))") .HasColumnType("decimal(19, 2)") .HasColumnName("tendered"); entity.Property(e => e.Total) .HasColumnType("decimal(19, 2)") .HasColumnName("total"); entity.Property(e => e.Transno).HasColumnName("transno"); entity.Property(e => e.Unit) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("unit"); entity.Property(e => e.ValueAddTax) .HasColumnType("decimal(19, 2)") .HasColumnName("valueAddTax"); }); modelBuilder.Entity(entity => { entity.ToTable("tblCategory", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblCategory")); entity.Property(e => e.Id) .HasMaxLength(50) .HasColumnName("id"); entity.Property(e => e.BranchId) .HasMaxLength(12) .HasColumnName("branchID"); entity.Property(e => e.Category) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("category"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Tin); entity.ToTable("tblCompanyDetails", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblCompanyDetails")); entity.Property(e => e.Tin) .HasMaxLength(60) .HasColumnName("tin"); entity.Property(e => e.Address) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("address"); entity.Property(e => e.CompanyName) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("company_name"); entity.Property(e => e.Email) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("email"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.MainTelephone) .HasMaxLength(50) .HasColumnName("main_telephone"); entity.Property(e => e.Vatno) .HasMaxLength(60) .HasColumnName("vatno"); entity.Property(e => e.Website) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("website"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CustomerId); entity.ToTable("tblCustomers", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblCustomers")); entity.Property(e => e.CustomerId) .HasMaxLength(30) .HasColumnName("customerID"); entity.Property(e => e.Address) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("address"); entity.Property(e => e.BranchId) .HasMaxLength(50) .HasColumnName("branchID"); entity.Property(e => e.DateAdded) .HasColumnType("date") .HasColumnName("dateAdded"); entity.Property(e => e.DateExit) .HasColumnType("date") .HasColumnName("dateExit"); entity.Property(e => e.Email) .HasMaxLength(50) .HasColumnName("email"); entity.Property(e => e.FinancialStatus) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("financialStatus"); entity.Property(e => e.Firstname) .HasMaxLength(50) .IsUnicode(false); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.NameKey1) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("name_key1"); entity.Property(e => e.NameKey2) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("name_key2"); entity.Property(e => e.Status) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("status"); entity.Property(e => e.Surname) .HasMaxLength(50) .IsUnicode(false); entity.Property(e => e.Telephone) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("telephone"); entity.Property(e => e.Tin) .HasMaxLength(50) .HasColumnName("tin"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblCustomerPurchases", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblCustomerPurchases")); entity.Property(e => e.CountId) .HasMaxLength(50) .HasColumnName("countID"); entity.Property(e => e.BranchId) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("branchID"); entity.Property(e => e.CustomerId) .HasMaxLength(50) .HasColumnName("customerID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.TransactionId) .HasMaxLength(50) .HasColumnName("transactionID"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblDeliveryDetails", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblDeliveryDetails")); entity.Property(e => e.CountId) .HasMaxLength(100) .HasColumnName("countID"); entity.Property(e => e.Cost) .HasColumnType("decimal(19, 2)") .HasColumnName("cost"); entity.Property(e => e.DeliveryId) .HasMaxLength(60) .HasColumnName("deliveryID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Pcode) .HasMaxLength(60) .HasColumnName("pcode"); entity.Property(e => e.Quantity).HasColumnName("quantity"); entity.Property(e => e.Unit) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("unit"); entity.Property(e => e.BranchId) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("branchID"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.DeliveryId); entity.ToTable("tblDeliveryHead", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblDeliveryHead")); entity.Property(e => e.DeliveryId) .HasMaxLength(60) .HasColumnName("deliveryID"); entity.Property(e => e.BranchId) .HasMaxLength(20) .HasColumnName("branchID"); entity.Property(e => e.CustomerId) .HasMaxLength(60) .HasColumnName("customerID"); entity.Property(e => e.DateCompleted).HasColumnName("dateCompleted"); entity.Property(e => e.DateInitiated).HasColumnName("dateInitiated"); entity.Property(e => e.Destination) .HasMaxLength(60) .HasColumnName("destination"); entity.Property(e => e.GeneratedBy) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("generatedBy"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Status) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("status"); entity.Property(e => e.TotalCost) .HasColumnType("decimal(19, 2)") .HasColumnName("totalCost"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.DeliveryId); entity.ToTable("tblDeliveryRecipients", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblDeliveryRecipients")); entity.Property(e => e.DeliveryId) .HasMaxLength(60) .HasColumnName("deliveryID"); entity.Property(e => e.Address) .HasMaxLength(60) .HasColumnName("address"); entity.Property(e => e.CustomerId) .HasMaxLength(60) .HasColumnName("customerID"); entity.Property(e => e.Email) .HasMaxLength(60) .HasColumnName("email"); entity.Property(e => e.FromDate) .HasColumnType("date") .HasColumnName("fromDate"); entity.Property(e => e.Fullname) .IsUnicode(false) .HasColumnName("fullname"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Telephone) .HasMaxLength(15) .IsUnicode(false) .HasColumnName("telephone"); entity.Property(e => e.ToDate) .HasColumnType("date") .HasColumnName("toDate"); entity.Property(e => e.BranchId) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("branchID"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblDiscountLogs", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblDiscountLogs")); entity.Property(e => e.CountId) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("countID"); entity.Property(e => e.BranchId) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("branchID"); entity.Property(e => e.Cashier) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("cashier"); entity.Property(e => e.Date).HasColumnName("date"); entity.Property(e => e.Discount) .HasColumnType("decimal(19, 2)") .HasColumnName("discount"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.ReceiptId) .HasMaxLength(50) .HasColumnName("receiptID"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.DriverId); entity.ToTable("tblDrivers", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblDrivers")); entity.Property(e => e.DriverId) .HasMaxLength(50) .HasColumnName("driverID"); entity.Property(e => e.Address1) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("address1"); entity.Property(e => e.Address2) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("address2"); entity.Property(e => e.BranchId) .HasMaxLength(50) .HasColumnName("branchID"); entity.Property(e => e.City) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("city"); entity.Property(e => e.DateOfBirth) .HasColumnType("date") .HasColumnName("dateOfBirth"); entity.Property(e => e.Email) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("email"); entity.Property(e => e.Firstname) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("firstname"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Middlename) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("middlename"); entity.Property(e => e.State) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("state"); entity.Property(e => e.Status) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("status"); entity.Property(e => e.Surname) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("surname"); entity.Property(e => e.Telephone) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("telephone"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblHeldTransaction", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblHeldTransaction")); entity.Property(e => e.CountId) .HasMaxLength(200) .IsUnicode(false) .HasColumnName("countID"); entity.Property(e => e.BranchId) .HasMaxLength(12) .HasColumnName("branchID"); entity.Property(e => e.Cashier) .HasMaxLength(50) .HasColumnName("cashier"); entity.Property(e => e.Costprice) .HasColumnType("decimal(19, 2)") .HasColumnName("costprice"); entity.Property(e => e.CustomerId) .HasMaxLength(200) .IsUnicode(false) .HasColumnName("customerID"); entity.Property(e => e.Date).HasColumnName("date"); entity.Property(e => e.Discount) .HasColumnType("decimal(19, 2)") .HasColumnName("discount"); entity.Property(e => e.Distinctive) .HasMaxLength(200) .IsUnicode(false) .HasColumnName("distinctive"); entity.Property(e => e.InvoiceId) .HasMaxLength(200) .IsUnicode(false) .HasColumnName("invoiceID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Price) .HasColumnType("decimal(19, 2)") .HasColumnName("price"); entity.Property(e => e.ProductId) .HasMaxLength(50) .HasColumnName("productId"); entity.Property(e => e.Quantity).HasColumnName("quantity"); entity.Property(e => e.Status) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("status"); entity.Property(e => e.Total) .HasColumnType("decimal(19, 2)") .HasColumnName("total"); entity.Property(e => e.TransactionId) .HasMaxLength(200) .IsUnicode(false) .HasColumnName("transactionID"); entity.Property(e => e.Unit) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("unit"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblInventory", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblInventory")); entity.Property(e => e.CountId) .HasMaxLength(50) .HasColumnName("countID"); entity.Property(e => e.BranchId) .HasMaxLength(50) .HasColumnName("branchID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Pcode) .HasMaxLength(50) .HasColumnName("pcode"); entity.Property(e => e.Quantity).HasColumnName("quantity"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblInventoryEntries", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblInventoryEntries")); entity.Property(e => e.CountId) .HasMaxLength(120) .HasColumnName("countID"); entity.Property(e => e.BranchId) .HasMaxLength(60) .HasColumnName("branchID"); entity.Property(e => e.Date).HasColumnName("date"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Pcode) .HasMaxLength(50) .HasColumnName("pcode"); entity.Property(e => e.Quantity).HasColumnName("quantity"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId).HasName("PK_tblinvoice"); entity.ToTable("tblInvoice", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblInvoice")); entity.Property(e => e.CountId) .HasMaxLength(50) .HasColumnName("countID"); entity.Property(e => e.BranchId) .HasMaxLength(50) .HasColumnName("branchID"); entity.Property(e => e.DateGenerated) .HasColumnType("date") .HasColumnName("dateGenerated"); entity.Property(e => e.GeneratedBy) .HasMaxLength(50) .HasColumnName("generatedBy"); entity.Property(e => e.InvoiceId) .HasMaxLength(60) .HasColumnName("invoiceID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Pcode) .HasMaxLength(50) .HasColumnName("pcode"); entity.Property(e => e.Quantity).HasColumnName("quantity"); entity.Property(e => e.Status) .HasMaxLength(16) .IsUnicode(false) .HasColumnName("status"); entity.Property(e => e.Totalprice) .HasColumnType("decimal(19, 2)") .HasColumnName("totalprice"); entity.Property(e => e.Unit) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("unit"); entity.Property(e => e.Unitprice) .HasColumnType("decimal(19, 2)") .HasColumnName("unitprice"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblPriceChanges", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblPriceChanges")); entity.Property(e => e.CountId) .HasMaxLength(70) .HasColumnName("countID"); entity.Property(e => e.BranchId) .HasMaxLength(50) .HasColumnName("branchID"); entity.Property(e => e.ChangeDate).HasColumnName("change_date"); entity.Property(e => e.CurrentPrice) .HasColumnType("decimal(19, 2)") .HasColumnName("current_price"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Pcode) .HasMaxLength(120) .HasColumnName("pcode"); entity.Property(e => e.PreviousPrice) .HasColumnType("decimal(19, 2)") .HasColumnName("previous_price"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblProduct", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblProduct")); entity.Property(e => e.CountId) .HasMaxLength(50) .HasColumnName("countID"); entity.Property(e => e.Barcode) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("barcode"); entity.Property(e => e.BaseUnit) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("baseUnit"); entity.Property(e => e.Bid) .HasMaxLength(50) .HasColumnName("bid"); entity.Property(e => e.BranchId) .HasMaxLength(12) .HasColumnName("branchID"); entity.Property(e => e.Cid) .HasMaxLength(50) .HasColumnName("cid"); entity.Property(e => e.Costprice) .HasColumnType("decimal(19, 2)") .HasColumnName("costprice"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Pcode) .HasMaxLength(50) .HasColumnName("pcode"); entity.Property(e => e.Pdesc).HasColumnName("pdesc"); entity.Property(e => e.Price) .HasColumnType("decimal(19, 2)") .HasColumnName("price"); entity.Property(e => e.ProductName) .IsUnicode(false) .HasColumnName("product_name"); entity.Property(e => e.Status) .HasMaxLength(20) .IsUnicode(false) .HasColumnName("status"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.TruckId); entity.ToTable("tblTrucks", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblTrucks")); entity.Property(e => e.TruckId) .HasMaxLength(60) .HasColumnName("truckID"); entity.Property(e => e.BranchId) .HasMaxLength(50) .HasColumnName("branchID"); entity.Property(e => e.Brand) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("brand"); entity.Property(e => e.Driver) .HasMaxLength(50) .HasColumnName("driver"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.LicensePlate) .HasMaxLength(60) .HasColumnName("licensePlate"); entity.Property(e => e.Weight) .HasColumnType("decimal(19, 2)") .HasColumnName("weight"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblTruckAssignments", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblTruckAssignments")); entity.Property(e => e.CountId) .HasMaxLength(100) .IsUnicode(false) .HasColumnName("countID"); entity.Property(e => e.Cost) .HasColumnType("decimal(19, 2)") .HasColumnName("cost"); entity.Property(e => e.DateAssigned).HasColumnName("dateAssigned"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.OrderId) .HasMaxLength(50) .HasColumnName("orderID"); entity.Property(e => e.Status) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("status"); entity.Property(e => e.TruckId) .HasMaxLength(50) .HasColumnName("truckID"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblTruck_DriverMapping", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblTruck_DriverMapping")); entity.Property(e => e.CountId) .HasMaxLength(60) .HasColumnName("countID"); entity.Property(e => e.DateEntry).HasColumnName("dateEntry"); entity.Property(e => e.DriverId) .HasMaxLength(50) .HasColumnName("driverID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Operation) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("operation"); entity.Property(e => e.TruckId) .HasMaxLength(50) .HasColumnName("truckID"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.CountId); entity.ToTable("tblTruckInventory", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblTruckInventory")); entity.Property(e => e.CountId) .HasMaxLength(50) .HasColumnName("countID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Pcode) .HasMaxLength(50) .HasColumnName("pcode"); entity.Property(e => e.Quantity).HasColumnName("quantity"); entity.Property(e => e.TruckId) .HasMaxLength(50) .HasColumnName("truckID"); entity.Property(e => e.Unit) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("unit"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Username); entity.ToTable("tblUsers", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblUsers")); entity.Property(e => e.Username) .HasMaxLength(50) .HasColumnName("username"); entity.Property(e => e.AccessLevel) .HasMaxLength(10) .IsUnicode(false) .HasColumnName("access_level"); entity.Property(e => e.BranchId) .HasMaxLength(50) .HasColumnName("branchID"); entity.Property(e => e.City) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("city"); entity.Property(e => e.Email) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("email"); entity.Property(e => e.Firstname) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("firstname"); entity.Property(e => e.LastLogin).HasColumnName("last_login"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Password) .IsUnicode(false) .HasColumnName("password"); entity.Property(e => e.StateOrProvince) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("state_or_province"); entity.Property(e => e.StreetAddress1) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("street_address1"); entity.Property(e => e.StreetAddress2) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("street_address2"); entity.Property(e => e.Surname) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("surname"); entity.Property(e => e.Telephone) .HasMaxLength(15) .IsUnicode(false) .HasColumnName("telephone"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.Username); entity.ToTable("tblUser_activity", tb => tb.HasTrigger("trg_UpdateLastModifiedOntblUser_activity")); entity.Property(e => e.Username) .HasMaxLength(50) .HasColumnName("username"); entity.Property(e => e.LastActive).HasColumnName("last_active"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Workstation) .HasMaxLength(100) .HasColumnName("workstation"); }); modelBuilder.Entity(entity => { entity.HasKey(e => e.UnitCode); entity.ToTable("UnitOfMeasure", tb => tb.HasTrigger("trg_UpdateLastModifiedOnUnitOfMeasure")); entity.Property(e => e.UnitCode) .HasMaxLength(120) .HasColumnName("unitCode"); entity.Property(e => e.BranchId) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("branchID"); entity.Property(e => e.LastModified) .HasDefaultValueSql("(getdate())") .HasColumnName("lastmodified"); entity.Property(e => e.Status) .HasMaxLength(50) .IsUnicode(false) .HasColumnName("status"); entity.Property(e => e.Unitname) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("unitname"); entity.Property(e => e.Unitshort) .HasMaxLength(120) .IsUnicode(false) .HasColumnName("unitshort"); }); OnModelCreatingPartial(modelBuilder); } partial void OnModelCreatingPartial(ModelBuilder modelBuilder); }