コード例 #1
0
        private void tm_Update_Tick(object sender, EventArgs e)
        {
            DateTime     time   = DateTime.Now;
            const string format = "ddd MMM d HH:mm yyyy";

            lbl_DateTime.Text = time.ToString(format);
            int hour = time.Hour;

            if (hour >= 0 && hour < 9)
            {
                _timeRange = 0;
            }
            else if (hour >= 9 && hour < 17)
            {
                _timeRange = 1;
            }
            else if (hour >= 17 && hour < 21)
            {
                _timeRange = 2;
            }
            else if (hour >= 21 && hour < 24)
            {
                _timeRange = 3;
            }

            if (_oldTimeRange == 3 && _timeRange == 0)
            {
                Application.Restart();
            }
            _oldTimeRange = _timeRange;

            saveCount++;
            if (saveCount >= 600000)
            {
                ExcelDoc.WriteDoc();
                saveCount = 0;
            }
        }
コード例 #2
0
        private void ReceptionScreen_Load(object sender, EventArgs e)
        {
            //UI element anchoring
            Rectangle    screen = Screen.PrimaryScreen.Bounds;
            DateTime     time   = DateTime.Now;
            const string format = "ddd MMM d HH:mm yyyy";

            _waitingListShow        = true;
            _nextTicketShow         = true;
            lbl_DateTime.Text       = time.ToString(format);
            lbl_CompanyName.Left    = screen.Width / 2 - lbl_CompanyName.Width / 2 + screen.Width / 20;
            lbl_CompanyName.Top     = screen.Height / 13 - lbl_CompanyName.Height / 13;
            pic_CompanyPicture.Left = screen.Width / 20 - pic_CompanyPicture.Width / 20;
            pic_CompanyPicture.Top  = screen.Height / 20 - pic_CompanyPicture.Height / 20;
            pic_face.Left           = screen.Width - pic_face.Width - screen.Width / 60;
            pic_face.Top            = screen.Height / 20 - pic_face.Height / 30;
            lbl_TopBreakLine.Left   = 0;
            lbl_TopBreakLine.Top    = screen.Height / 20 + pic_CompanyPicture.Height;


            lbl_NextTicket.Top  = lbl_TopBreakLine.Top + screen.Height / 30;
            lbl_NextTicket.Font = new Font(lbl_NextTicket.Font.Name, int.Parse(txt_size.Text));

            txt_size.Hide();

            btn_Analysis.Left = screen.Width / 100;
            btn_Analysis.Top  = screen.Height - btn_Analysis.Height * 4 - screen.Height / 100;

            lbl_BottomBreakLine.Top = btn_Analysis.Top - lbl_BottomBreakLine.Height * 2;

            btn_Save.Left = btn_Analysis.Left + btn_Analysis.Width + screen.Width / 100;
            btn_Save.Top  = btn_Analysis.Top;
            btn_Save.Hide();

            txt_size.Top  = btn_Save.Top;
            txt_size.Left = btn_Save.Left + btn_Save.Width + screen.Width / 100;

            lbl_LabelPrintedNum.Top = lbl_BottomBreakLine.Top - lbl_LabelPrintedNum.Height - screen.Height / 50;

            lbl_LabelNextTicket.Left = 0;
            lbl_LabelNextTicket.Top  = lbl_NextTicket.Top + lbl_NextTicket.Height * 3 / 5;

            lbl_NextTicket.Left = lbl_LabelNextTicket.Left + lbl_LabelNextTicket.Width + screen.Width / 50;

            lbl_LabelPrintTicket.Left = lbl_LabelNextTicket.Left;
            lbl_LabelPrintTicket.Top  = lbl_LabelPrintedNum.Top - lbl_LabelPrintTicket.Height - screen.Height / 50;

            btn_CreateTicket.Left = lbl_NextTicket.Left + screen.Width / 20;
            btn_CreateTicket.Top  = lbl_LabelPrintTicket.Top;

            lbl_LabelPrintedNum.Left = lbl_LabelPrintTicket.Left;
            lbl_PrintedNumber.Top    = lbl_LabelPrintedNum.Top;
            lbl_PrintedNumber.Left   = btn_CreateTicket.Left;

            People.Left = btn_CreateTicket.Left + btn_CreateTicket.Width + screen.Width / 80;
            People.Top  = btn_CreateTicket.Top;

            chk_printEnable.Left = People.Left + People.Width + screen.Width / 100;
            chk_printEnable.Top  = btn_CreateTicket.Top + screen.Height / 300;

            chk_printEnable.Hide();

            lbl_ContactInfo.Top     = btn_Analysis.Top;
            lbl_ContactInfo.Left    = screen.Width / 2 - lbl_ContactInfo.Width / 2;
            WaitingList.Height      = screen.Height * 2 / 5;
            WaitingList.Left        = screen.Width - WaitingList.Width - screen.Width / 50;
            WaitingList.Top         = lbl_TopBreakLine.Top + lbl_TopBreakLine.Height + screen.Height / 100;
            lbl_DateTime.Left       = screen.Width - lbl_DateTime.Width - screen.Width / 100;
            lbl_DateTime.Top        = btn_Analysis.Top;
            lbl_waitingTickets.Top  = WaitingList.Top + WaitingList.Height + screen.Height / 100;
            lbl_waitingTickets.Left = screen.Width - lbl_waitingTickets.Width - screen.Width / 100;

            lbl_displayTotal.Top  = lbl_waitingTickets.Top + lbl_waitingTickets.Height + screen.Height / 100;
            lbl_displayTotal.Left = screen.Width - lbl_waitingTickets.Width - screen.Width / 50;
            lbl_displayTotal.Hide();

            btn_Analysis.Visible = false;
            ExcelDoc.ReadDoc();
        }
コード例 #3
0
 private void btn_Save_Click(object sender, EventArgs e)
 {
     ExcelDoc.WriteDoc();
     lbl_NextTicket.Font = new Font(lbl_NextTicket.Font.Name, int.Parse(txt_size.Text));
 }
コード例 #4
0
 public static void OnProcessExit(object sender, EventArgs e)
 {
     ExcelDoc.WriteDoc();
 }