예제 #1
0
 public Egreso(Bomba bomba, Camion camion, Chofer chofer, Operador operador, float litros_egreso)
 {
     this.bomba = bomba;
     this.camion = camion;
     this.chofer = chofer;
     this.operador = operador;
     this.litros_egreso = litros_egreso;
 }
예제 #2
0
        private void btnCrear_Click(object sender, EventArgs e)
        {
            try
            {
                Empresa empresa = (Empresa)ddlEmpresa.SelectedItem;
                string patente = txtPatente.Text.Trim();

                Camion camion = new Camion(empresa, patente);

                if (edicion)
                    camion.Guardar();
                else
                    camion.Crear();

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #3
0
        public static Camion getFromPatente(string patente)
        {
            string sql = @"select e.empresa_nombre,c.empresa_rut,c.camion_patente from camiones c
                    inner join empresas e
                    on c.empresa_rut = e.empresa_rut
                    where c.camion_patente = @patente
                    order by e.empresa_nombre,c.camion_patente";
            Camion resultado = null;
            using (Database db = new Database(sql))
            {
                db.addParameter("@patente", SqlDbType.VarChar, patente);
                DataTable dt = db.getData();

                if (dt.Rows.Count == 1)
                {
                    DataRow dr = dt.Rows[0];
                    resultado = new Camion(new Empresa((int)dr["empresa_rut"], (string)dr["empresa_nombre"]),
                            (string)dr["camion_patente"]);
                }
            }
            return resultado;
        }
예제 #4
0
 public CamionCrear(Camion camion)
     : this(camion.Empresa, camion.Patente)
 {
 }