private void AddSeat(int row, int column, SeatStatus status) { var seat = new Seat(row, column) { Status = status }; _seats.Add(seat.GetPosition(), seat); }
private void UpdateSeatState(Guid seatId, SeatStatus status) { var seat = _seatStates.FirstOrDefault(b => b.SeatId == seatId); if (seat != null) { seat.Status = status; } }
private void UpdateStatus(Guid seatId, SeatStatus status, string reason = "") { using (var context = new ProjectionContext(ConnectionString.Get())) { var seat = context.GetEntity <SeatSqlentity>(seatId); seat.Status = status; seat.Reason = reason; context.SaveChanges(); } }
public Seat(BillettServiceSete seat) { SectionName = seat.SectionName; RowName = seat.RowName; SeatName = seat.SeatName; EttCode = seat.EttCode; Position = $"{SectionName}:{RowName}:{SeatName}"; Classification = SeatStatusClassifier.Classify(EttCode); }
public SeatDiff(Seat originalSeat, Seat newSeat) { Position = originalSeat.Position; SectionName = originalSeat.SectionName; RowName = originalSeat.RowName; SeatName = originalSeat.SeatName; OriginalEttCode = originalSeat.EttCode; NewEttCode = newSeat.EttCode; OriginalClassification = originalSeat.Classification; NewClassification = newSeat.Classification; }
void SeatAvailable() { //deselect all other seats DeselectAll(); // select this seat seatStatus = SeatStatus.Selected; // send selection info to control selectControl.SeatSelected(seatName); }
public List <SeatStatus> GetSeatStatusByPersonId(int personId) { List <SeatStatus> seatStatusesList = new List <SeatStatus>(); _connection.Open(); using (SqlCommand command = new SqlCommand()) { command.Connection = _connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = spGetSeatStatusByIdQuery; command.Parameters.AddWithValue("@personId", personId); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { var user = new User(); var person = new Person(); var flight = new Flight(); user.Id = (int)reader[0]; user.Name = (string)reader[1]; user.Surname = (string)reader[2]; user.Login = (string)reader[3]; user.Password = (string)reader[4]; user.Disabled = (bool)reader[5]; person.Id = (int)reader[11]; person.Name = (string)reader[12]; person.Surname = (string)reader[13]; flight.DepatureTime = (DateTime)reader[7]; flight.ArrivalTime = (DateTime)reader[8]; flight.Depature = (string)reader[9]; flight.Destination = (string)reader[10]; flight.Id = (int)reader[6]; var seat = new Seat(flight); seat.Id = (int)reader[14]; seat.Number = (int)reader[15]; seat.Cost = (decimal)reader[17]; var seatStatus = new SeatStatus(user, person, seat); seatStatus.Id = (int)reader[18]; seatStatus.Status = (int)reader[19]; seatStatusesList.Add(seatStatus); } _connection.Close(); return(seatStatusesList); } } }
private string GetSeatStatus(SeatStatus status) { switch (status) { case SeatStatus.Valid: return("Validé"); case SeatStatus.ToValidate: return("A valider"); case SeatStatus.Canceled: return("Annulé"); case SeatStatus.Refused: return("Refusé"); default: return("Inconnu"); } }
protected override async Task Handle(BlockCustomerSeatCommand command) { SeatStatus BlockByCustomer = SeatStatus.BlockedByCustomer; MatchLayoutSectionSeat matchLayoutSectionSeat = _matchLayoutSectionSeatRepository.Get(command.MatchLayoutSectionSeatsId); if (!command.IsBlock) { BlockByCustomer = SeatStatus.UnSold; } if (matchLayoutSectionSeat != null) { matchLayoutSectionSeat.SeatStatusId = BlockByCustomer; matchLayoutSectionSeat.UpdatedUtc = DateTime.UtcNow; _matchLayoutSectionSeatRepository.Save(matchLayoutSectionSeat); } }
public List <SeatStatus> GetAllSeatStatuses() { List <SeatStatus> seatStatusesList = new List <SeatStatus>(); _connection.Open(); using (SqlCommand command = new SqlCommand(spGetSeatStatusesQuery, _connection)) { using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { var user = new User(); var person = new Person(); var flight = new Flight(); user.Id = (int)reader[0]; user.Name = (string)reader[1]; user.Surname = (string)reader[2]; user.Login = (string)reader[3]; user.Password = (string)reader[4]; user.Disabled = (bool)reader[5]; person.Id = (int)reader[11]; person.Name = (string)reader[12]; person.Surname = (string)reader[13]; flight.DepatureTime = (DateTime)reader[7]; flight.ArrivalTime = (DateTime)reader[8]; flight.Depature = (string)reader[9]; flight.Destination = (string)reader[10]; flight.Id = (int)reader[6]; var seat = new Seat(flight); seat.Id = (int)reader[14]; seat.Number = (int)reader[15]; seat.Cost = (decimal)reader[17]; var seatStatus = new SeatStatus(user, person, seat); seatStatus.Id = (int)reader[18]; seatStatus.Status = (int)reader[19]; seatStatusesList.Add(seatStatus); } } } _connection.Close(); return(seatStatusesList); }
protected override void Seed(CinemaReserveDbContext context) { FreeSeatStatus = context.SeatStatus.FirstOrDefault(st => st.Status == "free") ?? new SeatStatus() { Status = "free" }; UpcomingReservationStatus = context.ProjectionStatuses.FirstOrDefault(st => st.Status == "upcoming") ?? new ProjectionStatus() { Status = "upcoming" }; for (int i = 0; i < 5; i++) { Cinema newCinema = this.GetCinema(i); context.Cinemas.Add(newCinema); } context.SaveChanges(); }
protected override void AddPlayers(EventPlayer player) { if (player == null) { throw new ArgumentNullException(nameof(player)); } player .Add <SeatCanceled>(e => _currentSeatStatus = SeatStatus.Canceled) .Add <SeatValided>(e => _currentSeatStatus = SeatStatus.Valid) .Add <SeatRefused>(e => _currentSeatStatus = SeatStatus.Refused) .Add <SeatCreated>(e => { SessionId = e.SessionId; CompanyId = e.CompanyId; StudentId = e.StudentId; }) .Add <AgreementAssociated>(e => AssociatedAgreementId = e.AgreementId) .Add <AgreementDisassociated>(e => AssociatedAgreementId = null) .Add <MissingStudentReported>(e => _missingStudent = true) .Add <SeatStudentUpdated>(e => StudentId = e.NewStudentId); }
//生成按钮状态 private static void btn_status(Button btn, SeatStatus status) { switch (status) { case SeatStatus.AVILABLE: //可用 btn.BackColor = Color.White; break; case SeatStatus.USING: //正在使用 btn.BackColor = Color.Cyan; break; case SeatStatus.PAIED: //已经结账 btn.BackColor = Color.Gray; break; case SeatStatus.LOCKING: //锁定 btn.BackColor = Color.Orange; break; case SeatStatus.STOPPED: //停用 btn.BackColor = Color.Red; break; case SeatStatus.WARNING: //警告 btn.BackColor = Color.Yellow; break; case SeatStatus.DEPOSITLEFT: //押金离场 btn.BackColor = Color.Violet; break; case SeatStatus.REPAIED: //重新结账 btn.BackColor = Color.CornflowerBlue; break; default: break; } }
public void SetStatus(SeatStatus status, uint time = 0) { seatStatus = status; // Debug.Log("!! AttRecordItem SetStatus !!" + status); var machine = _defaultMachine; var chair = _freeChair; var color = colors[0]; if (status == SeatStatus.Fill) { chair = _fillChair; } else if (status == SeatStatus.Leave) { chair = _leaveChair; machine = _leaveMachine; color = colors[1]; showTimeTxt(time); var counter = Observable.Interval(TimeSpan.FromSeconds(1)).TakeUntilDestroy(this).Subscribe(x => { --time; showTimeTxt(time); }); Observable.Timer(TimeSpan.FromSeconds(time)).FirstOrDefault().TakeUntilDestroy(this).Subscribe(_ => { counter.Dispose(); SetStatus(SeatStatus.Free); }); } _titleTxt.color = color; _titleDesTxt.color = color; _machineImg.sprite = LC_PoolManager.Instance.GetSpriteFromAtlas("GameHall", "SubGame", machine); _chairImg.sprite = LC_PoolManager.Instance.GetSpriteFromAtlas("GameHall", "SubGame", chair); _personGo.SetActive(status == SeatStatus.Fill); _timeGo.SetActive(status == SeatStatus.Leave); }
public Seat CreateSeat(char status, Point position) { Position = position; switch (status) { case 'L': Status = SeatStatus.Empty; break; case '#': Status = SeatStatus.Occupied; break; case '.': return(null); default: throw new ArgumentException($"Status not recognised: {status}"); } return(this); }
public ActionResult Select(int id, SeatStatus selected) { var seat = db.Seats.First(s => s.ID == id); if (seat.Status == SeatStatus.Available && selected == SeatStatus.Available) { seat.Status = SeatStatus.Selected; seat.SelectedAt = DateTime.Now; } else if (seat.Status == SeatStatus.Selected && selected == SeatStatus.Selected) { seat.Status = SeatStatus.Available; seat.SelectedAt = null; } else { return(Json(null, JsonRequestBehavior.AllowGet)); } db.SaveChanges(); return(Json(seat, JsonRequestBehavior.AllowGet)); }
//---called by clients when they want to book seats--- public void SetSeatStatus(string strSeats) { _seatStatus = new SeatStatus { //---stores the seats to be booked by a client--- Seats = strSeats }; //---get all the clients in dictionary--- var query = (from c in clients select c.Value).ToList(); //---create the callback action--- Action<ITicketCallBack> action = delegate(ITicketCallBack callback) { //---callback to pass the seats booked // by a client to all other clients--- callback.SeatStatus(_seatStatus.Seats); }; //---for each connected client, invoke the callback--- query.ForEach(action); }
//生成按钮状态 private static void btn_status(Button btn, SeatStatus status) { switch (status) { case SeatStatus.AVILABLE://可用 btn.BackColor = Color.White; break; case SeatStatus.USING://正在使用 btn.BackColor = Color.Cyan; break; case SeatStatus.PAIED://已经结账 btn.BackColor = Color.Gray; break; case SeatStatus.LOCKING://锁定 btn.BackColor = Color.Orange; break; case SeatStatus.STOPPED://停用 btn.BackColor = Color.Red; break; case SeatStatus.WARNING://警告 btn.BackColor = Color.Yellow; break; case SeatStatus.DEPOSITLEFT://押金离场 btn.BackColor = Color.Violet; break; case SeatStatus.REPAIED://重新结账 btn.BackColor = Color.CornflowerBlue; break; default: break; } }
public Seat(string id, SeatStatus status = SeatStatus.Available, int price = 100000) { this.id = id; this.status = status; this.price = price; }
public Seat CreateSeat(SeatStatus status, Point position) { Position = position; Status = status; return(this); }
private Seat(RowNumber rowNumber, SeatNumber seatNumber, SeatStatus seatStatus) { _seatStatus = seatStatus; RowNumber = rowNumber; SeatNumber = seatNumber; }
public Seat(int row, int column) { Row = row; Column = column; Status = SeatStatus.Empty; }
public static string SeatStatus(SeatStatus ss) { return(seatStatusIcons[(int)ss]); }
public IBookingFactory WithSeat(int rowNumber, string rowLetter, SeatStatus seatStatus) => this.WithSeat(new Seat(rowNumber, rowLetter, seatStatus));
public void InjectData(ulong roomId, uint id, SeatStatus status, uint time) { roomNo = roomId; gsId = id; SetStatus(status, time); }
//点击台位按钮 private void btn_Click(object sender, EventArgs e) { Button btn = sender as Button; btn.Enabled = false; btn.Enabled = true; //BathDBDataContext db_new = new BathDBDataContext(LogIn.connectionString); //m_Seat = db_new.Seat.FirstOrDefault(x => x.text == btn.Text); m_Seat = dao.get_seat("text", btn.Text); SeatStatus status = m_Seat.status; switch (status) { case SeatStatus.AVILABLE: //可用 case SeatStatus.PAIED: //已经结账 BathClass.printErrorMsg("手牌未开牌"); break; case SeatStatus.USING: //正在使用 case SeatStatus.DEPOSITLEFT: //押金离场 if (!dao.get_authority(LogIn.m_User, "完整点单") && !dao.get_authority(LogIn.m_User, "可见本人点单")) { BathClass.printErrorMsg("权限不够!"); break; } if (MConvert <bool> .ToTypeOrDefault(m_Seat.paying, false)) { BathClass.printErrorMsg("正在结账!"); break; } //if (BathClass.ToBool(m_Seat.ordering)) //{ // BathClass.printErrorMsg("正在录单!"); // break; //} //m_Seat.ordering = true; //db_new.SubmitChanges(); OrderForm orderForm = new OrderForm(m_Seat, LogIn.m_User, LogIn.connectionString, false); orderForm.ShowDialog(); //m_Seat.ordering = false; //db_new.SubmitChanges(); break; case SeatStatus.LOCKING: //锁定 BathClass.printErrorMsg("手牌已经锁定!"); break; case SeatStatus.STOPPED: //停用 BathClass.printErrorMsg("台位已经停用!"); break; case SeatStatus.WARNING: //警告 OrderCheckForm orderCheckForm = new OrderCheckForm(m_Seat, LogIn.connectionString, LogIn.options); orderCheckForm.ShowDialog(); break; case SeatStatus.REPAIED: BathClass.printErrorMsg("补救台位不能录单"); break; default: break; } }
public Seat(string name, string status) { this.name = name; this.status = FromString(status); }
public Seat(string name, SeatStatus status) { this.name = name; this.status = status; }
//获取手牌数量 public int get_seat_count(SeatStatus status) { int count = 0; SqlConnection sqlCn = open_connection(); if (sqlCn == null || sqlCn.State != ConnectionState.Open) return -1; string cmd_str = ""; try { cmd_str = "Select count(*) from [Seat]"; if (status != SeatStatus.INVALID) cmd_str += "where status = '" + ((int)status).ToString() + "'"; SqlCommand cmd = new SqlCommand(cmd_str, sqlCn); count = (int)cmd.ExecuteScalar(); } catch (System.Exception e) { IOUtil.insert_file(cmd_str); IOUtil.insert_file(e.Message+"\n"); } finally { close_connection(sqlCn); } return count; }
void Deselect() { seatStatus = SeatStatus.Available; }
public SeatState(SeatStatus status) { Statut = status; }
/// <summary> /// Full constructor /// </summary> /// <param name="id"></param> /// <param name="status"></param> public Seat(int id, SeatStatus status) { ID = id; Status = status; }