コード例 #1
0
        public static string setAlquiler(Ent_Alquiler alquiler)
        {
            con = Conexion.getConnection();
            MySqlCommand cmd = new MySqlCommand();

            con.Open();

            cmd.Connection  = con;
            cmd.CommandText = "SP_SYS_SET_ALQUILER";
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@RETVAL", MySqlDbType.VarChar);
            cmd.Parameters["@RETVAL"].Direction = ParameterDirection.Output;

            cmd.Parameters.AddWithValue("@FECHA_ENT", alquiler.fecha_ent);
            cmd.Parameters["@FECHA_ENT"].Direction = ParameterDirection.Input;

            cmd.Parameters.AddWithValue("@HORA_ENT", alquiler.hora_ent);
            cmd.Parameters["@HORA_ENT"].Direction = ParameterDirection.Input;

            cmd.Parameters.AddWithValue("@FECHA_DEV", alquiler.fecha_dev);
            cmd.Parameters["@FECHA_DEV"].Direction = ParameterDirection.Input;

            cmd.Parameters.AddWithValue("@HORA_DEV", alquiler.hora_dev);
            cmd.Parameters["@HORA_DEV"].Direction = ParameterDirection.Input;

            cmd.Parameters.AddWithValue("@CLIENTE", alquiler.cliente);
            cmd.Parameters["@CLIENTE"].Direction = ParameterDirection.Input;

            cmd.Parameters.AddWithValue("@DETALLE", alquiler.detalle);
            cmd.Parameters["@DETALLE"].Direction = ParameterDirection.Input;

            cmd.ExecuteNonQuery();

            string retval = cmd.Parameters["@RETVAL"].Value.ToString();

            con.Close();

            return(retval);
        }
コード例 #2
0
        private void setAlquiler()
        {
            Ent_Alquiler ent = new Ent_Alquiler();

            ent.fecha_ent = dtFechaEnt.Value.ToString();
            ent.hora_ent  = dtHoraEnt.Value.ToString();
            ent.fecha_dev = dtFechaDev.Value.ToString();
            ent.hora_dev  = dtHoraDev.Value.ToString();
            ent.cliente   = txtCliente.Text;
            ent.detalle   = txtDetalle.Text;

            string result = BL_Programacion.setAlquiler(ent);

            if (result == "1")
            {
                MessageBox.Show("¡Alquiler programado exitosamente!", "Programar Alquiler", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("¡Ocurrió un error al programar el alquiler!\n" + result, "Programar Alquiler", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
 public static string setAlquiler(Ent_Alquiler alquiler)
 {
     return(DAO_Alquiler.setAlquiler(alquiler));
 }