コード例 #1
0
        static void Main(string[] args)
        {
            var mongo      = new MongoConnection();
            var rethink    = new RethinkConnection();
            var eventStore = new EventConnection();

            var system   = ActorSystem.Create("baseballStats");
            var topLevel = system.ActorOf(GameEventCoordinator.Create(), "gameCoordinator");

            var handler = new PlayHandler(topLevel);


            ReqlExpr dbTable = RethinkDB.R.Db("baseball").Table("plays");

            var feed = dbTable.Changes()
                       .RunChanges <Play>(RethinkConnection.Connection /*, new { include_initial = true }*/);

            var observe = feed.ToObservable();

            observe.SubscribeOn(CurrentThreadScheduler.Instance)
            .Subscribe((Change <Play> p) =>
            {
                handler.Handle(p.NewValue);
            });



            Console.WriteLine("Hit enter to exit...");
            Console.ReadLine();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["EVENTPOSTER"] == null)
            {
                Response.Redirect("~/Web/Account/tempLogin.aspx?page=Users/EventPoster/ManageEvents.aspx");
            }

            if (Request.QueryString["editId"] == null)
            {
                Response.Redirect("~/Web/Account/tempLogin.aspx?page=Users/EventPoster/ManageEvents.aspx");
            }
            EventConnection connection = new EventConnection();

            if (IsPostBack)
            {
            }
            else
            {
                int eventId = Convert.ToInt32(Request.QueryString["editId"].ToString());

                MyEvent myEvent = connection.getEventById(eventId);

                txtAddress.Text     = myEvent.Location;
                txtDate.Text        = myEvent.Date.ToShortDateString();
                txtDescription.Text = myEvent.Description;
                txtName.Text        = myEvent.Name;
                txtPrice.Text       = myEvent.EntryFee.ToString();
                txtText.Text        = myEvent.University;
                //}
            }
        }
