This commit is contained in:
Vitaliy
2017-01-10 21:06:47 +03:00
parent 6ead62af6e
commit 2bbf0580f7
44 changed files with 565 additions and 893 deletions

View File

@@ -0,0 +1,25 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.Articles
{
[Table("ApjNews")]
public class News
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public int OrderIndex { get; set; }
public int CharCount { get; set; }
public DateTime Date { get; set; }
public string State { get; set; }
public int CategoryId { get; set; }
[ForeignKey(nameof(CategoryId))]
public virtual NewsCategory NewsCategory { get; set; }
public string FilterString { get { return string.Join(",", Title, Content, OrderIndex, CharCount, Date, State, NewsCategory.CategoryDescription); } }
}
}

View File

@@ -0,0 +1,15 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.Articles
{
[Table("ApjNewsCategory")]
public class NewsCategory
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string CategoryName { get; set; }
public string CategoryDescription { get; set; }
}
}

View File

@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
namespace AppleJobs.Data.Models.Common
{
public class Customer
{
@@ -10,5 +10,6 @@ namespace AppleJobs.Data.Models.ModelsJobs
public string Name { get; set; }
public string Code { get; set; }
public string MainEmail { get; set; }
}
}

View File

@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
namespace AppleJobs.Data.Models.Inventory
{
public class Accessories
{

View File

@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
namespace AppleJobs.Data.Models.Inventory
{
public class Employee
{

View File

@@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
{
[TsModel]
public class Model
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
{
[TsModel]
public class ModelCategory
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
{
[TsModel]
public class ModelJob
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]

View File

@@ -1,8 +1,10 @@
using System.ComponentModel.DataAnnotations;
using AppleJobs.Data.Models.Common;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models.ModelsJobs
{
[TsModel]
public class ModelJobPriceTemplate
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]

View File

@@ -1,9 +1,11 @@
using AppleJobs.Data.Models.ModelsJobs;
using AppleJobs.Data.Models.Common;
using AppleJobs.Data.Models.Inventory;
using AppleJobs.Data.Models.ModelsJobs;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
namespace AppleJobs.Data.Models.Orders
{
[TsModel]
public class OrderView
@@ -60,12 +62,14 @@ namespace AppleJobs.Data.Models
public bool? IsDrive { get; set; }
public int? Price { get; set; }
#region ForeignKeys
public int OrderStatuses_Id { get; set; }
public int Models_Id { get; set; }
public int? ModelJobs_Id { get; set; }
public int Customers_Id { get; set; }
public int? Accessories_Id { get; set; }
public int? Employees_Id { get; set; }
#endregion
[ForeignKey(nameof(OrderStatuses_Id))]
@@ -90,14 +94,8 @@ namespace AppleJobs.Data.Models
{
get
{
return string.Format("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10}",
Contact, Comment, DateCreated, DateClosed, DateUpdated,
OrderStatus?.Name,
Model.FilterString,
JobModel.FilterString,
Customer?.Name,
Accessories?.Name,
Employee?.Name);
return string.Join(",", Contact, Comment, DateCreated, DateClosed, DateUpdated,
OrderStatus?.Name, Model.FilterString, JobModel.FilterString, Customer?.Name, Accessories?.Name, Employee?.Name, Price);
}
}
}

View File

@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
namespace AppleJobs.Data.Models.Orders
{
[TsModel]
public class OrderCategory

View File

@@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace AppleJobs.Data.Models
namespace AppleJobs.Data.Models.Orders
{
[TsModel]
[Table("OrderStatuses")]