Пример #1
0
        private void AlertUserToNextAppointment(Appointment appointment)
        {
            string[] message =
            {
                "Your next appointment is at " + appointment.StartDate.ToString("h:mm tt") + ". Do you want to view the details? ",
                "Su proxima cita es a las " + appointment.StartDate.ToString("h:mm tt") + ". ¿Quieres ver las detalles?"
            };
            string[] title =
            {
                "Warning",
                "Aviso"
            };
            if (MessageBox.Show(message[Global.Language], title[Global.Language], MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
            {
                Report.UserActivity(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffff").PadRight(30) + "USR".PadRight(5) + Convert.ToString(Users.CurrentUser.ID).PadRight(5) + "ACK".PadRight(5) + "APP".PadRight(5) + Convert.ToString(appointment.ID).PadRight(5));

                AppointmentInspector appointmentInspector = new AppointmentInspector(appointment.ID);
                appointmentInspector.FormClosed += new FormClosedEventHandler(Inspector_Closed);
                appointmentInspector.Show();
                ToggleDashboard();
            }
            else
            {
                ToggleDashboard();
            }
        }
Пример #2
0
        private void OpenInspector()
        {
            int id;

            switch (DashboardTabControl.SelectedIndex)
            {
            case 0:
                id = Convert.ToInt32(AppointmentsDataGridView.CurrentRow.Cells[0].Value);

                Report.UserActivity(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffff").PadRight(30) + "USR".PadRight(5) + Convert.ToString(Users.CurrentUser.ID).PadRight(5) + "INS".PadRight(5) + "APP".PadRight(5) + Convert.ToString(id).PadRight(5));

                AppointmentInspector appointmentInspector = new AppointmentInspector(id);
                appointmentInspector.FormClosed += new FormClosedEventHandler(Inspector_Closed);
                appointmentInspector.Show();
                break;

            case 1:
                id = Convert.ToInt32(CustomersDataGridView.CurrentRow.Cells[0].Value);

                Report.UserActivity(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffff").PadRight(30) + "USR".PadRight(5) + Convert.ToString(Users.CurrentUser.ID).PadRight(5) + "INS".PadRight(5) + "CUS".PadRight(5) + Convert.ToString(id).PadRight(5));

                CustomerInspector customerInspector = new CustomerInspector(id);
                customerInspector.FormClosed += new FormClosedEventHandler(Inspector_Closed);
                customerInspector.Show();
                break;

            default:
                ResponseLabel.Text = _responsesArray[Convert.ToInt32(Responses.TAB_ERROR), Global.Language];
                break;
            }
        }
Пример #3
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            ToggleDashboard();
            switch (DashboardTabControl.SelectedIndex)
            {
            case 0:
                Report.UserActivity(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffff").PadRight(30) + "USR".PadRight(5) + Convert.ToString(Users.CurrentUser.ID).PadRight(5) + "NEW".PadRight(5) + "APP".PadRight(5));

                AppointmentInspector appointmentInspector = new AppointmentInspector();
                appointmentInspector.FormClosed += new FormClosedEventHandler(Inspector_Closed);
                appointmentInspector.Show();
                break;

            case 1:
                Report.UserActivity(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.ffff").PadRight(30) + "USR".PadRight(5) + Convert.ToString(Users.CurrentUser.ID).PadRight(5) + "NEW".PadRight(5) + "CUS".PadRight(5));

                CustomerInspector customerInspector = new CustomerInspector();
                customerInspector.FormClosed += new FormClosedEventHandler(Inspector_Closed);
                customerInspector.Show();
                break;

            default:
                ResponseLabel.Text = _responsesArray[Convert.ToInt32(Responses.TAB_ERROR), Global.Language];
                break;
            }
        }
Пример #4
0
        private void DayDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            bool isOpen = false;

            //int id;
            foreach (Form form in Application.OpenForms)
            {
                if (form.Text == "Appointment Inspector")
                {
                    isOpen = true;
                }
            }
            if (!isOpen)
            {
                ToggleCalendarInspector();
                //id = Convert.ToInt32(DayDataGridView.CurrentRow.Cells[0].Value);
                AppointmentInspector appointmentInspector = new AppointmentInspector(Convert.ToInt32(DayDataGridView.CurrentRow.Cells[0].Value));
                appointmentInspector.FormClosed += new FormClosedEventHandler(Inspector_Closed);
                appointmentInspector.Show();
            }
        }