コード例 #3
0
        public bool AddComment(int eventId, string comment)
        {
            try
            {
                if (string.IsNullOrEmpty(comment))
                {
                    return(false);
                }

                int userId = (int)Session["UserId"];
                AddCommentRequest request = new AddCommentRequest()
                {
                    UserId  = userId,
                    EventId = eventId,
                    Comment = comment
                };

                EventConnection conn = new EventConnection();
                conn.AddComment(request);

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
コード例 #4
0
        public JsonResult GetEventComments(int eventId)
        {
            EventConnection          conn     = new EventConnection();
            List <EventComments>     response = conn.GetCommentsForEvent(eventId);
            List <EventCommentModel> comments = ConvertEventComments(response, eventId);

            return(Json(comments));
        }
コード例 #5
0
    public virtual EventConnection Connect(int priority, LocalEventHandler handler)
    {
        var connection = new EventConnection(this, handler, priority);

        subscriptions.Add(connection);
        subscriptions.Sort((a, b) => a.Priority - b.Priority);
        return(connection);
    }
コード例 #6
0
        public ActionResult AddEvent(CreateEventModel model)
        {
            SaveEventRequest request = PrepareSaveEventRequest(model);
            EventConnection  conn    = new EventConnection();

            conn.SaveEvent(request);

            return(RedirectToAction("Home"));
        }
コード例 #7
0
        //
        //participants specific variables
        //

        public EventTournamentManagement()
        {
            WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            InitializeComponent();
            eventConnection      = new EventConnection();
            tournamentConnection = new TournamentConnection();

            initialize();
        }
コード例 #8
0
        //constructor pou pernei san orisma tin imerominia pou tou exei perastei apo to main
        public EventTournamentManagement(DateTime dateSelection)
        {
            WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            InitializeComponent();
            eventConnection      = new EventConnection();
            tournamentConnection = new TournamentConnection();
            initialize();

            this.eventDate.SelectedDate = dateSelection;
        }
コード例 #9
0
        public async static void WhiteBoxAppTest_EventConnection_UrlToHtml()
        {
            Uri    address     = new Uri("https://www.google.com");        //URI to send to method
            string testAddress = await EventConnection.UrlToHtml(address); //Sending uri to method

            UriKind expectedAddress = new UriKind();                       //URI kind for TryCreate
            Uri     uriTest;                                               //Result of Uri.TryCreate

            Assert.IsTrue(Uri.TryCreate(testAddress, expectedAddress, out uriTest));
            // If the address can be created using the testAddress from UrlToHtml
        }
コード例 #10
0
        public PartialViewResult FilterEvents(int eventType)
        {
            HomeModel model = new HomeModel();

            model.Events = new List <EventModel>();
            EventConnection eventConnection = new EventConnection();
            List <Events>   events          = eventConnection.GetEvents(eventType);

            model.Events = ConvertEvents(events);
            return(PartialView("_Events", model));
        }
コード例 #11
0
ファイル: Home.aspx.cs プロジェクト: ThabangSirrve/Qaelo
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["EVENTPOSTER"] == null)
            {
                Response.Redirect("~/Web/Account/tempLogin.aspx");
            }

            EventConnection connection = new EventConnection();

            Qaelo.Models.EventPosterModel.EventPoster poster = (Qaelo.Models.EventPosterModel.EventPoster)Session["EVENTPOSTER"];

            //Load all the id's of the students who liked an event
            string     html     = "";
            List <int> eventIds = connection.getListOfEventIds(poster.Id);

            //Load all the Students
            foreach (int id in eventIds)
            {
                List <int> userIds = connection.getListOfStudentIds(id);
                MyEvent    myEvent = connection.getEventById(id);

                if (userIds.Count > 0)
                {
                    html += string.Format(@"<h3 align='center'><a href='ManageEvents.aspx'>List of users who like {0} event</a></h3>
                                <table class='table responsive table-striped table-bordered' cellspacing='0' width='100%'>
                               <thead>
                              <tr>
                                <th>Profile</th>
                                <th>Name</th>
                                <th>Email</th>
                                <th>Number</th>
                              </tr>
                            </thead><tbody>", myEvent.Name);
                    foreach (int userId in userIds)
                    {
                        Qaelo.Models.StudentModel.Student s = connection.getStudent(userId);
                        html += string.Format(@"
                                            <tr>
                                            <td><img src='../../../Images/Users/Students/{0}' class='img-thumbnail' width='50' height='50' /></td>
                                            <td>{1}</td>
                                            <td>{2}</td>
                                            <td>{3}</td>
                                          </tr>", s.ProfileImage, s.FirstName + " " + s.LastName, s.Email, s.Number, myEvent.Name);
                    }

                    html += "</tbody></table><br/>";
                }
            }

            //if (html == "") html = "<div class='alert alert-warning'><h4>I'ts Empty here, Data will soon be available as soon as your events get interaction</div></h4>";

            lblListOfUsers.Text = html;
        }
コード例 #12
0
        public EventConnection GetOrCreateEventConnection(GroupableNode sourceNode, GroupableNode targetNode)
        {
            var eventConnection = this.FindConnection(sourceNode, targetNode) as EventConnection;

            if (eventConnection == null)
            {
                eventConnection = new EventConnection(sourceNode, targetNode);
                this.Connections.Add(eventConnection);
            }

            return(eventConnection);
        }
コード例 #13
0
 public bool EditComment(int commentId, string editedComment)
 {
     try
     {
         EventConnection conn = new EventConnection();
         conn.EditComment(commentId, editedComment);
     }
     catch (Exception ex)
     {
         return(false);
     }
     return(true);
 }
コード例 #14
0
 public bool DeleteComment(int commentId)
 {
     try
     {
         EventConnection conn = new EventConnection();
         conn.DeleteComment(commentId);
     }
     catch (Exception ex)
     {
         return(false);
     }
     return(true);
 }
コード例 #15
0
        public ActionResult Home()
        {
            HomeModel model = new HomeModel();

            model.Events = new List <EventModel>();
            EventConnection eventConnection = new EventConnection();
            List <Events>   events          = eventConnection.GetEvents(0);

            model.Events = ConvertEvents(events);
            List <EventTypeResponse> eventTypes = eventConnection.GetEventTypes();

            model.EventTypes = ConvertEventTypeResponse(eventTypes);
            return(View(model));
        }
コード例 #16
0
 /// <summary>
 /// Оборачивает <paramref name="connection"/> в модель
 /// </summary>
 /// <param name="connection"></param>
 /// <returns></returns>
 public static EventConnectionModel GetConnectionModel(EventConnection connection)
 {
     return(connection != null ? new EventConnectionModel
     {
         Id = connection.Id,
         id_ConnectionType = connection.id_ConnectionType,
         id_Event = connection.id_Event,
         id_Person = connection.id_Person,
         id_EventConnectTo = connection.id_EventConnectTo,
         Person = PersonModelHelper.GetPersonModel(connection.Person),
         Event = GetEventModel(connection.Event),
         Description = connection.Description,
         EventConnectionType = connection.ConnectionType?.Name
     } : new EventConnectionModel());
 }
コード例 #17
0
        public async void WhiteBoxTest_EventPage_EventPage()
        {
            EventPage eventPage = new EventPage();

            Events events = await EventConnection.GetEventData();

            await Task.Delay(10000);

            Assert.IsTrue(events.EventSet[0].EventDescription == eventPage.temp.EventSet[0].EventDescription);
            Assert.IsTrue(events.EventSet[0].EventDate == eventPage.temp.EventSet[0].EventDate);
            Assert.IsTrue(events.EventSet[0].EventId == eventPage.temp.EventSet[0].EventId);
            Assert.IsTrue(events.EventSet[0].EventTopic == eventPage.temp.EventSet[0].EventTopic);
            Assert.IsTrue(events.EventSet[0].EventImg == eventPage.temp.EventSet[0].EventImg);
            Assert.IsTrue(events.EventSet[0].EventLocation == eventPage.temp.EventSet[0].EventLocation);
            Assert.IsTrue(events.EventSet[0].EventSignUpUrl == eventPage.temp.EventSet[0].EventSignUpUrl);
        }
コード例 #18
0
        public ActionResult CreateEvent()
        {
            ViewBag.Title = "Create Event";

            CreateEventModel model = new CreateEventModel();

            UniversityConnection conn  = new UniversityConnection();
            EventConnection      econn = new EventConnection();

            List <UniversityResponse>    response1 = conn.GetAllUniversities();
            List <EventCategoryResponse> response2 = econn.GetEventCategories();
            List <EventTypeResponse>     response3 = econn.GetEventTypes();

            model.Universities    = ConvertUniversityResponse(response1);
            model.EventCategories = ConvertEventCategoryResponse(response2);
            model.EventTypes      = ConvertEventTypeResponse(response3);

            return(View(model));
        }
コード例 #19
0
 /// <see cref="IEventRepository.SaveConnection" />
 public EventConnection SaveConnection(EventConnection connection, int userId)
 {
     if (connection.Id == 0)
     {
         db.Entry(connection).State = System.Data.Entity.EntityState.Added;
     }
     else if (connection.Id > 0)
     {
         var pr = db.EventConnections.FirstOrDefault(o => o.Id == connection.Id);
         SaveLog(pr, connection, connection.id_Event, userId, LogType.Connection);
         db.Entry(pr).CurrentValues.SetValues(connection);
     }
     try
     {
         db.SaveChanges();
     }
     catch (Exception e)
     {
         return(null);
     }
     return(connection);
 }
コード例 #20
0
        public void AddConnection(ScriptObject From, ScriptObject FromCommand, string ToTag)
        {
            var connection = new EventConnection();

            connection.From        = From;
            connection.FromCommand = FromCommand;
            connection.ToTag       = ToTag;
            if (ToTag == null)
            {
                return;
            }

            if (FromMap.ContainsKey(connection.From.Name))
            {
                FromMap[connection.From.Name].Add(connection);
            }
            else
            {
                FromMap[connection.From.Name] = new List <EventConnection>()
                {
                    connection
                }
            };

            if (ToMap.ContainsKey(connection.ToTag))
            {
                ToMap[connection.ToTag].Add(connection);
            }
            else
            {
                ToMap[connection.ToTag] = new List <EventConnection>()
                {
                    connection
                }
            };
        }
コード例 #21
0
 public void SetGateway(EventConnection gateway)
 {
     this.Handler        = gateway.API.RestHandler;
     this.Authentication = gateway.Authentication;
     this.IsGateway      = true;
 }
コード例 #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["ADMIN"] == null)
            {
                Response.Redirect("~/Web/Account/tempLogin.aspx?");
            }

            //Remove users from the system
            if (Request.QueryString["student"] != null)
            {
                new StudentConnection().deleteStudent(Convert.ToInt32(Request.QueryString["student"]));
            }
            else if (Request.QueryString["shop"] != null)
            {
                new ShopConnection().deleteShoProfile(Convert.ToInt32(Request.QueryString["shop"]));
            }
            else if (Request.QueryString["accommodation"] != null)
            {
                new ManagerConnection().deletedManager(Convert.ToInt32(Request.QueryString["accommodation"]));
            }
            else if (Request.QueryString["society"] != null)
            {
                new SocietyConnection().deleteProfile(Convert.ToInt32(Request.QueryString["society"]));
            }
            else if (Request.QueryString["event"] != null)
            {
                new EventConnection().deleteEventPoster(Convert.ToInt32(Request.QueryString["event"]));
            }

            /** Students **/

            List <Qaelo.Models.StudentModel.Student> students = new StudentConnection().getAllStudents();

            lblNumOfStudents.Text = students.Count.ToString();
            //Load students
            foreach (Qaelo.Models.StudentModel.Student item in students)
            {
                if (item != null)
                {
                    lblStudents.Text += string.Format(@"<tr>
                                                    <td>{0}</td>
                                                    <td>{1}</td>
                                                    <td>{2}</td>
                                                    <td>{3}</td>
                                                    <td>{4}</td>
                                                    <td><a href='ListOfUsers.aspx?student={5}' class='btn btn-danger'>Remove</a></td>
                                                    ", item.FirstName + " " + item.LastName, item.Email, item.Number, item.Institution, General.getDateString(item.RegistrationDate), item.Id);
                }
            }

            /** Shop Owners **/

            List <Qaelo.Models.ShopOwnerModel.ShopOwner> shops = new ShopConnection().getAllShopOwners();

            lblNumOfShopOwner.Text = shops.Count.ToString();

            foreach (Qaelo.Models.ShopOwnerModel.ShopOwner item in shops)
            {
                if (item == null)
                {
                    lblShops.Text += string.Format(@"<tr>
                                                    <td>{0}</td>
                                                    <td>{1}</td>
                                                    <td>{2}</td>
                                                    <td>{3}</td>
                                                    <td><a href='ListOfUsers.aspx?shop={4}' class='btn btn-danger'>Remove</a></td>
                                                    ", item.FullName, item.Email, item.Number, General.getDateString(item.RegistrationDate), item.Id);
                }
            }

            /**Event Posters **/
            List <Qaelo.Models.EventPosterModel.EventPoster> posters = new EventConnection().getAllPosters();

            lblNumOfEventPosters.Text = posters.Count.ToString();

            foreach (Qaelo.Models.EventPosterModel.EventPoster item in posters)
            {
                if (item != null)
                {
                    lblEventPosters.Text += string.Format(@"<tr>
                                                    <td>{0}</td>
                                                    <td>{1}</td>
                                                    <td>{2}</td>
                                                    <td>{3}</td>
                                                    <td><a href='ListOfUsers.aspx?event={4}' class='btn btn-danger'>Remove</a></td>
                                                    ", item.FullName, item.Email, item.Number, General.getDateString(item.RegistrationDate), item.Id);
                }
            }

            /*** Porperty Owner **/
            List <Qaelo.Models.AccommodationModel.Manager> managers = new ManagerConnection().getAllManagers();

            lblNumOfPorpertyOwners.Text = managers.Count.ToString();



            foreach (Qaelo.Models.AccommodationModel.Manager item in managers)
            {
                if (item != null)
                {
                    lblAccommodations.Text += string.Format(@"<tr>
                                                    <td>{0}</td>
                                                    <td>{1}</td>
                                                    <td>{2}</td>
                                                    <td>{3}</td>
                                                    <td><a href='ListOfUsers.aspx?accommodation={4}' class='btn btn-danger'>Remove</a></td>
                                                     ", item.firstName + " " + item.lastName, item.email, item.number, General.getDateString(item.registrationDate), item.id);
                }
            }
        }
コード例 #23
0
        protected void btnFinish_Click(object sender, EventArgs e)
        {
            if (txtText.Text.Equals("") || txtAddress.Equals("") || txtDescription.Text.Equals("") || txtName.Text.Equals("") || txtPrice.Text.Equals(""))
            {
                lblErrorMessage.Text = "All fields are required";
                return;
            }

            //Get the event
            EventConnection connection = new EventConnection();

            Qaelo.Models.EventPosterModel.EventPoster poster  = (Qaelo.Models.EventPosterModel.EventPoster)Session["EVENTPOSTER"];
            Qaelo.Models.EventPosterModel.MyEvent     myEvent = connection.getEventById(Convert.ToInt32(Request.QueryString["editId"].ToString()));

            string filename1    = "";
            bool   uploadStatus = true;

            //Check if the files have something
            if (fu1.HasFile)
            {
                try
                {
                    filename1 = poster.Id + Path.GetFileName(fu1.FileName);
                    fu1.SaveAs(Server.MapPath("~/Images/Events/") + filename1);
                }
                catch (Exception ex)
                {
                    lblErrorMessage.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
                    uploadStatus         = false;
                }
            }
            else
            {
                filename1 = myEvent.Image;
            }

            if (uploadStatus)
            {
                DateTime eventDate = myEvent.Date;

                if (!txtDate.Text.Equals(""))
                {
                    eventDate = Convert.ToDateTime(txtDate.Text);
                }

                //Upload shop
                if (connection.updateEvent(new Models.EventPosterModel.MyEvent(myEvent.Id, poster.Id, "", eventDate, myEvent.DatePosted, txtDescription.Text, Convert.ToDouble(txtPrice.Text), filename1, txtAddress.Text, txtName.Text, txtText.Text)))
                {
                    lblSuccess.Text = "You have successfully Edited " + txtName.Text + " event";
                    Response.Redirect("ManageEvents.aspx");
                }
                else
                {
                    lblErrorMessage.Text = "Sorry an error occured while editing your event, please try again";
                }
            }
            else
            {
                lblErrorMessage.Text = "Sorry an error occured while editing your event, please upload image again";
            }
        }
コード例 #24
0
 public void SetGateway(EventConnection gateway)
 {
     Handler        = gateway.API.RestHandler;
     Authentication = gateway.Authentication;
 }
コード例 #25
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            EventConnection connection = new EventConnection();
            string          html       = "";

            List <MyEvent> events = connection.getAllEventsByUniversity(txtText.Text);

            foreach (MyEvent item in events)
            {
                if (item != null)
                {
                    if (new EventConnection().isPosterVerified(item.EventPosterId))
                    {
                        string price = " Free";

                        if (item.EntryFee > 0)
                        {
                            price = item.EntryFee.ToString();
                        }

                        html += string.Format(@"<div class='col-lg-3'>
                  <div class='thumbnail'>
                  <div class='w3-card-12'>
                      <img src = '../../../Images/Events/{0}' class='' style='height:220px;width:100%' />
                    <div class='w3-container' style='margin:10px'>
                        <h6><b>{6}-<small style = 'font-size:12px' > {1}</small></b></h6>
                        <small><cite title = '' ><i class='glyphicon glyphicon-map-marker'>
                           </i> <a href='https://maps.google.com/?q={2}' target='_blank'>{2}</a></cite></small>
                      <p>{3}</p></a>
                        <strong>Entry Fee :{4}
                                <a href='#event{5}' data-toggle='modal' class='btn btn-default pull-right'>View</a>
                            </strong>
                    </div><br />
                    </div>
                  </div>
                 </div>", item.Image, General.getDateString(item.Date), item.Location, "", price, item.Id, item.Name);



                        //Add view for event
                        //Get Event Manager details
                        Qaelo.Models.EventPosterModel.EventPoster poster = new EventConnection().getPoster(item.EventPosterId);
                        TicketModel ticket = new EventConnection().getTicketById(item.Id);


                        //Ticket information
                        string ticketInformation = "";

                        if (ticket != null)
                        {
                            string priceDescription = "- " + ticket.PriceDescription.Replace(char.ConvertFromUtf32(13), "<br/> -");
                            string howToPay         = string.Format(@"<p>- Bank Name :{0}</p>
                                <p>- Account Holder :{1}</p>
                                <p>- Account No: {2}</p>
                                <p>- Branch Code: {3}</p>
                                <p>- Reference : {4}</p>", ticket.BankName, ticket.AccountHolder, ticket.AccountNo, ticket.BranchCode, ticket.reference);

                            ticketInformation = string.Format(@"<div class='col-sm-12'>
                                        <br />
                                        <h4>Ticket Price(s)</h4>
                                        <p> {0}</p>

                                        <br />
                                        <h4>How To Pay</h4>
                                        <p> {1}</p>
                                    </div>", priceDescription, howToPay);
                        }

                        lblEvent.Text += string.Format(@"<div class='modal fade' id='event{0}' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
                        <div class='modal-dialog modal-lg'>
                        <div class='modal-content'>

                            <div class='modal-header' style='background-color:mediumvioletred;margin-bottom:8px'>
                                <div class='container-fluid'>
                                    <div class='col-sm-12'>
                                        <div style='color:white'> {1} - {2}
                                        <a href='https://maps.google.com/?q={3}' target='_blank' class='pull-right' style='color:white;margin-top:-5px'><img src='../../../getDirections.png'  style='height:32px;width:32px;color:dodgerblue'/></a> 
                                        <span class='pull-right'>Get Directions</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                                   
                            <div class='modal-body'>
                                <div class='row'>
                                    <div class='col-lg-12' style='margin:20px'>
                                        <div class='col-lg-6'>
                                            <img src='../../../Images/Events/{4}' class='img-thumbnail' style='height:250px;width:100%'  />
                                        </div>

                                        <div class='col-lg-6'>
                                            <h4>Event Name</h4>
                                            <p>{1}</p>
                                            <br />
                                            <h4>Date</h4>
                                            <p>{2}</p>
                                            <br />
                                            <h4>For More info, Contact:</h4>
                                            <p> 
                                             <strong>Name :</strong>{5}<br />
                                             <strong>Call :</strong>{6}<br />
                                             <strong>Email:</strong>{7}<br />
                                            </p>
                                            <br/><strong>Price:</strong>{8}
                                        </div>
                                    
                                        </div>

                                    <div class='col-lg-12'>
                                         <br/><h4>Description</h4>
                                            <p>{9}</p>
                                    </div>

                                    {10} <!-- Ticket information -->

                                </div>
                                    </div>
                                   
                            <div class='modal-footer'>
                                        <button  class='btn btn-danger pull-right' data-dismiss='modal'>Back</button>
                                    </div>
                                </div>
                              </div>
                             </div>", item.Id, item.Name, General.getDateString(item.Date), item.Location, item.Image, poster.FullName, poster.Number, poster.Email, item.EntryFee, item.Description, ticketInformation);
                    }//End of Verification
                }
            }


            //if (html == "")
            //{
            //    html = "<div class='alert alert-info'><h3>Currently there are no events at the moment</h3></div>";
            //}

            listOfEvents.Text = html;
        }
コード例 #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["EVENTPOSTER"] == null)
            {
                Response.Redirect("~/Web/Account/tempLogin.aspx?page=Users/EventPoster/ManageEvents.aspx");
            }

            EventConnection connection = new EventConnection();

            Qaelo.Models.EventPosterModel.EventPoster poster = (Qaelo.Models.EventPosterModel.EventPoster)Session["EVENTPOSTER"];

            //check delete Event
            if (Request.QueryString["delId"] != null)
            {
                if (connection.deleteEvent(Convert.ToInt32(Request.QueryString["delId"].ToString()), poster.Id))
                {
                    lblSuccess.Text = "Event has been deleted successfuly";
                }
                else
                {
                    lblErrorMessage.Text = "An error occurred while deleting event please try again";
                }
            }

            //Chekck if its from sell ticket event page
            if (Request.QueryString["page"] != null)
            {
                if (Request.QueryString["page"].ToString() == "sellTicket")
                {
                    lblSuccess.Text = "Successfully Added ticket information";
                }
            }
            //Load all events
            List <MyEvent> events = connection.getAllMyEvents(poster.Id);

            string html = "";

            foreach (MyEvent item in events)
            {
                string price = " Free";

                if (item.EntryFee > 0)
                {
                    price = " R" + item.EntryFee.ToString();
                }
                //Check if the event was liked
                string description = item.Description;

                if (description.Length > 45)
                {
                    description = description.Substring(0, 45) + "...";
                }

                html += string.Format(@"<div class='col-lg-4'>
                  <div class='thumbnail'>
                  <div class='w3-card-12'>
                      <img src = '../../../Images/Events/{0}' class='' style='height:220px;width:100%' />
                    <div class='w3-container' style='margin:10px'>
                        <h6><b>{6}-<small style = 'font-size:12px'> {1}</small></b></h6>
                        <small><cite title = '' ><i class='glyphicon glyphicon-map-marker'>
                           </i> {2}</cite></small>
                      <p>{3}</p>
                        <strong>Entry Fee :{4}     
                        </a></strong><br/>
                        <p>
                            <a href='ManageEvents.aspx?delId={5}' class='btn btn-danger pull-left'> Delete</a>
                            <a href='EditEvent.aspx?editId={5}' class='btn btn-info pull-right'> Edit</a>
                        </p>
                    </div><br /><br />
                    </div>
                  </div>
                 </div>", item.Image, General.getDateString(item.Date), item.Location, description, price, item.Id, item.Name);
            }
            listOfEvents.Text = html;
        }
コード例 #27
0
        public async static void WhiteBoxTest_EventConnection_GetEventData()
        {
            Events events = await EventConnection.GetEventData();

            Assert.True("Topic: To be announced" == events.EventSet[0].EventTopic);
        }
コード例 #28
0
        private void initialize()
        {
            addressConnection  = new AddressConnection();
            locationConnection = new LocationConnection();
            //cities kai countries
            cityConnection    = new CityConnection();
            countryConnection = new CountryConnection();
            this.countries    = countryConnection.GetCountries();

            foreach (DataRow dr in countries.Tables[0].Rows)
            {
                cmbECountryChooses.Items.Add(dr[1].ToString());
            }
            cmbECountryChooses.SelectedIndex = 0;

            this.eventUpdateCities("CY");


            //events
            eventConnection = new EventConnection();
            this.events     = eventConnection.getEvents();
            cmbTEventChooser.Items.Add("Select Event");

            foreach (DataRow dr in events.Tables[0].Rows)
            {
                cmbTEventChooser.Items.Add(dr[1].ToString());
            }
            cmbTEventChooser.SelectedIndex = 0;

            //ages
            cmbTAgeFrom.Items.Add("From");
            cmbTAgeTo.Items.Add("To");
            for (int i = 5; i <= 60; i++)
            {
                cmbTAgeFrom.Items.Add(i.ToString());
                cmbTAgeTo.Items.Add(i.ToString());
            }
            cmbTAgeFrom.SelectedIndex = 0;
            cmbTAgeTo.SelectedIndex   = 0;

            //levels
            cmbTLevelFrom.Items.Add("From");
            cmbTLevelFrom.Items.Add("A");
            cmbTLevelFrom.Items.Add("B");
            cmbTLevelFrom.Items.Add("C");
            cmbTLevelFrom.Items.Add("D");

            cmbTLevelTo.Items.Add("To");
            cmbTLevelTo.Items.Add("A");
            cmbTLevelTo.Items.Add("B");
            cmbTLevelTo.Items.Add("C");
            cmbTLevelTo.Items.Add("D");

            cmbTLevelFrom.SelectedIndex = 0;
            cmbTLevelTo.SelectedIndex   = 0;


            //games
            cmbTGame.Items.Add("Select game type");
            cmbTGame.Items.Add("Game A");
            cmbTGame.Items.Add("Game B");
            cmbTGame.Items.Add("Game C");
            cmbTGame.Items.Add("Game D");
            cmbTGame.Items.Add("Game E");

            cmbTGame.SelectedIndex = 0;
        }
コード例 #29
0
 public void SetGateway(EventConnection jsonConnection)
 {
     this.Handler        = jsonConnection.API.RestHandler;
     this.Authentication = jsonConnection.Authentication;
 }
コード例 #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Load event
            Qaelo.Models.StudentModel.Student student = (Qaelo.Models.StudentModel.Student)Session["STUDENT"];

            if (Request.QueryString["eventId"] != null)
            {
                EventConnection connecton = new EventConnection();

                //Like and unlike
                if (student != null)
                {
                    if (Request.QueryString["like"] != null)
                    {
                        connecton.likeEvent(Convert.ToInt32(Request.QueryString["like"].ToString()), student.Id);
                    }
                    else if (Request.QueryString["unlike"] != null)
                    {
                        connecton.unlikeEvent(Convert.ToInt32(Request.QueryString["unlike"].ToString()), student.Id);
                    }
                }
                else
                {
                    if (Request.QueryString["like"] != null)
                    {
                        Response.Redirect("~/Web/Account/tempLogin.aspx");
                    }
                }

                int     eventId = Convert.ToInt32(Request.QueryString["eventId"]);
                MyEvent myEvent = connecton.getEventById(eventId);

                if (myEvent == null)
                {
                    return;
                }

                if (student != null)
                {
                    if (connecton.eventLikedByUser(myEvent.Id, student.Id))
                    {
                        lblPanelTopic.Text = string.Format(@"{0} - {1}<a href='students-event.aspx?unlike={2} &eventId={2}' class='btn btn-danger btn-xs pull-right'>Liked</a>", myEvent.Name, myEvent.Location, myEvent.Id);
                    }
                    else
                    {
                        lblPanelTopic.Text = string.Format(@"{0} - {1}<a href='students-event.aspx?like={2} &eventId={2}' class='btn btn-primary btn-xs pull-right'>Like</a>", myEvent.Name, myEvent.Location, myEvent.Id);
                    }
                }
                else
                {
                    lblPanelTopic.Text = string.Format(@"{0} - {1}<a href='students-event.aspx?like={2} &eventId={2}' class='btn btn-primary btn-xs pull-right'>Like</a>", myEvent.Name, myEvent.Location, myEvent.Id);
                }

                lblDate.Text = General.getDateString(myEvent.Date);
                if (myEvent.Image != "")
                {
                    imgImage1.Src = "../../../Images/Events/" + myEvent.Image;
                }

                //Get Event Manager
                Qaelo.Models.EventPosterModel.EventPoster poster = connecton.getPoster(myEvent.EventPosterId);
                lblName.Text   = poster.FullName;
                lblEmail.Text  = poster.Email;
                lblNumber.Text = poster.Number;

                lblDescription.Text = myEvent.Description.Replace(char.ConvertFromUtf32(13), "<br/>");
                TicketModel ticket = connecton.getTicketById(eventId);

                if (ticket != null)
                {
                    lblTicketSales.Text          = ticket.PriceDescription.Replace(char.ConvertFromUtf32(13), "<br/>");
                    lblTicketAccountdetails.Text = string.Format(@"<p>Bank Name :{0}</p>
                                <p>Account Holder :{1}</p>
                                <p>Account No: {2}</p>
                                <p>Branch Code: {3}</p>
                                <p>Reference : {4}</p>", ticket.BankName, ticket.AccountHolder, ticket.AccountNo, ticket.BranchCode, ticket.reference);
                    divTickets.Visible           = true;
                }
                else
                {
                    divTickets.Visible = false;
                }
            }
            else if (Request.QueryString["seventId"] != null)
            {
                SocietyConnection connecton = new SocietyConnection();
                int     eventId             = Convert.ToInt32(Request.QueryString["seventId"]);
                MyEvent myEvent             = connecton.getEventById(eventId);

                if (myEvent == null)
                {
                    return;
                }

                if (student != null)
                {
                    //Like and unlike
                    if (Request.QueryString["like"] != null)
                    {
                        connecton.likeEvent(Convert.ToInt32(Request.QueryString["like"].ToString()), myEvent.EventPosterId, student.Id);
                    }
                    else if (Request.QueryString["unlike"] != null)
                    {
                        connecton.unlikeEvent(Convert.ToInt32(Request.QueryString["unlike"].ToString()), student.Id);
                    }
                }
                else
                {
                    if (Request.QueryString["like"] != null)
                    {
                        Response.Redirect("~/Web/Account/tempLogin.aspx");
                    }
                }

                if (student != null)
                {
                    if (new Qaelo.Data.SocietyData.SocietyConnection().eventLikedByUser(myEvent.Id, student.Id))
                    {
                        lblPanelTopic.Text = string.Format(@"{0} - {1}<a href='students-event.aspx?unlike={2} &seventId={2}' class='btn btn-danger btn-xs pull-right'>Liked</a>", myEvent.Name, myEvent.Location, myEvent.Id);
                    }
                    else
                    {
                        lblPanelTopic.Text = string.Format(@"{0} - {1}<a href='students-event.aspx?like={2} &seventId={2}' class='btn btn-primary btn-xs pull-right'>Like</a>", myEvent.Name, myEvent.Location, myEvent.Id);
                    }
                }
                else
                {
                    lblPanelTopic.Text = string.Format(@"{0} - {1}<a href='students-event.aspx?like={2} &seventId={2}' class='btn btn-primary btn-xs pull-right'>Like</a>", myEvent.Name, myEvent.Location, myEvent.Id);
                }



                lblDate.Text = General.getDateString(myEvent.Date);
                if (myEvent.Image != "")
                {
                    imgImage1.Src = "../../../Images/Events/" + myEvent.Image;
                }

                //Get Event Manager
                Qaelo.Models.SocietyModel.Society poster = connecton.getSociety(myEvent.EventPosterId);
                lblName.Text   = poster.Name;
                lblEmail.Text  = poster.Email;
                lblNumber.Text = poster.Number;

                lblDescription.Text = myEvent.Description.Replace(char.ConvertFromUtf32(13), "<br/>");
                TicketModel ticket = new EventConnection().getTicketById(eventId);

                if (ticket != null)
                {
                    lblTicketSales.Text          = ticket.PriceDescription.Replace(char.ConvertFromUtf32(13), "<br/>");
                    lblTicketAccountdetails.Text = string.Format(@"<p>Bank Name :{0}</p>
                                <p>Account Holder :{1}</p>
                                <p>Account No: {2}</p>
                                <p>Branch Code: {3}</p>
                                <p>Reference : {4}</p>", ticket.BankName, ticket.AccountHolder, ticket.AccountNo, ticket.BranchCode, ticket.reference);
                    divTickets.Visible           = true;
                }
                else
                {
                    divTickets.Visible = false;
                }
            }
            else
            {
                Response.Redirect("~/Web/Users/Student/students-events.aspx");
            }
        }