コード例 #1
0
        void rejectButton_Click(object sender, RoutedEventArgs e)
        {
            if (leaveItem.Start < currentFrozenDate && leaveItem.Status != LeaveStatus.Applying)
            {
                Message.Information("You cannot reject this application that its Start Time is before: " + currentFrozenDate.ToString("yyyy-MM-dd"));
            }
            else if (leaveItem.Status == LeaveStatus.Rejected)
            {
                Message.Information("This application is already rejected.");
            }
            else
            {
                rejectButton.IsEnabled = actButton.IsEnabled = false;

                RejectReason rr = new RejectReason(mUser, new List <LeaveItem>()
                {
                    leaveItem
                });
                rr.RejectedLeaveEvent += new EventHandler(rr_RejectedLeaveEvent);
                rr.Show();
            }
        }
コード例 #2
0
        void sc_ClickRejectButton(object sender, EventArgs e)
        {
            bool             noneSelection = true;
            List <LeaveItem> list          = new List <LeaveItem>();

            foreach (LeaveItem item in source)
            {
                if (item.IsSelect)
                {
                    // check frozen date
                    if (item.Start < currentFrozenDate && item.Status != LeaveStatus.Applying)
                    {
                        Message.Information("You cannot reject " + item.Submitter + "'s " + item.TypeValue + " leave." + Environment.NewLine + "Because its Start Time:" + item.StartValue + " is before: " + currentFrozenDate.ToString("yyyy-MM-dd"));
                        return;
                    }

                    // If the record is already rejected, we don't need to reject it again.  Go to the next record.
                    if (item.Status == LeaveStatus.Rejected)
                    {
                        continue;
                    }

                    list.Add(item);
                    noneSelection = false;
                }
            }

            if (!noneSelection)
            {
                RejectReason rr = new RejectReason(mUser, list);
                rr.RejectedLeaveEvent += new EventHandler(rr_RejectedLeaveEvent);
                rr.Show();
            }
            else
            {
                sc.Busy = false;
            }
        }