예제 #1
0
        private void AddTimeChoice(int daysAgo, string time, string label)
        {
            TimeChoice choice = new TimeChoice();

            choice.DaysAgo = daysAgo;
            choice.Time    = time;
            choice.Label   = label;
            cboTimeChoices.Items.Add(choice);
        }
예제 #2
0
        private void cboTimeChoices_SelectedIndexChanged(object sender, EventArgs e)
        {
            TimeChoice choice = (TimeChoice)cboTimeChoices.SelectedItem;
            DateTime   date   = DateTime.Today.Subtract(new TimeSpan(choice.DaysAgo, 0, 0, 0));
            RTEmail    email  = (RTEmail)grdValues.SelectedObject;

            email.DueDate       = date;
            email.StartsDate    = date;
            email.StartedDate   = date;
            email.TimeEstimated = choice.Time;
            email.TimeWorked    = choice.Time;
            grdValues.Refresh();
        }
예제 #3
0
        public ActionResult AddNewTimeChoice(int id)
        {
            User       currentUser   = UserRepository.Get(Convert.ToInt32(User.Identity.GetUserId()));
            Time       timeChosen    = TimeRepository.Get(id);
            TimeChoice newTimeChoice = new TimeChoice();

            newTimeChoice.Time    = timeChosen;
            newTimeChoice.User    = currentUser;
            newTimeChoice.Meeting = timeChosen.Meeting;
            TimeChoiceRepository.Add(newTimeChoice);
            updateInvitationStatus(currentUser, timeChosen.Meeting.Id, 1);

            return(RedirectToAction("Profile", new { id = newTimeChoice.Meeting.Id }));
        }
예제 #4
0
        public static int Add(TimeChoice timeChoice)
        {
            int id = 0;

            try
            {
                using (var session = DbConnect.SessionFactory.OpenSession())
                {
                    id = Convert.ToInt32(session.Save(timeChoice));
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
            return(id);
        }