Ejemplo n.º 1
0
        //them object xe
        public bool insertVehicle(vehicleParkingDTO vel)
        {
            try
            {
                this.openConnection();

                SqlCommand cmd = new SqlCommand("INSERT INTO VEHICLE_PARKING (id, typePark, timeIn)" +
                                                "VALUES (@id, @type, @timeIn)", this.getConnection);
                cmd.Parameters.Add("@id", SqlDbType.NChar).Value        = vel.id;
                cmd.Parameters.Add("@type", SqlDbType.Int).Value        = vel.typeGui;
                cmd.Parameters.Add("@timeIn", SqlDbType.DateTime).Value = vel.ngayGui;
                if (cmd.ExecuteNonQuery() == 1)
                {
                    return(true);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: ", ex.Message);
            }
            finally
            {
                this.closeConnection();
            }
            return(false);
        }
Ejemplo n.º 2
0
 public bool insertVehicle(vehicleParkingDTO vel)
 {
     return(this.Vehicle.insertVehicle(vel));
 }