Example #1
0
        private void EC_BntClickDelete_Click(object sender, EventArgs e)
        {
            EC_Class ECBaseDato = new EC_Class();
            string   Query      = "delete from ECtbl_veterinaria where id=" + EC_comboxID.Text;

            ECBaseDato.EjecutaSQLComando(Query);
            MessageBox.Show("Fue Eliminado con exito");
        }
Example #2
0
        private void EC_bntAgregar_Click(object sender, EventArgs e)
        {
            EC_Class ECBaseDatos = new EC_Class();
            string   Query       = " insert into ECtbl_veterinaria (Tipo, NombreMascota, Nombre, Apellido, Rut, Ingreso, Peso,Tamano)" +
                                   " values" +
                                   "('" + CmboxTipo_EC.Text + "', '" + txtECnombremascota.Text + "', '" + txtECnombredueño.Text + "', '" +
                                   txtECapellidos.Text + "', '" + txtECrut.Text + "', '" + Convert.ToDateTime(txtECfechaIngreso.Text).ToString("dd-MM-yyyy") + "','" +
                                   txtECpeso.Text + "','" + txtECTamaño.Text + "')";

            ECBaseDatos.EjecutaSQLComando(Query);
            MessageBox.Show(" Datos Agregados!");
        }
Example #3
0
        private void ECLlenarComboidReview()
        {
            EC_Class EcCOMBO = new EC_Class();
            string   Query   = "select Id from ECtbl_veterinaria";

            DataSet   ECset   = EcCOMBO.LLenaComboGrid(Query);
            DataTable ECtable = ECset.Tables[0];

            foreach (DataRow row in ECtable.Rows)
            {
                ECcmbID.Items.Add(row[0].ToString());
            }
        }
Example #4
0
        private void EliminarComboid()
        {
            EC_Class ECbase = new EC_Class();
            string   Query  = "select id from ECtbl_veterinaria";

            DataSet   ECdateset = ECbase.LLenaComboGrid(Query);
            DataTable ECtable   = ECdateset.Tables[0];

            foreach (DataRow row in ECtable.Rows)
            {
                EC_comboxID.Items.Add(row[0].ToString());
            }
        }
Example #5
0
        private void ECcmbID_SelectedIndexChanged(object sender, EventArgs e)
        {
            EC_Class  DatebaseEC  = new EC_Class();
            string    Query2      = "select * from ECtbl_veterinaria  where id = " + ECcmbID.Text;
            DataSet   ECdataset   = DatebaseEC.LLenaComboGrid(Query2);
            DataTable ECdatatable = ECdataset.Tables[0];

            for (int f = 1; f < ECdataset.Tables.Count; f++)
            {
                ECdatatable = ECdataset.Tables[f];
            }
            dataGridView1.AutoGenerateColumns = true;
            dataGridView1.DataSource          = ECdatatable;
        }
Example #6
0
        private void EC_btn_Click(object sender, EventArgs e)
        {
            EC_Class DatebaseEC = new EC_Class();
            string   Query      = " Select *from ECtbl_veterinaria";

            DataSet   ECdataset   = DatebaseEC.LLenaComboGrid(Query);
            DataTable ECdatatable = ECdataset.Tables[0];

            for (int f = 1; f < ECdataset.Tables.Count; f++)
            {
                ECdatatable = ECdataset.Tables[f];
            }
            dataGridView1.AutoGenerateColumns = true;
            dataGridView1.DataSource          = ECdatatable;
        }
Example #7
0
        private void EC_bntOkUpdate_Click(object sender, EventArgs e)
        {
            EC_Class ECBaseDato = new EC_Class();

            DateTime ECIngreso = Convert.ToDateTime(EC_txtingreso.Text);
            DateTime ECSalida  = Convert.ToDateTime(EC_txtSalida.Text);

            System.TimeSpan ECEstadia = ECSalida.Subtract(ECIngreso);


            string Query = "update ECtbl_veterinaria set Tipo='" + comboxTipo_EC.Text + "', NombreMascota ='" + EC_txtNombremascota.Text + "', Nombre='" +
                           EC_txtNombreDueño.Text + "', Apellido='" + EC_txtApellido.Text + "', Rut='" + EC_txtRut.Text + "', Ingreso='" +
                           ECIngreso + "', Salida='" + ECSalida + "', Estadia='" + ECEstadia.ToString() + "', Peso='" + EC_txtPeso.Text + "', Tamano='" + EC_txtTamaño.Text +
                           "' where Id='" + comboxID_EC.Text + "'";

            ECBaseDato.EjecutaSQLComando(Query);

            MessageBox.Show("Datos Actualziados!");
        }
Example #8
0
        private void EC_btn_Click(object sender, EventArgs e)
        {
            string ECusario     = ECtxt1.Text;
            string ECcontraseña = ECtxt2.Text;

            EC_Class BaseDatos = new EC_Class();
            string   query     = "select * from Usuario where Usuario = '" + ECusario + "' and Clave = '" + ECcontraseña + "'";
            string   respuesta = BaseDatos.EjecutaSQLScalar(query);


            if (respuesta != "")
            {
                MessageBox.Show("Bienvenido a Veterinaria DoctorDog");

                ECFormMenu FM1 = new ECFormMenu();
                FM1.Show();
            }
            else
            {
                MessageBox.Show("Usuario NO valido");
            }
        }
Example #9
0
        private void ECmontarDATOS(string id)
        {
            EC_Class datebaseEC = new EC_Class();
            string   Query      = "select* from ECtbl_veterinaria where id=" + comboxID_EC.Text;

            DataSet   DataSetEC   = datebaseEC.LLenaComboGrid(Query);
            DataTable datatableEC = DataSetEC.Tables[0];

            foreach (DataRow row in datatableEC.Rows)
            {
                comboxTipo_EC.Text       = row[1].ToString();
                EC_txtNombremascota.Text = row[2].ToString();
                EC_txtNombreDueño.Text   = row[3].ToString();
                EC_txtApellido.Text      = row[4].ToString();
                EC_txtRut.Text           = row[5].ToString();
                EC_txtingreso.Text       = row[6].ToString();
                EC_txtSalida.Text        = row[7].ToString();
                EC_txtEstadia.Text       = row[8].ToString();
                EC_txtPeso.Text          = row[9].ToString();
                EC_txtTamaño.Text        = row[10].ToString();
            }
        }