ホテル管理システム
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
using HotelPms.Share.Util;
using HotelPms.Share.Windows.Component;
using HotelPms.Share.Windows.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace HotelPms.Share.Windows.Tool
{
    public partial class CalendarSelector : FormBase
    {
        public DateTime SelDate { get; set; } = DateTime.Now;
        public Control OwnerControl { get; set; } = null;
 
        public CalendarSelector(Control obj)
        {
            InitializeComponent();
            OwnerControl = obj;
        }
 
        private void Calendar1_DateSelect(object sender, CalendarEventArgs e)
        {
            SelDate = calendar1.Value;
            OwnerControl.Text = calendar1.Text;
            this.DialogResult = DialogResult.OK;
        }
 
        private void CalendarSelector_Load(object sender, EventArgs e)
        {
            calendar1.Value = CConvert.ToDateTime(OwnerControl.Text);
            //Point location = this.Location;
            //GeneralSub.GetLocationToScreen(OwnerControl, ref location);
            //this.Location = location;
        }
 
        public static DialogResult Execute(Control obj)
        {
            using (CalendarSelector form = new CalendarSelector(obj))
            {
                return form.ShowDialog();
            }
        }
 
        private void Calendar1_DayCellFormat(object sender, CalendarEventArgs e)
        {
            if (e.DateValue.ToString("MMdd") == "0101") { e.Holiday = "元旦"; }
        }
    }
}