public frmReservationEdit() { InitializeComponent(); _reservationService = new ReservationManager(new EfReservationDal()); _guestService = new GuestManager(new EfGuestDal()); _roomService = new RoomManager(new EfRoomDal()); }
// Use this for initialization void Awake() { GuestManager.LoadGuestData(); GuestManager.CurrentRaceresults.Clear(); for (int i = 0; i <= 9; i++) { //TurtlesInTheRace[i].name = AllTurtlesData[i].name; TurtlesInTheRace[i].name = gameObject.GetComponent <TurtleNamer>().GiveNewRandomName(); } DeactivateObjects(possibleTracks); DeactivateObjects(possibleFinishLines); int randomTrack = Random.Range(0, possibleTracks.Length); int randomLength = Random.Range(0, possibleFinishLines.Length); possibleTracks[randomTrack].SetActive(true); possibleFinishLines[randomLength].SetActive(true); RaceInfoSurface.text = "Surface: " + possibleTracks[randomTrack].name; RaceInfoLength.text = "Length: " + possibleFinishLines[randomLength].name; FinishLineCam.gameObject.transform.position = new Vector3(FinishLineCam.transform.position.x, FinishLineCam.transform.position.y, possibleFinishLines[randomLength].transform.position.z); FinishLineLocator.transform.position = possibleFinishLines[randomLength].transform.position; isBettingOpen = true; string exampleName = TurtlesInTheRace[Random.Range(2, 5)].name; bettingOpenInstructions.text = "Type ''" + exampleName + " Win 10'' to bet 10 on " + exampleName + " to win!"; }
/// <summary> /// Eduardo Colon /// Created: 2019/03/20 /// /// constructor to create shuttleReservation with one parameter. /// </summary> public ShuttleReservationDetail(IShuttleReservationManager shuttleReservationManager = null, IEmployeeManager employeeManager = null, IGuestManager guestManager = null) { if (shuttleReservationManager == null) { shuttleReservationManager = new ShuttleReservationManager(); } if (employeeManager == null) { employeeManager = new EmployeeManager(); } if (guestManager == null) { guestManager = new GuestManager(); } _shuttleReservationManager = shuttleReservationManager; _employeeManager = employeeManager; _guestManager = guestManager; _isUpdate = false; InitializeComponent(); btnDropoffSubmit.Visibility = Visibility.Collapsed; }
// Make Random Position Queue private void Awake() { if (_instance != null || GuestPrefab == null) { Debug.LogError("Guest Manager Has Duplicated or Prefab Missing, Please Check Object"); gameObject.SetActive(false); } _instance = this; _guestSpawnWait = new WaitForSeconds(GuestSpawnRate); if (photonView.IsMine) { List <BurgerTrayController> guestSeats = transform .GetComponentsInChildren <BurgerTrayController>() .ToList <BurgerTrayController>(); int randomIndex; while (guestSeats.Count != 0) { randomIndex = Random.Range(0, guestSeats.Count - 1); BurgerTrayController burgetTray = guestSeats[randomIndex]; _counterQueue.Enqueue(new CounterData(burgetTray.transform.position, burgetTray.GetComponent <BurgerTrayController>(), burgetTray.transform.name)); guestSeats.RemoveAt(randomIndex); } } }
private void OnDestroy() { if (photonView.IsMine) { GuestManager.GetInstance().ReturnCounter(_currentTarget); } }
// Update is called once per frame void Update() { xposition = gameObject.transform.position.x; if (xposition > 10) { movedirection = "left"; } if (xposition < -10) { movedirection = ("right"); } if (movedirection == "right") { transform.Translate(Time.deltaTime * SpeedMultiplier, 0, 0); } if (movedirection == "left") { transform.Translate(-Time.deltaTime * SpeedMultiplier, 0, 0); } if (Input.GetKeyDown(KeyCode.X)) { lengthOfGame = 3; } if (Time.timeSinceLevelLoad > lengthOfGame) { foreach (GuestData gD in GuestManager.AllGuests) { gD.bonusRoundBallsDropped = 0; } GuestManager.SaveGuestData(); print("restarting"); SceneManager.LoadScene("Race"); } RaceStartingTimer.text = Mathf.RoundToInt(lengthOfGame - Time.timeSinceLevelLoad) + " Seconds"; }
//when message is recieved from IRC-server or our own message. void OnChatMsgRecieved(string msg) { //parse from buffer. int msgIndex = msg.IndexOf("PRIVMSG #"); string msgString = msg.Substring(msgIndex + IRC.channelName.Length + 11); string user = msg.Substring(1, msg.IndexOf('!') - 1); GuestManager.CheckOrRegisterGuest(user); BetManager.GetABet(msgString, user, this.gameObject); Debug.Log("<color=purple> msg = " + msg + "</color><color=blue> msgString = " + msgString + "</color><color=purple>user = "******"</color>"); if (msgString == "Enter") { Debug.Log("Spawn a spectator!"); //Possible future feature to spawn audience avatar } //remove old messages for performance reasons. if (messages.Count > maxMessages) { Destroy(messages.First.Value); messages.RemoveFirst(); } //add new message. //CreateUIMessage(user, msgString); }
public void TestSetup() { _gues = new GuestAccessorMock(); _guestManager = new GuestManager(_gues); _guests = new List <Guest>(); _guests = _guestManager.ReadAllGuests(); }
public frmShowReservations(Room room) { InitializeComponent(); _roomId = room.Id; _reservationService = new ReservationManager(new EfReservationDal()); _guestService = new GuestManager(new EfGuestDal()); }
/// <summary> /// Initializes a new instance of the <see cref="GuestManagerTest"/> class. /// </summary> public GuestManagerTest() { this.guestRepository = new Mock<IGuestRepository>(); this.personRepository = new Mock<IPersonRepository>(); this.referenceDataRepository = new Mock<IReferenceDataRepository>(); this.manager = new GuestManager(this.guestRepository.Object, this.personRepository.Object, this.referenceDataRepository.Object); }
/// <summary> /// Alisa Roehr /// Created: 2019/01/31 /// Modified: 2019/03/01 /// /// Constructor for view guest /// </summary> /// <remarks> /// /// </remarks> /// <param name="oldGuest">Guest that will be shown on the details screen</param> public frmAddEditGuest(Guest oldGuest) { InitializeComponent(); _guestManager = new GuestManager(); _member = new MemberManagerMSSQL(); try { _members = _member.RetrieveAllMembers(); } catch (Exception ex) { MessageBox.Show(ex.Message); } cbxMemberName.Items.Clear(); foreach (var item in _members) { cbxMemberName.Items.Add(item.FirstName + " " + item.LastName); if (item.MemberID == oldGuest.MemberID) { cbxMemberName.SelectedItem = item.FirstName + " " + item.LastName; } } _oldGuest = oldGuest; setReadOnly(); btnGuestAction.Content = "Edit"; }
/// <summary> /// Alisa Roehr /// Created: 2019/01/25 /// /// Constructor for new guest /// <summary> /// Updated By: Caitlin Abelson /// Date: 2019/04/11 /// /// Added the combobox for the existing members. /// /// </remarks> public frmAddEditGuest() { InitializeComponent(); _guestManager = new GuestManager(); _member = new MemberManagerMSSQL(); try { _members = _member.RetrieveAllMembers(); } catch (Exception ex) { MessageBox.Show(ex.Message); } cbxMemberName.Items.Clear(); if (_members != null) { foreach (var item in _members) { cbxMemberName.Items.Add(item.FirstName + " " + item.LastName); } } setEditable(); btnGuestAction.Content = "Add"; }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.S)) { GuestManager.SaveGuestData(); } if (TheRaceManager.hasRaceStarted) { gameObject.SetActive(false); PreRaceCam.Priority = 0; } CurrentTotalPot = 0; CurrentTotalShowPool = 0; CurrentTotalPlacePool = 0; RaceManager racemanagerScript = TheRaceManager.GetComponent <RaceManager>(); foreach (BetData bD in racemanagerScript.CurrentRaceBets) { if (bD.BetType == "win") { CurrentTotalPot += bD.BetAmount; WinPool.text = CurrentTotalPot.ToString(); } if (bD.BetType == "show") { CurrentTotalShowPool += bD.BetAmount; ShowPool.text = CurrentTotalShowPool.ToString(); } if (bD.BetType == "place") { CurrentTotalPlacePool += bD.BetAmount; PlacePool.text = CurrentTotalPlacePool.ToString(); } } }
// Update is called once per frame void Update() { if (!hasAiEntered && Time.timeSinceLevelLoad > lengthOfGame - 5) { for (int i = 0; i <= 10; i++) { fakeMessage(i.ToString()); } hasAiEntered = true; } xposition = gameObject.transform.position.x; if (xposition > 10) { movedirection = "left"; } if (xposition < -10) { movedirection = ("right"); } if (movedirection == "right") { transform.Translate(Time.deltaTime * SpeedMultiplier, 0, 0); } if (movedirection == "left") { transform.Translate(-Time.deltaTime * SpeedMultiplier, 0, 0); } if (Input.GetKeyDown(KeyCode.M)) { if (IsMusicEnabled) { IsMusicEnabled = false; Debug.Log("Disabling Music"); } else { IsMusicEnabled = true; Debug.Log("Enabling Music"); } } if (Input.GetKeyDown(KeyCode.X)) { lengthOfGame = 3; } if (Time.timeSinceLevelLoad > lengthOfGame) { foreach (GuestData gD in GuestManager.AllGuests) { gD.bonusRoundBallsDropped = 0; } GuestManager.SaveGuestData(); print("restarting"); PlayerPrefs.SetInt("NextSurface", nextSurface); PlayerPrefs.SetInt("NextLength", nextLength); PlayerPrefs.SetInt("NextPurse", Purse); SceneManager.LoadScene("Race"); } RaceStartingTimer.text = Mathf.RoundToInt(lengthOfGame - Time.timeSinceLevelLoad) + " Seconds"; }
public RoomButton(Room _room) { InitializeComponent(); _reservationService = new ReservationManager(new EfReservationDal()); _guestService = new GuestManager(new EfGuestDal()); room = _room; this.Show(); }
public RoomDetails(List <RoomEvent> rmEvents, Guest guest, EventAppLogicLayer.EventManager em, GuestManager gm, RoomManager rm) { InitializeComponent(); _roomEvents = rmEvents; _guest = guest; _em = em; _gm = gm; _rm = rm; }
/// <summary> /// 删除一行时执行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GuestTable_RowDeleting(object sender, GridViewDeleteEventArgs e) { SqlDataSource1.DeleteCommand = "SELECT * FROM HOTEL WHERE hID='-1'"; GuestManager.DeleteGuest(new Guest { GuestID = e.Values["gID"].ToString().Trim(), GuestName = e.Values["gName"].ToString().Trim(), Username = UsernameLabel.Text }); GuestTable.DataBind(); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); Debug.LogWarning("Duplicate GuestManager found. Deleting...", this.gameObject); } }
void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } aud = GetComponent <AudioSource>(); }
private int _occupancyLimit = 0; //occupancy limit maximum private void Awake() { //Singleton Pattern if (Instance != null && Instance != this) { Destroy(this.gameObject); } else { Instance = this; } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } CanMove = true; }
/// <summary> /// 窗体载入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GuestManageForm_Load(object sender, EventArgs e) { this.pnlContent.Visible = false;//隐藏编辑区 this.dgvGuest.AutoGenerateColumns = false; if (string.IsNullOrEmpty(this.txtGuestName.Text.Trim())) { this.dgvGuest.DataSource = GuestManager.GetAllGuests(); } else { this.dgvGuest.DataSource = GuestManager.GetGuestByGuestName(this.txtGuestName.Text.Trim()); } }
public AddLuggage(LuggageManager luggageManager, GuestManager guestManager) { InitializeComponent(); this.luggageManager = luggageManager; this.guestManager = guestManager; List <LuggageStatus> status = null; try { status = luggageManager.RetrieveAllLuggageStatus(); } catch (Exception ex) { MessageBox.Show(ex.Message); } List <string> statusNames = new List <string>(); if (status != null) { foreach (var s in status) { statusNames.Add(s.LuggageStatusID); } } cboStatus.ItemsSource = statusNames; cboStatus.SelectedIndex = 0; List <Guest> guests = null; try { guests = guestManager.ReadAllGuests(); } catch (Exception ex) { MessageBox.Show(ex.Message); } List <int> guestIDs = new List <int>(); if (guests != null) { foreach (var g in guests) { guestIDs.Add(g.GuestID); } } cboGuest.ItemsSource = guestIDs; cboGuest.SelectedIndex = 0; }
/// <summary> /// 保存功能 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void 保存ToolStripMenuItem_Click(object sender, EventArgs e) { Guest guest = new Guest(); guest.Name = this.txtName.Text.Trim(); guest.LeaveTime = Convert.ToDateTime(this.txtLeaveTime.Text); guest.ArriveTime = Convert.ToDateTime(this.txtArriveTime.Text); guest.CategoryId = 1; guest.Mobile = this.txtPhone.Text.Trim(); guest.Sex = this.txtSex.Text.Trim(); guest.RoomId = Convert.ToInt32(this.txtRoomID.Text.Trim()); GuestManager.AddGuest(guest); MessageBox.Show("保存成功"); this.dgvGuest.DataSource = GuestManager.GetAllGuests(); }
/// <summary> /// Alisa Roehr /// Created: 2019/01/25 /// /// The constructor for the browse window. /// </summary> public BrowseGuests() { InitializeComponent(); _guestManager = new GuestManager(); try { _guests = _guestManager.ReadAllGuests(); if (dgGuests.ItemsSource == null) { dgGuests.ItemsSource = _guests; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 删除功能 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void 除ToolStripMenuItem_Click(object sender, EventArgs e) { if (id == 0) { MessageBox.Show("没有删除的信息"); return; } else { DialogResult result = MessageBox.Show("确认要删除该信息吗?", "消息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (result == DialogResult.OK) { GuestManager.DeleteGuestById(id); MessageBox.Show("删除成功"); this.dgvGuest.DataSource = GuestManager.GetAllGuests(); } } }
//when message is recieved from IRC-server or our own message. void OnChatMsgRecieved(string msg) { //parse from buffer. int msgIndex = msg.IndexOf("PRIVMSG #"); string msgString = msg.Substring(msgIndex + IRC.channelName.Length + 11); string user = msg.Substring(1, msg.IndexOf('!') - 1); GuestManager.CheckOrRegisterGuest(user); BetManager.GetABet(msgString, user, this.gameObject); //Debug.Log("<color=purple> msg = " + msg + "</color><color=blue> msgString = " + msgString + "</color><color=purple>user = "******"</color>"); if (msgString == "Enter") { Debug.Log("Spawn a spectator!"); //Possible future feature to spawn audience avatar foreach (GuestData possibleGuest in GuestManager.AllGuests) { if (possibleGuest.guestName == user) { if (possibleGuest.ownedTurtles.Count > 0) { string numbersInMessage = Regex.Match(msgString, @"\d+").Value; int numbersInMessageAsInt = int.Parse(numbersInMessage); //BonusRoundManager.TurtlesToEnterNextRace.SetValue(possibleGuest.ownedTurtles[numbersInMessageAsInt-1], BonusRoundManager.TurtlesToEnterNextRace.Length); //doing this elsewhere now } } } } if (msgString.CaseInsensitiveContains("balance")) { //send a PM with their balance } //remove old messages for performance reasons. if (messages.Count > maxMessages) { Destroy(messages.First.Value); messages.RemoveFirst(); } //add new message. //CreateUIMessage(user, msgString); }
public override void OnMasterClientSwitched(Player newMasterClient) { base.OnMasterClientSwitched(newMasterClient); if (PhotonNetwork.LocalPlayer == newMasterClient) { Debug.Log("This Client is Master Client"); Transform tr = GuestManager.GetInstance().transform.Find(_serializeTargetNameCache); _currentTarget = new CounterData(tr.position, tr.GetComponent <BurgerTrayController>(), _serializeTargetNameCache); photonView.TransferOwnership(newMasterClient); _navMeshAgent.enabled = true; _navMeshAgent.isStopped = true; } }
void RoomGuest_Load(object sender, EventArgs e) { this.Text = "客房客户信息:" + MainForm.CurrentRoom.Name + "房间"; Guest g = new GuestManager().GetGuestByRoom(MainForm.CurrentRoom); this.textBoxDeposit.Text = g.Deposit.ToString(); this.textBoxID.Text = g.Id; this.textBoxInTime.Text = g.InTime.ToString(); this.textBoxName.Text = g.Name; this.textBoxSex.Text = g.Sex; this.textBoxStayTime.Text = Convert.ToString(g.StayTime) + "天"; if (this.Tag == "TimeIsUp") { } else { this.button1.Text = "确定"; } }
void RoomGuest_Load(object sender, EventArgs e) { this.Text = "客房客户信息:" + MainForm.CurrentRoom.Name + "房间"; Guest g = new GuestManager().GetGuestByRoom(MainForm.CurrentRoom); this.textBoxDeposit.Text = g.Deposit.ToString(); this.textBoxID.Text = g.Id; this.textBoxInTime.Text = g.InTime.ToString(); this.textBoxName.Text = g.Name; this.textBoxSex.Text = g.Sex; this.textBoxStayTime.Text = Convert.ToString(g.StayTime) + "天"; if (this.Tag == "TimeIsUp") { } else { this.button1.Text = "确定"; } }
public frmRegisteredEvent(RoomEvent rmEvnt, Guest guest, EventAppLogicLayer.EventManager em, GuestManager gm, RoomManager rm) { InitializeComponent(); _roomEvent = rmEvnt; _em = em; _guest = guest; _gm = gm; _rm = rm; try { // get the event information _event = _em.GetEventByID(_roomEvent.EventID); } catch (Exception ex) { MessageBox.Show("ERROR: " + ex.Message); } }
public AdminModules(ITokenizer tokenizer) : base("/admin") { WebManager webManager = new WebManager(); ReportManager reportManager = new ReportManager(); AdminManager adminManager = new AdminManager(); EvaluatorManager evaluatorManager = new EvaluatorManager(); TopicManager topicManager = new TopicManager(); SponsorManager sponsorManager = new SponsorManager(); RegistrationManager registration = new RegistrationManager(); GuestManager guest = new GuestManager(); TemplateManager templateManager = new TemplateManager(); AuthTemplateManager authTemplateManager = new AuthTemplateManager(); SubmissionManager submissionManager = new SubmissionManager(); BannerManager bannerManager = new BannerManager(); /*------------------Payment--------------------------*/ Post["/secureReentry"] = parameters => { /*receive the tandem ID and information store on data base and confirm payment /*return in the xml the the receipt link or the error link*/ return Response.AsXml(""); }; /* ----- Template -----*/ Post["/addTemplate"] = parameters => { var temp = this.Bind<TemplateManager.templateQuery>(); TemplateManager.templateQuery result = templateManager.addTemplate(temp); if (result != null) { return Response.AsJson(result); } else { return HttpStatusCode.Conflict; } }; Get["/getTemplatesAdmin"] = parameters => { return Response.AsJson(templateManager.getTemplates()); }; Get["/getTemplatesAdminListIndex/{index:int}"] = parameters => { int index = parameters.index; return Response.AsJson(templateManager.getTemplates(index)); }; Put["/deleteTemplate"] = parameters => { var id = this.Bind<long>(); int result = templateManager.deleteTemplate(id); if (result == 1 || result == 0) return Response.AsJson(result); else { return HttpStatusCode.Conflict; } }; Put["/updateTemplate"] = parameters => { var template = this.Bind<template>(); if (templateManager.updateTemplate(template)) { return HttpStatusCode.OK; } else { return HttpStatusCode.Conflict; } }; /* ----- Auth Template -----*/ Post["/addAuthTemplate"] = parameters => { var temp = this.Bind<AuthTemplateManager.templateQuery>(); AuthTemplateManager.templateQuery result = authTemplateManager.addTemplate(temp); if (result != null) { return Response.AsJson(result); } else { return HttpStatusCode.Conflict; } }; Get["/getAuthTemplatesAdmin"] = parameters => { return Response.AsJson(authTemplateManager.getTemplates()); }; Get["/getAuthTemplatesAdminListIndex/{index:int}"] = parameters => { int index = parameters.index; return Response.AsJson(authTemplateManager.getTemplates(index)); }; Put["/deleteAuthTemplate"] = parameters => { var id = this.Bind<int>(); if (authTemplateManager.deleteTemplate(id)) { return HttpStatusCode.OK; } else { return HttpStatusCode.Conflict; } }; Put["/updateAuthTemplate"] = parameters => { var template = this.Bind<authorizationtemplate>(); if (authTemplateManager.updateTemplate(template)) { return HttpStatusCode.OK; } else { return HttpStatusCode.Conflict; } }; /* ----- Sponsor Complementary-----*/ Post["/addSponsorComplementaryKeys"] = parameters => { var obj = this.Bind<NancyService.Modules.SponsorManager.addComplementary>(); return Response.AsJson(sponsorManager.addKeysTo(obj)); }; Put["/deleteComplementaryKey"] = parameters => { var id = this.Bind<long>(); if (sponsorManager.deleteComplementary(id)) { return HttpStatusCode.OK; } else { return HttpStatusCode.Conflict; } }; Put["/deleteSponsorComplementaryKey"] = parameters => { var id = this.Bind<long>(); return Response.AsJson(sponsorManager.deleteComplementarySponsor(id)); }; Get["/getComplementaryKeys"] = parameters => { try { // this.RequiresAuthentication(); // this.RequiresClaims(new[] { "minor" }); return Response.AsJson(sponsorManager.getComplementaryList()); } catch { return null; } }; Get["/getSponsorComplementaryKeys/{id:long}"] = parameters => { try { long id = parameters.id; return Response.AsJson(sponsorManager.getSponsorComplementaryList(id)); } catch { return null; } }; Get["/getSponsorComplementaryKeysFromIndex/{index:int}/{id:long}"] = parameters => { try { NancyService.Modules.SponsorManager.ComplimentaryPagingQuery info = new NancyService.Modules.SponsorManager.ComplimentaryPagingQuery(); info.sponsorID = parameters.id; info.index = parameters.index; return Response.AsJson(sponsorManager.getSponsorComplementaryList(info)); } catch { return null; } }; Get["/searchKeyCodes/{index:int}/{id:long}/{criteria}"] = parameters => { try { NancyService.Modules.SponsorManager.ComplimentaryPagingQuery info = new NancyService.Modules.SponsorManager.ComplimentaryPagingQuery(); info.sponsorID = parameters.id; info.index = parameters.index; string criteria = parameters.criteria; return Response.AsJson(sponsorManager.searchKeyCodes(info, criteria)); } catch { return null; } }; //--------------------------------------------Sponsor---------------------------- Get["/getSponsorDeadline/"] = parameters => { this.RequiresAuthentication(); this.RequiresAnyClaim(new[] { "sponsor", "admin", "Master", "Admin", "CommitteEvaluator" }); return Response.AsJson(sponsorManager.getSponsorDeadline()); }; Post["/addsponsor"] = parameters => { var sponsor = this.Bind<NancyService.Modules.SponsorManager.SponsorQuery>(); SponsorManager.SponsorQuery added = sponsorManager.addSponsor(sponsor); if (added != null) { return Response.AsJson(added); } else { return HttpStatusCode.Conflict; } }; Get["/getSponsorListIndex/{index:int}"] = parameters => { int index = parameters.index; return Response.AsJson(sponsorManager.getSponsorList(index)); }; Get["/getSponsorbyID/{id:long}"] = parameters => { try { this.RequiresAuthentication(); this.RequiresAnyClaim(new[] { "sponsor", "admin", "Master", "Admin", "CommitteEvaluator" }); long id = parameters.id; return Response.AsJson(sponsorManager.getSponsorbyID(id)); } catch { return null; } }; Put["/updateSponsor"] = parameters => { var sponsor = this.Bind<NancyService.Modules.SponsorManager.SponsorQuery>(); SponsorManager.SponsorQuery s = sponsorManager.updateSponsor(sponsor); if (s != null) { return Response.AsJson(s); } else { return HttpStatusCode.Conflict; } }; Get["/getSponsorTypesList"] = parameters => { try { //this.RequiresAuthentication(); //this.RequiresClaims(new[] { "admin" }); return Response.AsJson(sponsorManager.getSponsorTypesList()); } catch { return null; } }; Put["/deleteSponsor"] = parameters => { var id = this.Bind<long>(); if (sponsorManager.deleteSponsor(id)) { return HttpStatusCode.OK; } else { return HttpStatusCode.Conflict; } }; Get["/searchSponsors/{index:int}/{criteria}"] = parameters => { int index = parameters.index; string criteria = parameters.criteria; return Response.AsJson(sponsorManager.searchSponsors(index, criteria)); // }; /* ----- Topic -----(Heidi)*/ //get list of conference topics Get["/getTopic"] = parameters => { return Response.AsJson(topicManager.getTopicList()); }; //add a new topic Post["/addTopic"] = parameters => { var topic = this.Bind<topiccategory>(); return Response.AsJson(topicManager.addTopic(topic)); }; //update a new topic Put["/updateTopic"] = parameters => { var topic = this.Bind<topiccategory>(); return (topicManager.updateTopic(topic)); }; //delete topic Put["/deleteTopic/{topiccategoryID:int}"] = parameters => { return topicManager.deleteTopic(parameters.topiccategoryID); }; /* ----- Administrators -----(Heidi)*/ //check if there an email has account in ConferenceAdmin when adding a new evaluator Get["/getNewAdmin/{email}"] = parameters => { return adminManager.checkNewAdmin(parameters.email); }; //get list of administratos Get["/getAdministrators/{index:int}"] = parameters => { try { int index = parameters.index; return Response.AsJson(adminManager.getAdministratorList(index)); } catch { return null; } }; //get list of privileges in the system Get["/getPrivilegesList"] = parameters => { try { //this.RequiresAuthentication(); //this.RequiresClaims(new[] { "admin" }); return Response.AsJson(adminManager.getPrivilegesList()); } catch { return null; } }; //create a new administrator with a specified privilege Post["/addAdmin"] = parameters => { var newAdmin = this.Bind<AdministratorQuery>(); return Response.AsJson(adminManager.addAdmin(newAdmin)); }; //update an administrator Put["/editAdmin"] = parameters => { var editAdmin = this.Bind<AdministratorQuery>(); return Response.AsJson(adminManager.editAdministrator(editAdmin)); }; //remove administrator privileges to a user Put["/deleteAdmin"] = parameters => { var delAdmin = this.Bind<AdministratorQuery>(); return adminManager.deleteAdministrator(delAdmin); }; //search administrators that contain the search criteria Get["/searchAdmin/{index:int}/{criteria}"] = parameters => { int index = parameters.index; string criteria = parameters.criteria; return Response.AsJson(adminManager.searchAdministrators(index, criteria)); }; /*------ Evaluators -----(Heidi)*/ //get list of evaluators past applications Get["/getEvaluatorListFromIndex/{index:int}/{id:int}"] = parameters => { int index = parameters.index; int id = parameters.id; return Response.AsJson(evaluatorManager.getEvaluatorList(index, id)); }; //get pending list of evaluators Get["/getPendingListFromIndex/{index:int}"] = parameters => { int index = parameters.index; return Response.AsJson(evaluatorManager.getPendingList(index)); }; //check evaluator has an account in ConferenceAdmin Get["/getNewEvaluator/{email}"] = parameters => { return evaluatorManager.checkNewEvaluator(parameters.email); }; //add a new evaluator with status "Accepted" Post["/addEvaluator/{email}"] = parameters => { return evaluatorManager.addEvaluator(parameters.email); }; //update status of an evaluator application Put["/updateEvaluatorAcceptanceStatus"] = parameters => { var updateEvaluator = this.Bind<EvaluatorQuery>(); return (evaluatorManager.updateAcceptanceStatus(updateEvaluator)); }; //search evaluators that contain search criteria Get["/searchEvaluators/{index:int}/{criteria}"] = parameters => { int index = parameters.index; string criteria = parameters.criteria; return Response.AsJson(evaluatorManager.searchEvaluators(index, criteria)); }; /* --------------------------------------- Registration ----------------------------------------*/ Get["/getRegistrations/{index:int}"] = parameters => { int index = parameters.index; var list = registration.getRegistrationList(index); return Response.AsJson(list); }; Get["/getUserTypes"] = parameters => { List<UserTypeName> list = registration.getUserTypesList(); return Response.AsJson(list); }; Put["/updateRegistration"] = parameters => { var registeredUser = this.Bind<RegisteredUser>(); if (registration.updateRegistration(registeredUser)) return HttpStatusCode.OK; else return HttpStatusCode.Conflict; }; Delete["/deleteRegistration/{registrationID:int}"] = parameters => { if (registration.deleteRegistration(parameters.registrationID)) return HttpStatusCode.OK; else return HttpStatusCode.Conflict; }; Post["/addRegistration"] = parameters => { var user = this.Bind<user>(); var reg = this.Bind<registration>(); var mem = this.Bind<membership>(); return Response.AsJson(registration.addRegistration(reg: reg, user: user, mem: mem)); }; Get["/getDates"] = parameters => { List<string> list = registration.getDates(); return Response.AsJson(list); }; // [Randy] search within the list with a certain criteria Get["/searchRegistration/{index}/{criteria}"] = parameters => { int index = parameters.index; string criteria = parameters.criteria; var list = registration.searchRegistration(index, criteria); return Response.AsJson(list); }; Get["/getAttendanceReport"] = parameters => { return Response.AsJson(reportManager.getAttendanceReport()); }; //-------------------------------------GUESTS--------------------------------------------- //Jaimeiris - Guest list for admins Get["/getGuestList/{index:int}"] = parameters => { int index = parameters.index; GuestsPagingQuery guestList = guest.getListOfGuests(index); if (guestList == null) { guestList = new GuestsPagingQuery(); } return Response.AsJson(guestList); }; //Jaimeiris - update acceptance status of guest Put["/updateAcceptanceStatus"] = parameters => { var update = this.Bind<AcceptanceStatusInfo>(); int guestID = update.id; String acceptanceStatus = update.status; if (guest.updateAcceptanceStatus(guestID, acceptanceStatus)) return HttpStatusCode.OK; else return HttpStatusCode.Conflict; }; //Jaimeiris - set registration status of guest to Rejected. Put["/rejectRegisteredGuest/{id}"] = parameters => { int id = parameters.id; if (guest.rejectRegisteredGuest(id)) return HttpStatusCode.OK; else return HttpStatusCode.Conflict; }; //Jaimeiris - get minor's authorizations Get["/displayAuthorizations/{id}"] = parameters => { int id = parameters.id; List<MinorAuthorizations> authorizations = guest.getMinorAuthorizations(id); if (authorizations == null) { authorizations = new List<MinorAuthorizations>(); } return Response.AsJson(authorizations); }; // [Randy] search within the list with a certain criteria Get["/searchGuest/{index}/{criteria}"] = parameters => { int index = parameters.index; string criteria = parameters.criteria; var list = guest.searchGuest(index, criteria); return Response.AsJson(list); }; //-----------------------------------------WEBSITE CONTENT ----------------------------------[Heidi] //get content of the Home section of the website Get["/getHome"] = parameters => { return Response.AsJson(webManager.getHome()); }; //get image found in the Home section of the website Get["/getHomeImage"] = parameters => { return Response.AsJson(webManager.getHomeImage()); }; //get conference logo Get["/getWebsiteLogo"] = parameters => { return Response.AsJson(webManager.getWebsiteLogo()); }; //Update content found in the Home section of the website Put["/saveHome"] = parameters => { var home = this.Bind<HomeQuery>(); return webManager.saveHome(home); }; //remove an image from conference content Put["/removeFile/{data}"] = parameters => { return webManager.removeFile(parameters.data); }; //get content found in the Venue section of the website Get["/getVenue"] = parameters => { return Response.AsJson(webManager.getVenue()); }; //update content found in the Venue section of the website Put["/saveVenue"] = parameters => { var venue = this.Bind<VenueQuery>(); return webManager.saveVenue(venue); }; //get content found in the Contact section of the website Get["/getContact"] = parameters => { return Response.AsJson(webManager.getContact()); }; //update content found in the Contact section of the website Put["/saveContact"] = parameters => { var contact = this.Bind<ContactQuery>(); return webManager.saveContact(contact); }; //send inquire email Post["/sendContactEmail"] = parameters => { var emailInfo = this.Bind<ContactEmailQuery>(); return Response.AsJson(webManager.sendContactEmail(emailInfo)); }; //get content found in the Call for Participation section of the website Get["/getParticipation"] = parameters => { return Response.AsJson(webManager.getParticipation()); }; //update content found in the Call for Participation section of the website Put["/saveParticipation"] = parameters => { var participation = this.Bind<ParticipationQuery>(); return webManager.saveParticipation(participation); }; //get content found in the Registration section of the website and registration fees Get["/getRegistrationInfo"] = parameters => { return Response.AsJson(webManager.getRegistrationInfo()); }; //update content found in the Registration section of the website and registration fees Put["/saveRegistrationInfo"] = parameters => { var registrationInfo = this.Bind<RegistrationQuery>(); return webManager.saveRegistrationInfo(registrationInfo); }; //get conference deadlines Get["/getDeadlines"] = parameters => { return Response.AsJson(webManager.getDeadlines()); }; //get conference deadlines formatted to string: day of the week, day of the month, month and year Get["/getInterfaceDeadlines"] = parameters => { return Response.AsJson(webManager.getInterfaceDeadlines()); }; //update conference deadlines Put["/saveDeadlines"] = parameters => { var deadlines = this.Bind<DeadlinesQuery>(); return webManager.saveDeadlines(deadlines); }; //get content found in the Committee section of the website Get["/getCommitteeInterface"] = parameters => { return Response.AsJson(webManager.getCommittee()); }; //update content found in the Committee section of the website Put["/saveCommitteeInterface"] = parameters => { var info = this.Bind<CommitteeQuery>(); return webManager.saveCommittee(info); }; //get the benefits of a sponsor category Get["/getAdminSponsorBenefits/{data}"] = parameters => { return webManager.getAdminSponsorBenefits(parameters.data); }; //update benefits of a sponsor category Put["/saveAdminSponsorBenefits"] = parameters => { var sponsor = this.Bind<SaveSponsorQuery>(); return webManager.saveSponsorBenefits(sponsor); }; //update content found in the Sponsor section of the website Put["/saveInstructions"] = parameters => { var info = this.Bind<SponsorInterfaceBenefits>(); return webManager.saveInstructions(info); }; //get content found in the Sponsor section of the website Get["/getSponsorInstructions"] = parameters => { return Response.AsJson(webManager.getInstructions()); }; //get all benefits for each category (for website content) Get["/getAllSponsorBenefits"] = parameters => { return Response.AsJson(webManager.getAllSponsorBenefits()); }; //get conference general information: name, days Get["/getGeneralInfo"] = parameters => { return Response.AsJson(webManager.getGeneralInfo()); }; //update conference general information: name, days, logo Put["/saveGeneralInfo"] = parameters => { var info = this.Bind<GeneralInfoQuery>(); return webManager.saveGeneralInfo(info); }; //get documents found in the Program section of the website Get["/getProgram"] = parameters => { return Response.AsJson(webManager.getProgram()); }; //get abstract document Get["/getAbstractDocument"] = parameters => { return Response.AsJson(webManager.getAbstractDocument()); }; //get program document Get["/getProgramDocument"] = parameters => { return Response.AsJson(webManager.getProgramDocument()); }; //update documents found in the Program section of the website Put["/saveProgram"] = parameters => { var info = this.Bind<ProgramQuery>(); return webManager.saveProgram(info); }; //Get bill report including registrations and sponsor payments Get["/getBillReport"] = parameters => { return Response.AsJson(reportManager.getBillReportList()); }; //search records in the bill report that contain the search criterai Get["/searchReport/{index:int}/{criteria}"] = parameters => { int index = parameters.index; string criteria = parameters.criteria; return Response.AsJson(reportManager.searchReport(index, criteria)); }; //get conference registrations Get["/getRegistrationPayments/{index:int}"] = parameters => { int index = parameters.index; return Response.AsJson(reportManager.getRegistrationPayments(index)); }; //get sponsor payments Get["/getSponsorPayments/{index:int}"] = parameters => { int index = parameters.index; return Response.AsJson(reportManager.getSponsorPayments(index)); }; //-----------------SUBMISSIONS- JAIMEIRIS------------------------------------ //Jaimeiris - Gets all submissions in the system that have not been deleted Get["/getAllSubmissions/{index:int}"] = parameters => { int index = parameters.index; return Response.AsJson(submissionManager.getAllSubmissions(index)); }; //Jaimeiris - gets the evaluation for a submission Get["/getEvaluationsForSubmission/{submissionID}"] = parameters => { long submissionID = parameters.submissionID; var evaluations = submissionManager.getSubmissionEvaluations(submissionID); return Response.AsJson(evaluations); }; //Jaimeiris - gets all approved evaluators so as to assign them submissions to evaluate Get["/getAllEvaluators"] = parameters => { return Response.AsJson(submissionManager.getAcceptedEvaluators()); }; //Jaimeiris - Assigns an evaluator to a submission Post["/assignEvaluator/{submissionID:long}/{evaluatorID:long}"] = parameters => { long submissionID = parameters.submissionID; long evaluatorID = parameters.evaluatorID; Evaluation evList = submissionManager.assignEvaluator(submissionID, evaluatorID); return Response.AsJson(evList); }; //Jaimeiris - Assigns a template to a submission Post["/assignTemplate/{submissionID:long}/{templateID:long}"] = parameters => { long submissionID = parameters.submissionID; long templateID = parameters.templateID; if (submissionManager.assignTemplate(submissionID, templateID)) return HttpStatusCode.OK; else return HttpStatusCode.Conflict; }; //Jaimeiris - Get the info of an evaluation Get["/getEvaluationDetails/{submissionID:long}/{evaluatorID:long}"] = parameters => { long submissionID = parameters.submissionID; long evaluatorID = parameters.evaluatorID; Evaluation sub = submissionManager.getEvaluationDetails(submissionID, evaluatorID); if (sub == null) { sub = new Evaluation(); } return Response.AsJson(sub); }; //Jaimeiris - Remove evaluator submission relation Put["/removeEvaluatorSubmission/{evaluatorSubmissionID}"] = parameters => { long evaluatorSubmissionID = parameters.evaluatorSubmissionID; long es = submissionManager.removeEvaluatorSubmission(evaluatorSubmissionID); return Response.AsJson(es); }; //Jaimeiris - Change submission status Put["/changeSubmissionStatus/{status}/{submissionID}"] = parameters => { String newStatus = parameters.status; long submissionID = parameters.submissionID; Submission sub = submissionManager.changeSubmissionStatus(submissionID, newStatus); return Response.AsJson(sub); }; //Jaimeiris - admin adds a submission Post["/postAdminSubmission"] = parameters => { panel pannelToAdd = null; workshop workshopToAdd = null; submission submissionToAdd = this.Bind<submission>(); usersubmission usersubTA = this.Bind<usersubmission>(); int submissionTypeID = submissionToAdd.submissionTypeID; if (submissionTypeID == 3) { pannelToAdd = this.Bind<panel>(); } else if (submissionTypeID == 5) { workshopToAdd = this.Bind<workshop>(); } Submission newSubmission = submissionManager.addSubmissionByAdmin(usersubTA, submissionToAdd, pannelToAdd, workshopToAdd); return Response.AsJson(newSubmission); }; //Jaimeiris - post final version of evaluation submitted by admin Post["/postAdminFinalSubmission"] = parameters => { panel pannelToAdd = null; workshop workshopToAdd = null; submission submissionToAdd = this.Bind<submission>(); documentssubmitted submissionDocuments = this.Bind<documentssubmitted>(); usersubmission usersubTA = this.Bind<usersubmission>(); int submissionTypeID = submissionToAdd.submissionTypeID; if (submissionDocuments.document == null && submissionDocuments.documentName == null) { submissionDocuments = null; } if (submissionTypeID == 3) { pannelToAdd = this.Bind<panel>(); } else if (submissionTypeID == 5) { workshopToAdd = this.Bind<workshop>(); } Submission newSubmission = submissionManager.postAdminFinalSubmission(usersubTA, submissionToAdd, submissionDocuments, pannelToAdd, workshopToAdd); return Response.AsJson(newSubmission); }; //Jaimeiris - gets all deleted submissions Get["/getDeletedSubmissions/{index:int}"] = parameters => { int index = parameters.index; return Response.AsJson(submissionManager.getDeletedSubmissions(index)); }; //Jaimeiris - gets the details of a deleted submission Get["/getADeletedSubmission/{submissionID:long}"] = parameters => { long submissionID = parameters.submissionID; return Response.AsJson(submissionManager.getADeletedSubmission(submissionID)); }; //Jaimeiris - gets the list of all users Get["/getListOfUsers"] = parameters => { return Response.AsJson(submissionManager.getListOfUsers()); }; //Jaimeiris - returns true is the currently logged in user is the master Get["/isMaster/{userID:long}"] = parameters => { long userID = parameters.userID; bool isMaster = submissionManager.isMaster(userID); return isMaster; }; // [Randy] search within the list with a certain criteria Get["/searchSubmission/{index}/{criteria}"] = parameters => { int index = parameters.index; string criteria = parameters.criteria; var list = submissionManager.searchSubmission(index, criteria); return Response.AsJson(list); }; // [Randy] search within the list with a certain criteria Get["/searchDeletedSubmission/{index}/{criteria}"] = parameters => { int index = parameters.index; string criteria = parameters.criteria; var list = submissionManager.searchDeletedSubmission(index, criteria); return Response.AsJson(list); }; //Jaimeiris - Gets the file for the submission with submissionID Get["/getSubmissionFile/{fileID}"] = parameters => { int fileID = parameters.fileID; return Response.AsJson(submissionManager.getSubmissionFile(fileID)); }; //Jaimeiris - get submission report Get["/getSubmissionsReport"] = parameters => { return Response.AsJson(reportManager.getSubmissionsReport()); }; //Jaimeiris-get templates list Get["/getTemplates"] = parameters => { return Response.AsJson(submissionManager.getTemplates()); }; //------------------------------------Banner--------------------------------------------- Get["/getBanners/{index:int}/{sponsor}"] = parameters => { int index = parameters.index; String sponsor = parameters.sponsor; return Response.AsJson(bannerManager.getBannerList(sponsor, index)); }; }
private void Initiate(object sender,EventArgs e) { if (this.Tag == "UserInformation") { this.listViewUserInformation.ContextMenuStrip = this.contextMenuStrip; this.listViewUserInformation.Clear(); this.listViewUserInformation.View = View.Details; this.listViewUserInformation.GridLines = true; this.listViewUserInformation.Columns.Add("用户名", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("姓名", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("性别", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("电话", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("权限", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("职位", listViewUserInformation.Width / 6, HorizontalAlignment.Center); ArrayList users = new UserManager().GetAllUsers(MainForm.LoadedUser ); foreach (User u in users) { ListViewItem lvi = new ListViewItem(); lvi.Text = u.RegisteredName; lvi.SubItems.Add(u.Name); lvi.SubItems.Add(u.Sex ); lvi.SubItems.Add(u.Telephone ); lvi.SubItems.Add(Convert.ToString(u.Privilege )); lvi.SubItems.Add(u.Position ); listViewUserInformation.Items.Add(lvi); } } else if (this.Tag == "GuestRecord") { this.Text = "客户记录"; this.listViewUserInformation.Clear(); this.listViewUserInformation.View = View.Details; this.listViewUserInformation.GridLines = true; this.listViewUserInformation.Columns.Add("姓名", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("房间", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("性别", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("身份证", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("入住时间", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("退房时间", listViewUserInformation.Width / 6, HorizontalAlignment.Center); this.listViewUserInformation.Columns.Add("消费", listViewUserInformation.Width / 6, HorizontalAlignment.Center); ArrayList guests = new GuestManager().GetAllRecords(); foreach(Guest g in guests ) { ListViewItem lvi = new ListViewItem(); lvi.Text = g.Name ; lvi.SubItems.Add(g.Room ); lvi.SubItems.Add(g.Sex ); lvi.SubItems.Add(g.Id ); lvi.SubItems.Add(Convert.ToString(g.InTime )); lvi.SubItems.Add(Convert.ToString(g.OutTime )); lvi.SubItems.Add(g.Payment.ToString()); listViewUserInformation.Items.Add(lvi); } } }
public int _numOrder; //order of appearing void Start () { _guestManager = this.GetComponentInParent<GuestManager>(); }