Esempio n. 1
0
        private void ViewButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) != 0) tempCurrentDate = new DateTime(tempCurrentDate.Year, tempCurrentDate.Month, tempCurrentDate.Day, 8, 0, 0);
                else if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) == 0) tempCurrentDate = DateTime.Now;

                COrderManager tempOrderManager = new COrderManager();
                CResult tempResult = tempOrderManager.GetBookingInfoAll(tempCurrentDate);

                if (tempResult.IsSuccess)
                {
                    List<CBooking> tempBookingList = (List<CBooking>)tempResult.Data;
                    viewBookingDataGridView.Rows.Clear();

                    if (tempBookingList != null)
                    {
                        PopulateviewBookingDataGridView(tempBookingList);
                    }
                }
                Updated = true;
            }
            catch(Exception ex)
            {
            }
        }
Esempio n. 2
0
        private void CBookingForm_Activated(object sender, EventArgs e)
        {
            try
            {
                DateLabel.Text = tempCurrentDate.ToString("d/MM/yyyy");
                viewBookingDataGridView.RowCount = 19;

                if (Updated == true)
                {
                    if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) != 0) tempCurrentDate = new DateTime(tempCurrentDate.Year, tempCurrentDate.Month, tempCurrentDate.Day, 8, 0, 0);
                    else if (tempCurrentDate.Date.CompareTo(DateTime.Today.Date) == 0) tempCurrentDate = DateTime.Now;

                    COrderManager tempOrderManager = new COrderManager();
                    CResult tempResult = tempOrderManager.GetBookingInfoAll(tempCurrentDate);

                    if (tempResult.IsSuccess)
                    {
                        List<CBooking> tempBookingList = (List<CBooking>)tempResult.Data;
                        viewBookingDataGridView.Rows.Clear();

                        if (tempBookingList != null)
                        {
                            PopulateviewBookingDataGridView(tempBookingList);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }