private void button2_Click(object sender, EventArgs e)
        {
            DocAppointment hello = new DocAppointment(un);

            hello.Show();
            this.Hide();
        }
Пример #2
0
        //  Bitmap bitmap;
        private void button2_Click(object sender, EventArgs e)
        {
            connection sv = new connection();

            sv.thisConnection.Open();

            string yes = "Yes";

            OracleCommand thisCommand = sv.thisConnection.CreateCommand();

            thisCommand.CommandText =
                "update doctor_appointment set visit_status = '" + yes + "' where token_id= '" + textBox1.Text + "'";

            thisCommand.Connection  = sv.thisConnection;
            thisCommand.CommandType = CommandType.Text;
            //For Insert Data Into Oracle//
            if (String.IsNullOrEmpty(textBox3.Text))
            {
                MessageBox.Show("Please write something to advice!!!!");
            }
            else if (!String.IsNullOrEmpty(textBox3.Text))
            {
                try
                {
                    thisCommand.ExecuteNonQuery();

                    PrintDocument doc = new PrintDocument();
                    doc.DefaultPageSettings.Landscape = true;
                    doc.PrintPage += this.printDocument1_PrintPage;
                    PrintDialog dlgSettings = new PrintDialog();
                    dlgSettings.Document = doc;
                    if (dlgSettings.ShowDialog() == DialogResult.OK)
                    {
                        doc.Print();
                    }


                    //   MessageBox.Show("submitted");
                    this.Hide();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }


                sv.thisConnection.Close();



                DocAppointment ob = new DocAppointment();
                ob.Show();
            }
        }