100 lines
2.7 KiB
C#
100 lines
2.7 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Reflection.Emit;
|
|
using System.Runtime.Serialization;
|
|
using System.Web.Http;
|
|
using System.Collections;
|
|
|
|
namespace Model
|
|
{
|
|
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
|
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
|
[MetadataType(typeof(bed_orderMetadata))]
|
|
public partial class bed_order
|
|
{
|
|
private class bed_orderMetadata
|
|
{
|
|
[JsonIgnore]
|
|
public virtual ICollection<bed_order_detail> bed_order_detail { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public virtual pro_order pro_order { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public virtual pro_order_detail pro_order_detail { get; set; }
|
|
|
|
}
|
|
public const int KindLevelMax = 2; //分類頁面層數
|
|
|
|
#region 單據狀態
|
|
public struct keyin
|
|
{
|
|
public string Text;
|
|
public string Value;
|
|
public string Color;
|
|
}
|
|
public ArrayList keyin1_list()
|
|
{
|
|
ArrayList options = new ArrayList();
|
|
keyin keyin;
|
|
keyin.Value = "A1"; keyin.Text = "未入住"; keyin.Color = "#990000"; options.Add(keyin);
|
|
keyin.Value = "A2"; keyin.Text = "已入住"; keyin.Color = "green"; options.Add(keyin);
|
|
|
|
return options;
|
|
}
|
|
|
|
|
|
public static string keyin1_value_to_text(string v)
|
|
{
|
|
string tmp = "";
|
|
ArrayList keyin1 = new pro_order().keyin1_list();
|
|
foreach (keyin k in keyin1)
|
|
{
|
|
if (k.Value == v)
|
|
{
|
|
tmp = k.Text;
|
|
break;
|
|
}
|
|
}
|
|
return tmp;
|
|
}
|
|
#endregion
|
|
|
|
}
|
|
|
|
[MetadataType(typeof(bed_kindMetadata))]
|
|
public partial class bed_kind
|
|
{
|
|
private class bed_kindMetadata
|
|
{
|
|
[JsonIgnore]
|
|
public virtual ICollection<bed_kind_detail> bed_kind_detail { get; set; }
|
|
[JsonIgnore]
|
|
public virtual ICollection<bed_order_detail> bed_order_detail { get; set; }
|
|
[JsonIgnore]
|
|
public virtual ICollection<bed_order_detail> bed_order_detail1 { get; set; }
|
|
}
|
|
|
|
|
|
public enum bed_type : int
|
|
{
|
|
[Description("單人床")]
|
|
Single = 1,
|
|
[Description("上舖")]
|
|
Double = 2,
|
|
[Description("下舖")]
|
|
Bunk= 3,
|
|
[Description("通舖")]
|
|
Wide = 4
|
|
}
|
|
|
|
}
|
|
}
|
|
|