Example #1
0
File: BD.cs Project: jocarrd/TOO
 //SEGURAMENTE SE PUEDA BORRAR ESTE MÉTODO, SOLO CONFUNDE
 public static bool UPDATEPresupuesto(ModeloDominio.Presupuesto p)
 {
     if (BD.DELETEPresupuesto(p))
     {
         return(BD.INSERTPresupuesto(p));
     }
     return(false);
 }
Example #2
0
File: BD.cs Project: jocarrd/TOO
 public static bool DELETEPresupuesto(ModeloDominio.Presupuesto p)
 {
     if (BD.presupuestos.Contains(p))
     {
         return(BD.presupuestos.Remove(p));
     }
     return(false);
 }
Example #3
0
        ///<summary>
        ///Actualiza el contendo de los TextBoxes con los datos del Presupuesto al que referencia
        ///</summary>
        private void actualizar()
        {
            ModeloDominio.Presupuesto p = b.Current as ModeloDominio.Presupuesto;

            this.idPresupuestotb.Text    = p.Id_presupuesto;
            this.cantidadtb.Text         = p.Cantidad.ToString();
            this.fechaRealizaciontb.Text = p.Fecha_Realizacion.ToString();
            this.estadotb.Text           = p.Estado.ToString();
            this.clientetb.Text          = p.Cliente.Dni;
        }
Example #4
0
File: BD.cs Project: jocarrd/TOO
 public static bool INSERTPresupuesto(ModeloDominio.Presupuesto p)
 {
     if (BD.presupuestos.Contains(p))
     {
         return(false);
     }
     else
     {
         BD.presupuestos.Add(p);
         return(true);
     }
 }
Example #5
0
        public RecorridoPresupuesto(List <ModeloDominio.Presupuesto> lista)
        {
            InitializeComponent();
            this.li      = lista;
            b            = new BindingSource();
            b.DataSource = lista;
            bindingNavigator1.BindingSource = b;
            ModeloDominio.Presupuesto p = b.Current as ModeloDominio.Presupuesto;

            this.idPresupuestotb.Text    = p.Id_presupuesto;
            this.cantidadtb.Text         = p.Cantidad.ToString();
            this.fechaRealizaciontb.Text = p.Fecha_Realizacion.ToString();
            this.estadotb.Text           = p.Estado.ToString();
            this.clientetb.Text          = p.Cliente.Dni;
        }
Example #6
0
File: BD.cs Project: jocarrd/TOO
        public static ModeloDominio.Presupuesto SELECTPresupuesto(ModeloDominio.Presupuesto p)
        {
            foreach (ModeloDominio.Presupuesto p1 in BD.Presupuestos)
            {
                if (p1.Id_presupuesto.Equals(p.Id_presupuesto))
                {
                    return(p1);
                }
            }
            return(null);

            /*
             * IEnumerable<ModeloDominio.Presupuesto> presupuesto = BD.presupuestos.Select(presupuestos => p);
             *
             * if (presupuesto == null)
             * {
             *  return null;
             * }
             * else
             * {
             *  return presupuesto.First();
             * }*/
        }