protected void btOk_Click(object sender, EventArgs e)
        {
            DojoTestListJournalEntry dojoTestListJournalEntry = new DojoTestListJournalEntry(dojoTestListJournalEntryID);

            dojoTestListJournalEntry.Delete();

            dojoTestListJournalEntryID = 0;

            OnDeleted(EventArgs.Empty);
        }
 protected override void OnPreRender(EventArgs e)
 {
     if (dojoTestListJournalEntryID != 0)
     {
         dojoTestListJournalEntry = new DojoTestListJournalEntry(dojoTestListJournalEntryID);
         text = "Delete - " + dojoTestListJournalEntry.ToString();
     }
     else
     {
         text = "Delete ";
     }
     EnsureWindowScripts();
 }
Пример #3
0
        public void RemoveMember(DojoTestList list, DojoMember member)
        {
            DojoTestListJournalEntry entry;

            entry = new DojoTestListJournalEntry();

            entry.Comment   = "Removed member.";
            entry.Editor    = null;
            entry.EntryType = _journalTypeRemove;
            entry.Member    = member;
            entry.Promotion = null;
            entry.TestList  = list;

            entry.Save();
        }
Пример #4
0
        public DojoTestList Generate(DojoTest test)
        {
            DojoMemberCollection     eligibles;
            DojoTestList             list;
            DojoTestListJournalEntry entry;

            eligibles = GetEligibleMembers(test);

            // Create List
            list                       = new DojoTestList();
            list.Editor                = null;
            list.EditorComments        = "";
            list.Status                = _draftStatus;
            list.Test                  = test;
            list.Candidates            = eligibles;
            list.CandidatesCompileDate = list.CreateDate;
            list.Save();

            // Create Journal Items
            foreach (DojoMember member in eligibles)
            {
                entry = new DojoTestListJournalEntry();

                if (member.TestEligibilityHoursBalance.TotalHours > 0)
                {
                    entry.Comment = "Eligible for " + member.Rank.PromotionRank.Name + " on " +
                                    member.TestEligibilityDate.ToShortDateString() + " with an additional " +
                                    member.TestEligibilityHoursBalance.TotalHours.ToString("f") + " hours training.";
                }
                else
                {
                    entry.Comment = "Newly eligible for " + member.Rank.PromotionRank.Name + " on " +
                                    member.TestEligibilityDate.ToShortDateString() + ".";
                }
                entry.Editor    = null;
                entry.EntryType = _journalTypeAdd;
                entry.Member    = member;
                entry.Promotion = null;
                entry.TestList  = list;

                entry.Save();
            }

            test.ActiveTestList = list;
            test.Save();

            return(list);
        }
