using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace SolarPower.Models { /// /// 基礎BaseModel /// public class MyBaseModel { public int Id { get; set; } //編號 } public class Created { private string createdAt; public int CreatedBy { get; set; } //創建者 public string CreatedAt { get { return Convert.ToDateTime(createdAt).ToString("yyyy-MM-dd HH:mm:ss"); } set { createdAt = value; } } //創建時間 } public class Updated : MyBaseModel { private string updatedAt; public int UpdatedBy { get; set; } //修改者 public string UpdatedAt { get { return Convert.ToDateTime(updatedAt).ToString("yyyy-MM-dd HH:mm:ss"); } set { updatedAt = value; } } //修改時間 } public class UserInfo : MyBaseModel //Created,Updated MIX { private string createdAt; public int CreatedBy { get; set; } //創建者 public string CreatedAt { get { return Convert.ToDateTime(createdAt).ToString("yyyy-MM-dd HH:mm:ss"); } set { createdAt = value; } } //創建時間 private string updatedAt; public int UpdatedBy { get; set; } //修改者 public string UpdatedAt { get { return Convert.ToDateTime(updatedAt).ToString("yyyy-MM-dd HH:mm:ss"); } set { updatedAt = value; } } //修改時間 } /// /// 當前登入的使用者基本資訊 /// public class MyUser { public int Id { get; set; } //編號 public byte Status { get; set; } //狀態 public string Name { get; set; } //姓名 public int CompanyId { get; set; } //公司編號 public int RoleId { get; set; } //角色編號 public string Email { get; set; } public MyCompany Company { get; set; } //公司資訊 public MyRole Role { get; set; } //角色資訊 public List myPowerStationGroupByCities { get; set; } } /// /// 當前登入使用者的公司資訊 /// public class MyCompany { private string logo; public int Id { get; set; } public byte Status { get; set; } //狀態 public string Name { get; set; } //名稱 public string Logo { get; set; } } //當前登入使用者的角色權限 public class MyRole { public int Id { get; set; } public string Name { get; set; } //名稱 public byte Layer { get; set; } //角色層級 public List Auths { get; set; } //可操作頁面 } public class MyPowerStationInfo { public int Id { get; set; } public int CityId { get; set; } public string CityName { get; set; } public string Name { get; set; } } public class MyCity { public int CityId { get; set; } public string CityName { get; set; } public int Amount { get; set; } } public class MyPowerStationGroupByCity { public int CityId { get; set; } public string CityName { get; set; } public int Amount { get; set; } public List MyPowerStations { get; set; } } public class MyPowerStation { public int PowerStationId { get; set; } public string PowerStationName { get; set; } } public class Variable { public string Name { get; set; } public string Value { get; set; } } public class CheckBox { public int Value { get; set; } //通常放id public string Name { get; set; } } public class PowerStationsSummary { public double Today_kwh { get; set; } //今日總發電量 public double Total_kwh { get; set; } //累計總發電量 public double Today_irradiance { get; set; } //即時平均日照度 public double Avg_irradiance { get; set; } //平均日照度(30天) public double Today_PR { get; set; } //即時平均 PR 值 public double Avg_PR { get; set; } //平均 PR 值(30天) public double Today_kwhkwp { get; set; } //即時平均 kWh / kWp public double Avg_kwhkwp { get; set; } //平均 kWh / kWp (30天) public double Today_money { get; set; } //今日金額 public double Total_money { get; set; } //總金額 public double Today_carbon { get; set; } //今日減碳量 public double Total_carbon { get; set; } //累積減碳量 } }