Example #1
0
        public void AddBid(Model.Participant bidder, int confId, int paper, int value)
        {
            List <Model.Paper> papers = repoPaper.GetByConference(confId);

            foreach (Model.Paper p in papers)
            {
                if (p.Id == paper)
                {
                    Model.Paper newP = p;
                    newP.AddBid(bidder, value);
                    repoPaper.Modify(paper, newP);
                }
            }
        }
Example #2
0
        public ActionResult Delete(Participant model)
        {
            try
            {
                int theID = model.ParticipantID;
                Participant theParticipant = work.ParticipantRepository.GetByID(theID);

                work.ParticipantRepository.Delete(theParticipant);
                work.Save();
                // TODO: Add delete logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Example #3
0
        public ActionResult Create(Participant model)
        {
            try
            {
                // int thePostID = model.Post.PostID;
                // model.PostID = thePostID;
                if (ModelState.IsValid)
                {
                    work.ParticipantRepository.Insert(model);
                    work.Save();
                }
                // TODO: Add insert logic here

                return RedirectToAction("Create", "Photo", new { id = model.ParticipantID });
                // return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Example #4
0
        public List <Model.Review> GetReviewsByPaper(int paperId)
        {
            List <Model.Review> all = new List <Model.Review>();

            var paper = _context.Papers.Find(paperId);

            foreach (var r in _context.getReviewsPaper(paperId))
            {
                User              us          = _context.Users.Find(r.PCMemberUserId);
                PCMember          pcm         = _context.PCMembers.Find(r.PCMemberUserId, paper.ConferenceId);
                Model.User        reviewer    = new Model.User(us.UserId, us.Username, us.Password, us.Name, us.Affilliation, us.Email, us.canBePCMember, us.WebPage);
                Model.Participant participant = new Model.Participant(reviewer, paper.ConferenceId, pcm.isChair, pcm.isCoChair, true, false);

                Verdict v = (Verdict)r.Evaluation;

                Model.Review review = new Model.Review(0, participant, v, r.Recommandations);
                all.Add(review);
            }


            return(all);
        }
Example #5
0
 /*Adauga un payment*/
 public void NewPayment(Model.Participant p, int nrTickets, Model.Conference conf)
 {
     repoPayment.addPayment(p, nrTickets, conf);
 }
Example #6
0
        public List <Model.Paper> GetByConference(int confId)
        {
            List <Model.Paper> all = new List <Model.Paper>();

            foreach (Paper paper in _context.Papers)
            {
                if (paper.ConferenceId == confId)
                {
                    User       u    = _context.Users.Find(paper.UserId);
                    Model.User user = new Model.User(u.UserId, u.Username, u.Password, u.Name, u.Affilliation, u.Email, u.canBePCMember, u.WebPage);

                    Topic t = _context.Topics.Find(paper.TopicId);

                    Model.Paper p = new Model.Paper(paper.PaperId, paper.ConferenceId, user, paper.Name, paper.Filepath, paper.Domain, paper.Subdomain, paper.Resume, t.TopicName);

                    List <Author> authors = new List <Author>();
                    foreach (AdditionalAuthor a in _context.AdditionalAuthors)
                    {
                        if (a.PaperId == paper.PaperId)
                        {
                            Author au = new Author(a.AdditionalAuthorId, a.Name, a.Affiliation);
                            authors.Add(au);
                        }
                    }

                    p.AdditionalAuthors = authors;

                    foreach (Bid b in _context.Bids)
                    {
                        if (b.PaperId == paper.PaperId)
                        {
                            User              us          = _context.Users.Find(b.PCMemberUserId);
                            PCMember          pcm         = _context.PCMembers.Find(b.PCMemberUserId, b.PCMemberConferenceId);
                            Model.User        bidder      = new Model.User(us.UserId, us.Username, us.Password, us.Name, us.Affilliation, us.Email, us.canBePCMember, us.WebPage);
                            Model.Participant participant = new Model.Participant(bidder, b.PCMemberConferenceId, pcm.isChair, pcm.isCoChair, true, false);

                            p.AddBid(participant, b.BiddingEvaluation);
                        }
                    }

                    foreach (var r in _context.getReviewsPaper(paper.PaperId))
                    {
                        User              us          = _context.Users.Find(r.PCMemberUserId);
                        PCMember          pcm         = _context.PCMembers.Find(r.PCMemberUserId, paper.ConferenceId);
                        Model.User        reviewer    = new Model.User(us.UserId, us.Username, us.Password, us.Name, us.Affilliation, us.Email, us.canBePCMember, us.WebPage);
                        Model.Participant participant = new Model.Participant(reviewer, paper.ConferenceId, pcm.isChair, pcm.isCoChair, true, false);

                        Model.Review review;

                        if (r.Evaluation != null)
                        {
                            Verdict v = (Verdict)r.Evaluation;
                            review = new Model.Review(0, participant, v, r.Recommandations);
                            p.AddReview(review);
                        }

                        p.AddReviewer(participant);
                    }

                    all.Add(p);
                }
            }

            return(all);
        }
Example #7
0
 public void AddBid(Model.Participant bidder, int confId, int selectedPaper, int bidValue)
 {
     server.AddBid(bidder, confId, selectedPaper, bidValue);
 }
Example #8
0
 public Payment(int id, double paidSum, int nrOfTickets, DateTime paymentDate, bool successfulTransaction, Participant buyer)
 {
     this.Id                    = id;
     this.PaidSum               = paidSum;
     this.NrOfTickets           = nrOfTickets;
     this.SuccessfulTransaction = successfulTransaction;
     this.PaymentDate           = paymentDate;
     Buyer = buyer;
 }
Example #9
0
        public ActionResult Edit(Participant model)
        {
            try
            {
                // TODO: Add update logic here
                // int thePostID = model.Post.PostID;
                // model.PostID = thePostID;
                if (ModelState.IsValid)
                {
                    work.ParticipantRepository.Update(model);
                    work.Save();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }