157 lines
4.6 KiB
C#
157 lines
4.6 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace SolarPower.Models.User
|
||
{
|
||
public enum UserStatusEnum : byte
|
||
{
|
||
Suspend = 0, //停權
|
||
Normal = 1, //正常
|
||
}
|
||
|
||
//Base Class。如由其餘需求,使用繼承
|
||
public class User : Created
|
||
{
|
||
public int Id { get; set; } //編號
|
||
public byte Deleted { get; set; } //是否刪除
|
||
public byte Status { get; set; } //狀態
|
||
public string StatusText //狀態文字
|
||
{
|
||
get
|
||
{
|
||
Dictionary<int, string> pairs = new Dictionary<int, string>()
|
||
{
|
||
{ 0, "停權"},
|
||
{ 1, "正常"},
|
||
};
|
||
|
||
return pairs[Status];
|
||
}
|
||
}
|
||
public string Name { get; set; } //姓名
|
||
public int CompanyId { get; set; } //公司編號
|
||
public string Account { get; set; } //帳號
|
||
public string Password { get; set; } //密碼
|
||
public string Email { get; set; } //信箱
|
||
public string Phone { get; set; } //手機
|
||
public int RoleId { get; set; } //角色編號
|
||
public string Tel { get; set; } //市話
|
||
}
|
||
|
||
/// <summary>
|
||
/// 使用者DataTable
|
||
/// </summary>
|
||
public class UserDateTable : User
|
||
{
|
||
public string CompanyName { get; set; }
|
||
public string RoleName { get; set; }
|
||
public int SPStationAmount { get; set; } //太陽能電站數量
|
||
}
|
||
|
||
/// <summary>
|
||
/// 簡化個人資料
|
||
/// </summary>
|
||
public class SimpleUser
|
||
{
|
||
public int Id { get; set; } //編號
|
||
public string Name { get; set; } //姓名
|
||
public string Account { get; set; } //帳號
|
||
public byte Status { get; set; } //狀態
|
||
public int CompanyId { get; set; } //公司編號
|
||
public string CompanyName { get; set; } //公司名稱
|
||
public string Email { get; set; } //信箱
|
||
public string Phone { get; set; } //手機
|
||
public int RoleId { get; set; } //角色編號
|
||
}
|
||
|
||
/// <summary>
|
||
/// 接收POST - 修改個人資料
|
||
/// </summary>
|
||
public class PostPersonalInfo
|
||
{
|
||
public string Name { get; set; } //姓名
|
||
public string Account { get; set; } //帳號
|
||
public string Email { get; set; } //信箱
|
||
public string Phone { get; set; } //手機
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新使用者
|
||
/// </summary>
|
||
public class UpdateUser : Updated
|
||
{
|
||
public string Name { get; set; } //姓名
|
||
public byte Status { get; set; } //狀態
|
||
public string Email { get; set; } //信箱
|
||
public string Phone { get; set; } //手機
|
||
}
|
||
|
||
/// <summary>
|
||
/// 接收POST - 變更密碼的值
|
||
/// </summary>
|
||
public class PostChangePassword
|
||
{
|
||
public string OldPassword { get; set; } //舊密碼
|
||
public string NewPassword { get; set; } //新密碼
|
||
public string AgainPassword { get; set; } //確認新密碼
|
||
}
|
||
|
||
/// <summary>
|
||
/// 修改密碼
|
||
/// </summary>
|
||
public class UpdatePassword : Updated
|
||
{
|
||
public string Password { get; set; } //新密碼
|
||
}
|
||
|
||
/// <summary>
|
||
/// 使用者列表 - 搜尋條件
|
||
/// </summary>
|
||
public class PostUserFilter
|
||
{
|
||
public int SelectedCompanyId { get; set; } //選擇公司編號
|
||
public string Name { get; set; } //姓名
|
||
public int SelectedRoleId { get; set; } //選擇角色編號
|
||
}
|
||
|
||
/// <summary>
|
||
/// 接收POST - 新增/修改使用者
|
||
/// </summary>
|
||
public class PostUser
|
||
{
|
||
public int Id { get; set; } //編號
|
||
public int CompanyId { get; set; } //公司編號
|
||
public string Name { get; set; } //姓名
|
||
public string Email { get; set; } //信箱
|
||
public string Account { get; set; } //帳號
|
||
public int RoleId { get; set; } //角色編號
|
||
public string Phone { get; set; } //手機
|
||
}
|
||
|
||
public class UserSelectItemList
|
||
{
|
||
public string Text { get; set; }
|
||
public string Value { get; set; }
|
||
}
|
||
|
||
public class UserPowerStation
|
||
{
|
||
public int Id { get; set; }
|
||
public string PowerStationName { get; set; }
|
||
public string Code { get; set; }
|
||
public string EscrowName { get; set; }
|
||
public byte EmailDayReport { get; set; }
|
||
public byte EmailMonthReport { get; set; }
|
||
public byte EmailComplexReport { get; set; }
|
||
public byte EmailException { get; set; }
|
||
}
|
||
|
||
public class PostUserPowerStation
|
||
{
|
||
public int PowerStationId { get; set; }
|
||
public int UserId { get; set; }
|
||
}
|
||
}
|