示例#1
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));
        }
        public ActionResult Create([Bind(Include = "id_review,id_paper_assignment,grade,confidence,comment,comment_to_editor,date_submitted,from_subreviewer")] Review review)
        {
            if (ModelState.IsValid)
            {
                db.Reviews.Add(review);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(review));
        }
示例#3
0
        public ActionResult Create(User user)
        {
            if (ModelState.IsValid)
            {
                db.User.Add(user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
示例#4
0
        public ActionResult Create([Bind(Include = "id_paper_assignment,id_paper,id_pcmember,date_assigned,date_due,is_delegated")] PaperAssignment paperAssignment)
        {
            if (ModelState.IsValid)
            {
                db.PaperAssignments.Add(paperAssignment);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(paperAssignment));
        }
        public ActionResult Create(Email email)
        {
            if (ModelState.IsValid)
            {
                db.Email.Add(email);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.UserID = new SelectList(db.User, "ID", "Name", email.UserID);
            return(View(email));
        }
        public ActionResult Create([Bind(Include = "id_conference,conference_name,location,start_date,end_date")] Conference conference)
        {
            if (ModelState.IsValid)
            {
                var c = (User)Session["User"];
                conference.Chair = db.Users.Find(c.id_user);
                db.Conferences.Add(conference);
                db.SaveChanges();


                return(RedirectToAction("Index"));
            }

            return(View(conference));
        }
示例#7
0
        public ActionResult Create([Bind(Include = "id_user,surname,first_name,email,institution")] User user)
        {
            user.password               = "******";
            user.verified_account       = DateTime.Now;
            user.date_active            = DateTime.Now.AddHours(24);
            user.date_verification_send = DateTime.Now;
            user.verification_key       = KeyGenerator.GetUniqueKey(8);

            if (ModelState.IsValid)
            {
                //var errors = this.ModelState.Keys.SelectMany(key => this.ModelState[key].Errors);
                db.Users.Add(user);
                emailSender(user.verification_key, user.email, user.first_name);
                db.SaveChanges();
            }

            return(RedirectToAction("SendEmail"));
        }
        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"));
        }
示例#9
0
 private void PersistAsUnsubscribed()
 {
     using (var context = new UserModelContainer())
     {
         var user = context.Users.Single(x => x.EmailAddress == EmailAddress);
         user.IsUnsubscribed = true;
         user.UnsubscribedAt = DateTime.Now;
         context.SaveChanges();
     }
 }
        public ActionResult CreateAuthor([Bind(Include = "email, password")] User user)
        {
            Author   newAuthor   = new Author();
            PCmember newPCmember = new PCmember();
            User     x           = (User)Session["User"];
            User     c           = (from u in db.Users where user.email.Equals(x.email) && user.password.Equals(x.password) select u).FirstOrDefault();

            if (c != null)
            {
                newAuthor.id_user         = x.id_user;
                newAuthor.is_coresponding = false;
                db.Authors.Add(newAuthor);
                db.SaveChanges();
                return(RedirectToAction("AllConferences", "Conferences"));
            }
            else
            {
                ViewBag.Message = "You don't have an account, please create an account";
                return(RedirectToAction("NewUser", "Users"));
            }
        }
示例#11
0
        public ActionResult Event([Bind(Include = "user_id,user_email,user_first_name,user_last_name,user_address,user_phone_number")] User user)
        {
            if (ModelState.IsValid)
            {
                db.UserSet.Add(user);
                db.SaveChanges();
                MailSender(user.user_email, "*****@*****.**", "Notification from YRSP", "Hi, " + user.user_first_name + ". You have successfully subscribed to our event notification.");
                return(RedirectToAction("Event"));
            }

            return(View(user));
        }
示例#12
0
 public void Run()
 {
     Thread.Sleep(UnsubscribeWorkflow.StepDuration);
     using (var context = new UserModelContainer())
     {
         var user = context.Users.Single(x => x.EmailAddress == EmailAddress);
         user.UserEvents.Add(new UserEvent
         {
             EventCode  = "UNSUB-LEGACY",
             RecordedAt = DateTime.Now
         });
         context.SaveChanges();
     }
 }
示例#13
0
 private void PersistAsUnsubscribed()
 {
     using (var context = new UserModelContainer())
     {
         var user = context.Users.Single(x => x.EmailAddress == EmailAddress);
         user.IsUnsubscribed = true;
         user.UnsubscribedAt = DateTime.Now;
         user.UserEvents.Add(new UserEvent
         {
             EventCode  = "UNSUB",
             RecordedAt = DateTime.Now
         });
         context.SaveChanges();
     }
 }
        public ActionResult Create([Bind(Include = "id_pcmember,id_user,id_conference,is_chair,date_invitation_sent,date_invitation_acc,is_valid")] PCmember pCmember)
        {
            if (ModelState.IsValid)
            {
                db.PCmembers.Add(pCmember);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pCmember));
        }
    static void Main(string[] args)
    {
        using (var container = new UserModelContainer())
        {
            var user = new User
            {
                FirstName = "Joe",
                Surname   = "Coder"
            };

            var address = new Address
            {
                AddressLine1  = "123 Any Street",
                AddressLine2  = "Apt 2A",
                City          = "Anytown",
                StateProvince = "CA",
                PostalCode    = "12345",
                Country       = "United States",
                IsPublic      = false
            };

            user.Lookups.Add(address);

            container.SaveChanges();
        }

        using (var container = new UserModelContainer())
        {
            foreach (var user in container.Users)
            {
                Console.WriteLine("Name: {0} {1}", user.FirstName, user.Surname);

                foreach (var address in user.Lookups.OfType <Address>())
                {
                    Console.WriteLine(address.AddressLine1);
                    Console.WriteLine(address.AddressLine2);
                    Console.WriteLine(address.City);
                    Console.WriteLine(address.StateProvince);
                    Console.WriteLine(address.PostalCode);
                    Console.WriteLine(address.Country);
                    Console.WriteLine("Address is {0}", address.IsPublic ? "Public" : "Private");
                }
            }
        }
    }
        public ActionResult AddDecision(Boolean decision, String decision_text, Paper paper)
        {
            Paper p = db.Papers.Find(paper.id_paper);

            if (ModelState.IsValid)
            {
                p.decision        = paper.decision;
                p.decision_text   = paper.decision_text;
                db.Entry(p).State = EntityState.Modified;
                db.SaveChanges();
            }
            return(RedirectToAction("ConferenceChair", "Conferences"));
        }