public static string CheckCount(string[] array) { PriceSeatsBl price = new PriceSeatsBl(); string seat = "D3,D4,D5,D6,D7,D8,E3,E4,E5,E6,E7,E8,F3,F4,F5,F6,F7,F8,G3,G4,G5,G6,G7,G8,H3,H4,H5,H6,H7,H8,I3,I4,I5,I6,I7,I8,J3,J4,J5,J6,J7,J8,K3,K4,K5,K6,K7,K8"; string[] mapArr = seat.Split(","); int V = 0; int T = 0; for (int i = 0; i < array.Length; i++) { int Count = 0; for (int k = 0; k < mapArr.Length; k++) { if (mapArr[k] == array[i]) { V++; Count++; break; } } if (Count == 0) { T++; } } return($"{V}V - {T}T "); }
public static double PaymentFare(string seats) { PriceSeatsBl price = new PriceSeatsBl(); string seat = "D3,D4,D5,D6,D7,D8,E3,E4,E5,E6,E7,E8,F3,F4,F5,F6,F7,F8,G3,G4,G5,G6,G7,G8,H3,H4,H5,H6,H7,H8,I3,I4,I5,I6,I7,I8,J3,J4,J5,J6,J7,J8,K3,K4,K5,K6,K7,K8"; string[] mapArr = seat.Split(","); double Payment = 0; int count = 0; for (int i = 0; i < mapArr.Length; i++) { if (seats == mapArr[i]) { Payment = Payment + price.GetPriceSeatByPrice_Id(2).Price; count++; break; } } if (count == 0) { Payment = Payment + price.GetPriceSeatByPrice_Id(1).Price; } return(Payment); }