public int f_GetRowNumbersCount(Cl_Seat.E_Type a_Type) { if (a_Type == Cl_Seat.E_Type.Parquet) { return(p_RowNumbersCountParquet); } else if (a_Type == Cl_Seat.E_Type.Amphitheater) { return(p_RowNumbersCountAmphitheater); } else if (a_Type == Cl_Seat.E_Type.Mezzanine) { return(p_RowNumbersCountMezzanine); } else if (a_Type == Cl_Seat.E_Type.Balcony) { return(p_RowNumbersCountBalcony); } else if (a_Type == Cl_Seat.E_Type.Lodges) { return(p_RowNumbersCountLodges); } else { throw new Exception("Неизвестный тип места"); } }
public decimal f_GetPrice(Cl_Seat.E_Type a_Type) { if (a_Type == Cl_Seat.E_Type.Parquet) { return(p_PriceParquet); } else if (a_Type == Cl_Seat.E_Type.Amphitheater) { return(p_PriceAmphitheater); } else if (a_Type == Cl_Seat.E_Type.Mezzanine) { return(p_PriceMezzanine); } else if (a_Type == Cl_Seat.E_Type.Balcony) { return(p_PriceBalcony); } else if (a_Type == Cl_Seat.E_Type.Lodges) { return(p_PriceLodges); } else { throw new Exception("Неизвестный тип места"); } }
private void f_SetSeatsForNewHall(Cl_Session a_Session, Cl_Seat.E_Type a_Type) { for (int i = 0; i < a_Session.p_Hall.f_GetRowsCount(a_Type); i++) { for (int y = 0; y < a_Session.p_Hall.f_GetRowNumbersCount(a_Type); y++) { m_AppDbContext.p_Seats.Add(new Cl_Seat() { p_SessionID = a_Session.p_ID, p_Type = a_Type, p_Row = i + 1, p_Number = y + 1, p_Price = a_Session.f_GetPrice(a_Type) }); } } }