private void btSelect_Click(object sender, EventArgs e)
        {
            try
            {
                bool isChecked = false;
                foreach (Control ctl in groupBox1.Controls)
                {
                    if (ctl is RadioButton)
                    {
                        var aRadioButton = (RadioButton) ctl;
                        if (aRadioButton.Checked)
                        {
                            isChecked = true;
                        }
                    }
                }

                if (!isChecked)
                {
                    MessageBox.Show("Please select an option!");
                    return;
                }

                var form2 = new FrmFindPatient();
                foreach (Control ctl in groupBox1.Controls)
                {
                    if (ctl is RadioButton)
                    {
                        var aRadioButton = (RadioButton) ctl;
                        if (aRadioButton.Checked)
                        {
                            switch (aRadioButton.Name)
                            {
                                case "rbUpdate":
                                    StaticVar = this;
                                    this.Visible = false;
                                    Hide();
                                    form2.Show();
                                    break;
                                case "rbDelete":
                                    StaticVar = this;
                                    this.Visible = false;
                                    Hide();
                                    form2.Delete = true;
                                    form2.Show();
                                    break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {

                //var logger = new ExceptionLogger();
                //logger.AddLogger(new EventLogLogger());
                //logger.LogException(ex, "Menu selection failed!");
                //throw new Exception(ex.Message, ex);
            }
        }
Esempio n. 2
0
        private void dgResults_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {

                if (dgResults.RowCount == 0)
                {
                    MessageBox.Show("Please select a Patient!");
                    return;
                }

                if (Delete)
                {
                    DialogResult dlgRes = MessageBox.Show(
                        "Are you sure you want to delete the Replenishment Schedule for: " +
                        dgResults.SelectedRows[0].Cells[1].Value + "?",
                        "Confirm Delete",
                        MessageBoxButtons.YesNo,
                        MessageBoxIcon.Question);
                    if (dlgRes == DialogResult.Yes)
                    {
                        DeleteReplenishmentSchedule(Int32.Parse(dgResults.SelectedRows[0].Cells[0].Value.ToString()));
                        MessageBox.Show("Succesfully Deleted Replenishment Schedule!");
                        StaticVar = this;
                        Hide();
                        var form3 = new FrmReplacementMenu();
                        form3.Show();
                        return;
                    }
                    else
                    {
                        StaticVar = this;
                        Hide();
                        var form3 = new FrmReplacementMenu();
                        form3.Show();
                        return;
                    }
                }

                if (SetCorrectRxId(int.Parse(dgResults.SelectedRows[0].Cells[0].Value.ToString())) == "0")
                {
                    MessageBox.Show(
                        "Please add a Soft Contact Lens Order for: " + dgResults.SelectedRows[0].Cells[1].Value + "!",
                        "Add a Soft Contact Lens Order");
                    return;
                }

                StaticVar = this;
                Hide();

                var form2 = new FrmReplenishmentSchedule
                {
                    PatientId = Int32.Parse(dgResults.SelectedRows[0].Cells[0].Value.ToString())
                };
                form2.Show();
                this.Visible = false;
                this.IsExit = false;
                this.Close();
            }
            catch (Exception ex)
            {
                //var logger = new ExceptionLogger();
                //logger.AddLogger(new EventLogLogger());
                //logger.LogException(ex, "Error selecting patient!");
                //throw new Exception(ex.Message, ex);
            }
        }
 private void GoToFindPatient()
 {
     StaticVar = this;
     Hide();
     this.Visible = false;
     this.IsExit = false;
     this.Close();
     Application.DoEvents();
     System.Threading.Thread.Sleep(400);
     var form2 = new FrmFindPatient();
     form2.Show();
 }
Esempio n. 4
0
 private void btBack_Click(object sender, EventArgs e)
 {
     StaticVar = this;
         Hide();
         this.Visible = false;
         this.IsExit = false;
         this.Close();
         var form2 = new FrmReplacementMenu();
         form2.Show();
 }