Intial
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class AddCustomerForm : IMapTo<Customer>
|
||||
{
|
||||
[Required, Display(Name = "Full Name", Prompt = "Full Name (ex: John Doe)...")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required, DataType(DataType.EmailAddress)]
|
||||
public string WorkEmail { get; set; }
|
||||
|
||||
[DataType(DataType.EmailAddress)]
|
||||
public string HomeEmail { get; set; }
|
||||
|
||||
[Required, DataType(DataType.PhoneNumber)]
|
||||
public string WorkPhone { get; set; }
|
||||
|
||||
[DataType(DataType.PhoneNumber)]
|
||||
public string HomePhone { get; set; }
|
||||
|
||||
[Required, DataType(DataType.MultilineText)]
|
||||
public string WorkAddress { get; set; }
|
||||
|
||||
[DataType(DataType.MultilineText)]
|
||||
public string HomeAddress { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class AddOpportunityForm : IMapTo<Opportunity>
|
||||
{
|
||||
[HiddenInput]
|
||||
public int CustomerId { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Title { get; set; }
|
||||
|
||||
[DataType(DataType.MultilineText)]
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class AddRiskForm : IMapTo<Risk>
|
||||
{
|
||||
[HiddenInput]
|
||||
public int CustomerId { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Title { get; set; }
|
||||
|
||||
[DataType(DataType.MultilineText)]
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class CustomerOpportunityViewModel : IMapFrom<Opportunity>
|
||||
{
|
||||
public string Title { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class CustomerRiskViewModel : IMapFrom<Risk>
|
||||
{
|
||||
public string Title { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class CustomerViewModel : IMapFrom<Customer>
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string WorkEmail { get; set; }
|
||||
|
||||
public string HomeEmail { get; set; }
|
||||
|
||||
public string WorkPhone { get; set; }
|
||||
|
||||
public string HomePhone { get; set; }
|
||||
|
||||
public string HomeAddress { get; set; }
|
||||
|
||||
public string WorkAddress { get; set; }
|
||||
|
||||
public DateTime? TerminationDate { get; set; }
|
||||
|
||||
public IList<CustomerOpportunityViewModel> Opportunities { get; set; }
|
||||
|
||||
public IList<CustomerRiskViewModel> Risks { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class EditCustomerForm : IMapTo<Customer>
|
||||
{
|
||||
[HiddenInput]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required, Display(Name = "Full Name", Prompt = "Full Name (ex: John Doe)...")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required, DataType(DataType.EmailAddress)]
|
||||
public string WorkEmail { get; set; }
|
||||
|
||||
[DataType(DataType.EmailAddress)]
|
||||
public string HomeEmail { get; set; }
|
||||
|
||||
[Required, DataType(DataType.PhoneNumber)]
|
||||
public string WorkPhone { get; set; }
|
||||
|
||||
[DataType(DataType.PhoneNumber)]
|
||||
public string HomePhone { get; set; }
|
||||
|
||||
[Required, DataType(DataType.MultilineText)]
|
||||
public string WorkAddress { get; set; }
|
||||
|
||||
[DataType(DataType.MultilineText)]
|
||||
public string HomeAddress { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Mvc;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class InventoryAddForm : IMapTo<Inventory>
|
||||
{
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public string InventoryTypeId { get; set; }
|
||||
|
||||
[Required]
|
||||
public DateTime ExpirationDate { get; set; }
|
||||
|
||||
[Required]
|
||||
public int Quantity { get; set; }
|
||||
|
||||
[Required, Display(Name = "Arrival Date")]
|
||||
public DateTime AddedDate { get; set; }
|
||||
|
||||
public string Memo { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class InventoryTypeViewModel : IMapFrom<InventoryType>
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public int UnitsPerCase { get; set; }
|
||||
|
||||
public string ContainerType { get; set; }
|
||||
|
||||
public double WeightPerCase { get; set; }
|
||||
|
||||
public decimal PricePerCase { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class InventoryViewModel : IMapFrom<Inventory>, IHaveCustomMappings
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public int UnitsPerCase { get; set; }
|
||||
|
||||
public string ContainerType { get; set; }
|
||||
|
||||
public double WeightPerCase { get; set; }
|
||||
|
||||
public decimal PricePerCase { get; set; }
|
||||
|
||||
public int Quantity { get; set; }
|
||||
|
||||
public DateTime ExpirationDate { get; set; }
|
||||
|
||||
public void CreateMappings(IMapperConfiguration configuration)
|
||||
{
|
||||
configuration.CreateMap<Inventory, InventoryViewModel>()
|
||||
.ForMember(d => d.Name, opt => opt.MapFrom(s => s.InventoryType.Name))
|
||||
.ForMember(d => d.UnitsPerCase, opt => opt.MapFrom(s => s.InventoryType.UnitsPerCase))
|
||||
.ForMember(d => d.ContainerType, opt => opt.MapFrom(s => s.InventoryType.ContainerType))
|
||||
.ForMember(d => d.WeightPerCase, opt => opt.MapFrom(s => s.InventoryType.WeightPerCase))
|
||||
.ForMember(d => d.PricePerCase, opt => opt.MapFrom(s => s.InventoryType.PricePerCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class LoginForm
|
||||
{
|
||||
public string EmailAddress { get; set; }
|
||||
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class LostCustomerReportViewModel : IMapFrom<Customer>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string WorkEmail { get; set; }
|
||||
|
||||
public DateTime? TerminationDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using Heroic.AutoMapper;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class NewCustomerReportViewModel : IMapFrom<Core.Customer>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
||||
public string WorkEmail { get; set; }
|
||||
|
||||
public DateTime CreateDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class OpportunityViewModel : IMapFrom<Opportunity>
|
||||
{
|
||||
public string Title { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public DateTime CreateDate { get; set; }
|
||||
|
||||
public int CustomerId { get; set; }
|
||||
|
||||
public string CustomerName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using AutoMapper;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class ProfileForm : IMapFrom<User>, IHaveCustomMappings
|
||||
{
|
||||
[Required, Display(Name = "Full Name", Prompt = "Full Name (ex: John Doe)...")]
|
||||
public string FullName { get; set; }
|
||||
|
||||
[Required, DataType(DataType.EmailAddress), Display(Prompt = "your@email.com...")]
|
||||
public string EmailAddress { get; set; }
|
||||
|
||||
public void CreateMappings(IMapperConfiguration configuration)
|
||||
{
|
||||
configuration.CreateMap<User, ProfileForm>()
|
||||
.ForMember(d => d.FullName, opt => opt.MapFrom(s => s.UserName))
|
||||
.ForMember(d => d.EmailAddress, opt => opt.MapFrom(s => s.Email));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using Heroic.AutoMapper;
|
||||
using InventoryTraker.Web.Core;
|
||||
|
||||
namespace InventoryTraker.Web.Models
|
||||
{
|
||||
public class RiskViewModel : IMapFrom<Risk>
|
||||
{
|
||||
public int CustomerId { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public DateTime CreateDate { get; set; }
|
||||
|
||||
public string CustomerName { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user