Exemple #1
0
        public string AddPackage(TouristPackage oTourist)
        {
            var message = "agrege";

            cs.AddPackage(oTourist);
            return(message);
        }
Exemple #2
0
        public List <TouristPackage> GetPackage()
        {
            conexion.Open();
            SqlCommand c = conexion.CreateCommand();

            c.Connection  = conexion;
            c.CommandType = CommandType.StoredProcedure;
            c.CommandText = "Get_Package";
            SqlDataReader dn = c.ExecuteReader();

            ListPackage.Clear();
            while (dn.Read())
            {
                string         descripcion = dn.GetString(1);
                DateTime       chekIn      = dn.GetDateTime(3);
                DateTime       chekOut     = dn.GetDateTime(2);
                double         import      = dn.GetDouble(5);
                int            cantidad    = dn.GetInt32(4);
                TouristPackage oTourist    = new TouristPackage(cantidad, import, descripcion, chekOut, chekIn);
                oTourist.IdPackage = dn.GetInt32(0);
                ListPackage.Add(oTourist);
            }
            dn.Close();
            conexion.Close();
            return(ListPackage);
        }
Exemple #3
0
        public int AddPackage(TouristPackage oTouristPackage)
        {
            conexion.Open();
            SqlCommand c = conexion.CreateCommand();

            c.Connection  = conexion;
            c.CommandType = CommandType.StoredProcedure;
            c.CommandText = "Add_Package";
            c.Parameters.AddWithValue("description", oTouristPackage.Description);
            c.Parameters.AddWithValue("checkOut", oTouristPackage.CheckOut);
            c.Parameters.AddWithValue("checkIn", oTouristPackage.CheckIn);
            c.Parameters.AddWithValue("quantity", oTouristPackage.Quantity);
            c.Parameters.AddWithValue("import", oTouristPackage.Import);
            int AffectedRow = c.ExecuteNonQuery();

            conexion.Close();
            return(AffectedRow);
        }
Exemple #4
0
 public int ModifyPackage(TouristPackage oTouristPackage)
 {
     throw new NotImplementedException();
 }
 public void AddPackage(TouristPackage oTourist)
 {
     ListPackage.AddPackage(oTourist);
 }
        public void AddPackage(string description, DateTime checkOut, DateTime checkIn, int quantity, double import)
        {
            TouristPackage oTourist = new TouristPackage(quantity, import, description, checkOut, checkIn);

            ListPackage.AddPackage(oTourist);
        }