Exemple #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Subreviewer subreviewer = db.Subreviewers.Find(id);

            db.Subreviewers.Remove(subreviewer);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "id_subreviewer,id_paper_assignment,id_user,invitation_send_date,invitation_ack,is_accepted")] Subreviewer subreviewer)
 {
     if (ModelState.IsValid)
     {
         db.Entry(subreviewer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(subreviewer));
 }
Exemple #3
0
        public ActionResult Create([Bind(Include = "id_subreviewer,id_paper_assignment,id_user,invitation_send_date,invitation_ack,is_accepted")] Subreviewer subreviewer)
        {
            if (ModelState.IsValid)
            {
                db.Subreviewers.Add(subreviewer);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(subreviewer));
        }
        //adaugare subreview
        public ActionResult AddSubreview(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Subreviewer subreviewer = db.Subreviewers.Find(id);

            if (subreviewer == null)
            {
                return(HttpNotFound());
            }
            return(View());
        }
        public ActionResult AddSubreview([Bind(Include = "id_subreview,id_subreviewer,grade,confidence,comment,comment_to_edit")] Subreview subreview, int?id)
        {
            if (ModelState.IsValid)
            {
                User user = (User)Session["User"];

                Subreviewer subreviewer = db.Subreviewers.Find(id);

                subreview.Subreviewer     = subreviewer;
                subreview.id_subreviewer  = (Int32)id;
                subreview.date_submitted  = DateTime.Now;
                subreview.comment_to_edit = "";
                db.Subreviews.Add(subreview);
                db.SaveChanges();
                // return RedirectToAction("Index");
            }
            return(RedirectToAction("Index"));
        }
        public ActionResult AcceptDecline([Bind(Include = "verification_key")] User user, int id_user, int id_conference, String submit)
        {
            if (Request.Form["Accept"] != null)
            {
                Paper paper = (from u in db.Papers where u.id_conference == id_conference select u).FirstOrDefault();

                PCmember newPcMember = new PCmember();
                newPcMember.User       = db.Users.Find(id_user);
                newPcMember.Conference = db.Conferences.Find(id_conference);
                String confName = newPcMember.Conference.conference_name;
                newPcMember.id_user = newPcMember.User.id_user;
                int id = newPcMember.id_user;
                newPcMember.id_conference       = newPcMember.Conference.id_conference;
                newPcMember.is_chair            = false;
                newPcMember.is_valid            = false;
                newPcMember.date_invitation_acc = DateTime.Now;
                string   invitation_sent = (String)Session["date_invitation_sent"];
                DateTime myDate          = DateTime.Parse(invitation_sent);
                newPcMember.date_invitation_sent = (DateTime)myDate;
                db.PCmembers.Add(newPcMember);
                db.SaveChanges();

                PCmember pcm = db.PCmembers.Find(newPcMember.id_pcmember);

                PaperAssignment newPaperAssignment = new PaperAssignment();
                Conference      conf = db.Conferences.Find(id_conference);
                newPaperAssignment.Paper       = paper;
                newPaperAssignment.PCmember    = pcm;
                newPaperAssignment.id_paper    = paper.id_paper;
                newPaperAssignment.id_pcmember = pcm.id_pcmember;


                // de refacut - date_assigned - date_submitted
                newPaperAssignment.date_assigned = paper.date_submitted;
                //termen de 2 zile pana cand mai poate reincarca lucrarea
                newPaperAssignment.date_due     = newPaperAssignment.date_assigned.AddHours(48);
                newPaperAssignment.is_delegated = false;
                db.PaperAssignments.Add(newPaperAssignment);
                db.SaveChanges();


                PaperAssignment pp             = db.PaperAssignments.Find(newPaperAssignment.id_paper_assignment);
                Subreviewer     newSubreviewer = new Subreviewer();

                newSubreviewer.PaperAssignment     = pp;
                newSubreviewer.id_paper_assignment = pp.id_paper_assignment;
                PaperAssignment p  = db.PaperAssignments.Find(pp.id_paper_assignment);
                PCmember        pc = p.PCmember;
                User            us = db.Users.Find(pc.id_user);
                newSubreviewer.User    = us;
                newSubreviewer.id_user = us.id_user;

                newSubreviewer.date_invitation_answer = newPcMember.date_invitation_acc;
                newSubreviewer.date_invitation_send   = newPcMember.date_invitation_sent;
                newSubreviewer.is_accepted            = true;
                newSubreviewer.PaperAssignment        = p;
                newSubreviewer.id_paper_assignment    = p.id_paper_assignment;

                db.Subreviewers.Add(newSubreviewer);
                db.SaveChanges();
            }
            else if (Request.Form["Decline"] != null)
            {
                return(RedirectToAction("Reconsideration", "PCmembers"));
            }
            return(RedirectToAction("SubreviewerDetails", "PaperAssignments", new { id = id_user }));
        }