ホテル管理システム
ogi
yesterday 1a1c8e71fcd14858f595029f089b2d4a00202b32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using Google.Protobuf.WellKnownTypes;
using HotelPms.Share.Util;
 
namespace HotelPms.Data.Master
{
    public class RoomViewUse
    {
        public int RoomID { get; set; } = 0;
        public int UseID { get; set; } = 0;
        public int DetailID { get; set; } = 0;
        public int UseStatus { get; set; } = 0;
        public int SubStatus { get; set; } = 0;
        public int ExtenStatus { get; set; } = 0;
        public Timestamp CinDate { get; set; } = Timestamp.FromDateTime(DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc));
        public Timestamp CoutDate { get; set; } = Timestamp.FromDateTime(DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc));
        public int Stay { get; set; } = 0;
        public int CinTime { get; set; } = 0;
        public int CoutTime { get; set; } = 0;
        public Timestamp ResvDate { get; set; } = Timestamp.FromDateTime(DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc));
        public int ResvType { get; set; } = 0;
        public string SortKey { get; set; } = string.Empty;
        public string BackColor { get; set; } = string.Empty;
        public string ForeColor { get; set; } = string.Empty;
 
        /// <summary>
        /// RoomCellに関連する利用データ
        /// </summary>
        public Dictionary<string, string> UseData = new Dictionary<string, string>();
 
        public void Read(System.Data.DataRow row)
        {
            RoomID = CConvert.ToInt(row["RoomID"]);
            UseID = CConvert.ToInt(row["UseID"]);
            DetailID = CConvert.ToInt(row["DetailID"]);
            UseStatus = CConvert.ToInt(row["UseStatus"]);
            SubStatus = CConvert.ToInt(row["SubStatus"]);
            ExtenStatus = CConvert.ToInt(row["ExtenStatus"]);
            CinDate = CConvert.ToTimestamp(row.IsNull("CinDate") ? DateTime.MinValue : (System.DateTime)row["CinDate"]);
            CoutDate = CConvert.ToTimestamp(row.IsNull("CoutDate") ? DateTime.MinValue : (System.DateTime)row["CoutDate"]);
            Stay = CConvert.ToInt(row["Stay"]);
            CinTime = CConvert.ToInt(row["CinTime"]);
            CoutTime = CConvert.ToInt(row["CoutTime"]);
            ResvDate = CConvert.ToTimestamp(row.IsNull("ResvDate") ? DateTime.MinValue : (System.DateTime)row["ResvDate"]);
            ResvType = CConvert.ToInt(row["ResvType"]);
            SortKey = CConvert.ToString(row["SortKey"]);
            BackColor = CConvert.ToString(row["BackColor"]);
            ForeColor = CConvert.ToString(row["ForeColor"]);
            AddUseData(row);
        }
 
        /// <summary>
        /// RoomCellの利用データの格納
        /// </summary>
        /// <param name="row"></param>
        public void AddUseData(System.Data.DataRow row)
        {
            foreach (System.Data.DataColumn col in row.Table.Columns)
            {
                if (col.ColumnName.StartsWith("F") && CConvert.IsNumber(col.ColumnName.Substring(1)))
                {
                    UseData.Add(col.ColumnName, CConvert.ToString(row[col.ColumnName]));
                }
            }
        }
    }
}