Пример #5
0
        protected override void OnPreRender(EventArgs e)
        {
            if (loadFlag)
            {
                if (dojoTestListJournalEntryID > 0)
                {
                    obj  = new DojoTestListJournalEntry(dojoTestListJournalEntryID);
                    text = "Edit  - " + obj.ToString();
                }
                else if (dojoTestListJournalEntryID <= 0)
                {
                    obj  = new DojoTestListJournalEntry();
                    text = "Add ";
                }

                //
                // Set Field Entries
                //
                ltCreateDate.Text = obj.CreateDate.ToString();
                tbComment.Text    = obj.Comment;

                //
                // Set Children Selections
                //
                if (obj.TestList != null)
                {
                    foreach (ListItem item in msTestList.Items)
                    {
                        item.Selected = obj.TestList.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msTestList.SelectedIndex = 0;
                }

                if (obj.Member != null)
                {
                    foreach (ListItem item in msMember.Items)
                    {
                        item.Selected = obj.Member.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msMember.SelectedIndex = 0;
                }

                if (obj.EntryType != null)
                {
                    foreach (ListItem item in msEntryType.Items)
                    {
                        item.Selected = obj.EntryType.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msEntryType.SelectedIndex = 0;
                }

                if (obj.Editor != null)
                {
                    foreach (ListItem item in msEditor.Items)
                    {
                        item.Selected = obj.Editor.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msEditor.SelectedIndex = 0;
                }

                if (obj.Promotion != null)
                {
                    foreach (ListItem item in msPromotion.Items)
                    {
                        item.Selected = obj.Promotion.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msPromotion.SelectedIndex = 0;
                }
            }
        }
Пример #6
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoTestListJournalEntryID == 0)
            {
                obj = new DojoTestListJournalEntry();
            }
            else
            {
                obj = new DojoTestListJournalEntry(dojoTestListJournalEntryID);
            }

            obj.Comment = tbComment.Text;

            if (msTestList.SelectedItem != null && msTestList.SelectedItem.Value != "Null")
            {
                obj.TestList = DojoTestList.NewPlaceHolder(
                    int.Parse(msTestList.SelectedItem.Value));
            }
            else
            {
                obj.TestList = null;
            }

            if (msMember.SelectedItem != null && msMember.SelectedItem.Value != "Null")
            {
                obj.Member = DojoMember.NewPlaceHolder(
                    int.Parse(msMember.SelectedItem.Value));
            }
            else
            {
                obj.Member = null;
            }

            if (msEntryType.SelectedItem != null && msEntryType.SelectedItem.Value != "Null")
            {
                obj.EntryType = DojoTestListJournalEntryType.NewPlaceHolder(
                    int.Parse(msEntryType.SelectedItem.Value));
            }
            else
            {
                obj.EntryType = null;
            }

            if (msEditor.SelectedItem != null && msEditor.SelectedItem.Value != "Null")
            {
                obj.Editor = DojoMember.NewPlaceHolder(
                    int.Parse(msEditor.SelectedItem.Value));
            }
            else
            {
                obj.Editor = null;
            }

            if (msPromotion.SelectedItem != null && msPromotion.SelectedItem.Value != "Null")
            {
                obj.Promotion = DojoPromotion.NewPlaceHolder(
                    int.Parse(msPromotion.SelectedItem.Value));
            }
            else
            {
                obj.Promotion = null;
            }

            if (editOnAdd)
            {
                dojoTestListJournalEntryID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                tbComment.Text            = string.Empty;
                msTestList.SelectedIndex  = 0;
                msMember.SelectedIndex    = 0;
                msEntryType.SelectedIndex = 0;
                msEditor.SelectedIndex    = 0;
                msPromotion.SelectedIndex = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
        protected override void OnPreRender(EventArgs e)
        {
            if (dojoTestListJournalEntryID != 0)
            {
                dojoTestListJournalEntry = new DojoTestListJournalEntry(dojoTestListJournalEntryID);

                #region Bind General Folder

                //
                // Set Field Entries
                //


                //
                // Set Children Selections
                //

                // TestList

                if (dojoTestListJournalEntry.TestList != null)
                {
                    ltTestList.Text = dojoTestListJournalEntry.TestList.ToString();
                }
                else
                {
                    ltTestList.Text = string.Empty;
                }

                // Member

                if (dojoTestListJournalEntry.Member != null)
                {
                    ltMember.Text = dojoTestListJournalEntry.Member.ToString();
                }
                else
                {
                    ltMember.Text = string.Empty;
                }

                // EntryType

                if (dojoTestListJournalEntry.EntryType != null)
                {
                    ltEntryType.Text = dojoTestListJournalEntry.EntryType.ToString();
                }
                else
                {
                    ltEntryType.Text = string.Empty;
                }


                #endregion

                #region Bind _system Folder

                //
                // Set Field Entries
                //

                ltCreateDate.Text = dojoTestListJournalEntry.CreateDate.ToString();

                //
                // Set Children Selections
                //


                #endregion

                #region Bind Details Folder

                //
                // Set Field Entries
                //

                ltComment.Text = dojoTestListJournalEntry.Comment.ToString();

                //
                // Set Children Selections
                //

                // Editor

                if (dojoTestListJournalEntry.Editor != null)
                {
                    ltEditor.Text = dojoTestListJournalEntry.Editor.ToString();
                }
                else
                {
                    ltEditor.Text = string.Empty;
                }

                // Promotion

                if (dojoTestListJournalEntry.Promotion != null)
                {
                    ltPromotion.Text = dojoTestListJournalEntry.Promotion.ToString();
                }
                else
                {
                    ltPromotion.Text = string.Empty;
                }


                #endregion

                text = "View  - " + dojoTestListJournalEntry.ToString();
            }
        }