Esempio n. 1
0
        /// <summary>
        /// Gets the detalle peliculas.
        /// </summary>
        /// <returns></returns>
        public List <MovieDetail> GetDetallePeliculas()
        {
            var detalle = new List <MovieDetail> {
            };

            using (var dbContext = new GlobalConfiguration().DbConnection())
            {
                try
                {
                    detalle = dbContext.Query <MovieDetail>("SP_getDetallePelicula", new { },
                                                            commandType: System.Data.CommandType.StoredProcedure).ToList();
                }
                catch (Exception e)
                {
                    dbContext.Close();
                }
            }
            return(detalle);
        }
Esempio n. 2
0
        /// <summary>
        /// Inserts the chair.
        /// </summary>
        /// <param name="ActionType">Type of the action.</param>
        /// <param name="chair">The chair.</param>
        /// <returns></returns>
        public bool InsertChair(int ActionType, Chair chair)
        {
            var control = true;

            using (var dbContext = new GlobalConfiguration().DbConnection())
            {
                try
                {
                    var insert = dbContext.Query("SP_ActionsSillas",
                                                 new { QueHace = ActionType, CodSilla = chair.ChairCode, Ubicacion = chair.Ubication },
                                                 commandType: System.Data.CommandType.StoredProcedure);
                }
                catch (Exception e)
                {
                    dbContext.Close();
                    control = false;
                }
            }
            return(control);
        }
Esempio n. 3
0
        /// <summary>
        /// Inserts the ciudad.
        /// </summary>
        /// <param name="ActionType">The tipo action.</param>
        /// <param name="ciudad">The ciudad.</param>
        /// <returns></returns>
        public bool InsertCity(int ActionType, City ciudad)
        {
            var control = true;

            using (var dbContext = new GlobalConfiguration().DbConnection())
            {
                try
                {
                    var insert = dbContext.Query("SP_ActionsCiudad",
                                                 new { QueHace = ActionType, CodCiudad = ciudad.CityCode, Nombre = ciudad.CityName },
                                                 commandType: System.Data.CommandType.StoredProcedure);
                }
                catch (Exception e)
                {
                    dbContext.Close();
                    control = false;
                }
            }

            return(control);
        }