Ejemplo n.º 1
0
        public List <ShowTicketValue> InsertValueInTicketBS(BuyingValueForInsert InsertValue, List <ShowTicketValue> ShowTicketValue)
        {
            using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["RW"].ConnectionString))
            {
                var sql1 = "exec [InsertTicket]  @StationFrom,@StationTo,@Surname,@Name,@SeatID,@Date";
                var sql2 = "exec [ShowTicket] @Surname,@Name,@SeatID,@Date,@StationFrom,@StationTo";

                for (int i = 0; i < InsertValue.SeatID.Count; i++)
                {
                    var values1 = new
                    {
                        StationFrom = InsertValue.StationFrom[i], StationTo = InsertValue.StationTo[i], Surname = InsertValue.Surname[i], Name = InsertValue.Name[i],
                        SeatID      = InsertValue.SeatID[i], Date = InsertValue.Date[i]
                    };
                    var values2 = new
                    {
                        Surname     = InsertValue.Surname[i],
                        Name        = InsertValue.Name[i],
                        SeatID      = InsertValue.SeatID[i],
                        Date        = InsertValue.Date[i],
                        StationFrom = InsertValue.StationFrom[i],
                        StationTo   = InsertValue.StationTo[i]
                    };

                    connection.Query(sql1, values1);
                    ShowTicketValue.Add(connection.QueryFirst <ShowTicketValue>(sql2, values2));
                }
            }
            return(ShowTicketValue);
        }
Ejemplo n.º 2
0
 public IShowTicketValueList InsertValue(BuyingValueForInsert InsertValue)
 {
     ShowTicketValue     = Base.InsertValueInTicketBS(InsertValue, ShowTicketValue);
     ShowTicketValueList = repository.InsertShowValueIntoClass(InsertValue, ShowTicketValue, ShowTicketValueList);
     return(ShowTicketValueList);
 }