Esempio n. 1
0
        public static void UpdatePeriodicBarra(PeriodicBarra periodicBarra)
        {
            string query = string.Format("UPDATE {0} SET " +
                                         "demanda = @Demanda, " +
                                         "maximoAngulo = @MaximoAngulo " +
                                         "costoracionamiento = @Costoracionamiento " +
                                         "WHERE nombre = @Name AND " +
                                         "periodo = @Period", table);

            using (OleDbCommand command = new OleDbCommand(query, DataBaseManager.DbConnection))
            {
                command.Parameters.Add("@Demanda", OleDbType.Numeric);
                command.Parameters.Add("@MaximoAngulo", OleDbType.Numeric);
                command.Parameters.Add("@Costoracionamiento", OleDbType.Numeric);
                command.Parameters.Add("@Name", OleDbType.VarChar);
                command.Parameters.Add("@Period", OleDbType.Numeric);

                DataBaseManager.DbConnection.Open();

                command.Parameters["@Demanda"].Value            = periodicBarra.Demanda;
                command.Parameters["@MaximoAngulo"].Value       = periodicBarra.MaximoAngulo;
                command.Parameters["@Costoracionamiento"].Value = periodicBarra.Costoracionamiento;
                command.Parameters["@Name"].Value   = periodicBarra.Name;
                command.Parameters["@Period"].Value = periodicBarra.Periodo;

                int rowsAffected = command.ExecuteNonQuery();

                DataBaseManager.DbConnection.Close();
            }
        }
Esempio n. 2
0
        public static void DeletePeriodicBarra(PeriodicBarra periodicBarra)
        {
            string query = string.Format("DELETE FROM {0} " +
                                         "WHERE nombre = {1} " +
                                         "AND Periodo = {2}",
                                         table, periodicBarra.Name, periodicBarra.Periodo);

            DataBaseManager.ExecuteQuery(query);
        }
Esempio n. 3
0
 public PeriodicBarraViewModel(PeriodicBarra periodicBarra) : base()
 {
     this.periodicBarra = periodicBarra;
 }