Add project files.
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CarParkValidationAPI.Models
|
||||
{
|
||||
public enum AdminRole
|
||||
{
|
||||
Normal = 1,
|
||||
Admin = 2
|
||||
}
|
||||
public partial class AdminUserCriteria
|
||||
{
|
||||
public AdminUserCriteria()
|
||||
{
|
||||
}
|
||||
#region public Member
|
||||
|
||||
public int? UserID { get; set; }
|
||||
|
||||
public int? StafflinkNo { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string AddedBy { get; set; }
|
||||
|
||||
public DateTime? AddedOn { get; set; }
|
||||
|
||||
public bool? Active { get; set; }
|
||||
|
||||
public int? RoleType { get; set; }
|
||||
#endregion
|
||||
}
|
||||
[Table("AdminUser")]
|
||||
public partial class AdminUser
|
||||
{
|
||||
public AdminUser()
|
||||
{
|
||||
}
|
||||
#region public Member
|
||||
[Key]
|
||||
public int UserID { get; set; }
|
||||
public string StafflinkNo { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public string AddedBy { get; set; }
|
||||
|
||||
public DateTime AddedOn { get; set; }
|
||||
|
||||
public bool Active { get; set; }
|
||||
|
||||
public AdminRole RoleType { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace CarParkValidationAPI.Models
|
||||
{
|
||||
public class AppSettings
|
||||
{
|
||||
public string Secret { get; set; }
|
||||
public string SQLConnectionString { get; set; }
|
||||
public string LDAPPath { get; set; }
|
||||
public string LDAPUser { get; set; }
|
||||
public string LDAPPassword { get; set; }
|
||||
|
||||
public string LoginWebAPI { get; set; }
|
||||
/// <summary>
|
||||
/// for convert to time. use GetADTimeOut
|
||||
/// TimeSpan.FromSeconds(Convert.ToDouble(ConfigurationManager.AppSettings["ADTimeOut"]));
|
||||
public string ADTimeOut { get; set; }
|
||||
|
||||
public TimeSpan GetADTimeOut()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ADTimeOut))
|
||||
return TimeSpan.FromSeconds(Convert.ToDouble(ADTimeOut));
|
||||
else
|
||||
return TimeSpan.FromSeconds(0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CarParkValidationAPI.Models
|
||||
{
|
||||
public partial class ConcessionType
|
||||
{
|
||||
public ConcessionType()
|
||||
{
|
||||
}
|
||||
#region public Member
|
||||
[Key]
|
||||
public int ConcessionTypeID { get; set; }
|
||||
public string ConcessionDesc { get; set; }
|
||||
|
||||
public string ConcessionDisplay { get; set; }
|
||||
|
||||
public bool Active { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CarParkValidationAPI.Models
|
||||
{
|
||||
[NotMapped]
|
||||
public class ConcessionValidationExt: ConcessionValidation
|
||||
{
|
||||
#region public Member
|
||||
public string ConcessionType { get; set; }
|
||||
public string ValidationPiont { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
public partial class ConcessionValidation
|
||||
{
|
||||
public ConcessionValidation()
|
||||
{
|
||||
}
|
||||
|
||||
#region public Member
|
||||
[Key]
|
||||
public int ValidationID { get; set; }
|
||||
public DateTime ValidateDate { get; set; }
|
||||
|
||||
public string ConcessionCard { get; set; }
|
||||
|
||||
public string ConcessionHolder { get; set; }
|
||||
|
||||
public bool ConcessionExpiry { get; set; }
|
||||
|
||||
public int ConcessionTypeID { get; set; }
|
||||
|
||||
public string StafflinkNo { get; set; }
|
||||
|
||||
public int ValidationPointID { get; set; }
|
||||
|
||||
public bool Active { get; set; }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarParkValidationAPI.Models
|
||||
{
|
||||
public class ResultModel<T>
|
||||
{
|
||||
public T Data { get; set; }
|
||||
public int StatusCode { get; set; }
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace CarParkValidationAPI.Models
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Username { get; set; }
|
||||
public AdminRole Role { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string PasswordHash { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CarParkValidationAPI.Models.Users
|
||||
{
|
||||
public class AuthenticateRequest
|
||||
{
|
||||
[Required]
|
||||
public string Username { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using CarParkValidationAPI.Entities;
|
||||
|
||||
namespace CarParkValidationAPI.Models.Users
|
||||
{
|
||||
public class AuthenticateResponse
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Username { get; set; }
|
||||
public AdminRole Role { get; set; }
|
||||
public string Token { get; set; }
|
||||
|
||||
public AuthenticateResponse(User user, string token)
|
||||
{
|
||||
Id = user.Id;
|
||||
FirstName = user.FirstName;
|
||||
LastName = user.LastName;
|
||||
Username = user.Username;
|
||||
Role = user.Role;
|
||||
Token = token;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CarParkValidationAPI.Models
|
||||
{
|
||||
|
||||
|
||||
public class ValidationPoint
|
||||
{
|
||||
[Key]
|
||||
public int ValidationPointID { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
public string DisplayName { get; set; }
|
||||
|
||||
public bool Active { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user