예제 #1
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            addprocedure    frm = new addprocedure();
            DataGridViewRow act = dataGridView1.Rows[e.RowIndex];

            frm.pidpatient_txt.Text   = act.Cells["ID"].Value.ToString();
            frm.pnamepatient_txt.Text = act.Cells["Nombre"].Value.ToString();
            this.Hide();
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(ep_ta_txt.Text) && string.IsNullOrEmpty(ep_cov_txt.Text))
                {
                    MessageBox.Show("No ha dijitado valores en los campos de tearifa y cobertura, favor revisar.", "Error");
                }
                else if (string.IsNullOrEmpty(ep_ta_txt.Text) == false && string.IsNullOrEmpty(ep_cov_txt.Text))
                {
                    string query = "Update subprocedure set tariff = '" + ep_ta_txt.Text + "', coverage = '0', difference = '" + ep_dif_txt.Text + "' where id = '" + ep_id_txt.Text + "'";
                    c.command3(query);
                    this.Close();
                }
                else if (string.IsNullOrEmpty(ep_ta_txt.Text) && string.IsNullOrEmpty(ep_cov_txt.Text) == false)
                {
                    string query = "Update subprocedure set tariff = '0', coverage = '" + ep_cov_txt.Text + "', difference = '" + ep_dif_txt.Text + "' where id = '" + ep_id_txt.Text + "'";
                    c.command3(query);
                    this.Close();
                }
                else if (string.IsNullOrEmpty(ep_ta_txt.Text) == false && string.IsNullOrEmpty(ep_cov_txt.Text) == false)
                {
                    string query = "Update subprocedure set tariff = '" + ep_ta_txt.Text + "', coverage = '" + ep_cov_txt.Text + "', difference = '" + ep_dif_txt.Text + "' where id = '" + ep_id_txt.Text + "'";
                    c.command3(query);
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ha ocurrido un error. Motivo: " + ex.Message, "Error");
            }

            finally
            {
                try
                {
                    addprocedure f = new addprocedure();
                    f.loadsubprocedure();
                    f.sums();
                }
                catch
                {
                    MessageBox.Show("No mando a cargar.");
                }
            }
        }
예제 #3
0
        private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            addprocedure    frm = new addprocedure();
            DataGridViewRow act = dataGridView1.Rows[e.RowIndex];

            frm.idprocedure_txt.Text   = act.Cells["ID"].Value.ToString();
            frm.pidpatient_txt.Text    = act.Cells["IdPaciente"].Value.ToString();
            frm.pnamepatient_txt.Text  = act.Cells["Paciente"].Value.ToString();
            frm.piddoctor_txt.Text     = act.Cells["IdDoctor"].Value.ToString();
            frm.pnamedoctor_txt.Text   = act.Cells["Doctor"].Value.ToString();
            frm.procedure_txt.Text     = act.Cells["Procedimiento"].Value.ToString();
            frm.realpay_txt.Text       = act.Cells["Precio"].Value.ToString();
            frm.iscoverage_txt.Text    = act.Cells["Cobertura"].Value.ToString();
            frm.pricepay_txt.Text      = act.Cells["Total"].Value.ToString();
            frm.tooth_txt.Text         = act.Cells["Diente"].Value.ToString();
            frm.dateprocedure_dtp.Text = act.Cells["Fecha"].Value.ToString();

            frm.groupBox3.Hide();
            frm.saveprocedure_btn.Hide();
            frm.clear_btn.Hide();
            frm.MdiParent = this.MdiParent;
            frm.Show();
        }
예제 #4
0
        private void agregarProcedimientoRegularToolStripMenuItem_Click(object sender, EventArgs e)
        {
            addprocedure f = new addprocedure();

            try
            {
                Form frm2 = Application.OpenForms.Cast <Form>().FirstOrDefault(x => x is addprocedure);
                if (frm2 != null)
                {
                    frm2.BringToFront();
                    MessageBox.Show("Esta ventana ya esta abierta.", "Error");
                    return;
                }
                else
                {
                    f.MdiParent = this;
                    f.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("No se puede abrir el ventana solicitado. Razón: " + ex.Message, "Error al abrir la ventana.", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }