protected void btOk_Click(object sender, EventArgs e)
        {
            DojoTestListStatus dojoTestListStatus = new DojoTestListStatus(dojoTestListStatusID);

            dojoTestListStatus.Delete();

            dojoTestListStatusID = 0;

            OnDeleted(EventArgs.Empty);
        }
Пример #2
0
        protected override void OnPreRender(EventArgs e)
        {
            if (loadFlag)
            {
                if (dojoTestListStatusID > 0)
                {
                    obj  = new DojoTestListStatus(dojoTestListStatusID);
                    text = "Edit  - " + obj.ToString();
                }
                else if (dojoTestListStatusID <= 0)
                {
                    obj  = new DojoTestListStatus();
                    text = "Add ";
                }

                //
                // Set Field Entries
                //
                tbName.Text                     = obj.Name;
                tbDescription.Text              = obj.Description;
                tbOrderNum.Text                 = obj.OrderNum.ToString();
                cbIsDraft.Checked               = obj.IsDraft;
                cbIsFinal.Checked               = obj.IsFinal;
                cbIsComplete.Checked            = obj.IsComplete;
                cbTeacherEditingEnabled.Checked = obj.TeacherEditingEnabled;

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

                if (obj.OnCompleted != null)
                {
                    foreach (ListItem item in msOnCompleted.Items)
                    {
                        item.Selected = obj.OnCompleted.ID.ToString() == item.Value;
                    }
                }
                else
                {
                    msOnCompleted.SelectedIndex = 0;
                }
            }
        }
 protected override void OnPreRender(EventArgs e)
 {
     if (dojoTestListStatusID != 0)
     {
         dojoTestListStatus = new DojoTestListStatus(dojoTestListStatusID);
         text = "Delete - " + dojoTestListStatus.ToString();
     }
     else
     {
         text = "Delete ";
     }
     EnsureWindowScripts();
 }
Пример #4
0
        public TestListGenerator(string connectionString)
        {
            _connectionString = connectionString;

            // Create Draft Status Types
            _draftStatus =
                DojoTestListStatus.NewPlaceHolder(1);

            // Create Journal Types
            _journalTypeAdd =
                DojoTestListJournalEntryType.NewPlaceHolder(1);
            _journalTypeRemove =
                DojoTestListJournalEntryType.NewPlaceHolder(2);
        }
Пример #5
0
        protected override void OnPreRender(EventArgs e)
        {
            if (dojoTestListStatusID != 0)
            {
                dojoTestListStatus = new DojoTestListStatus(dojoTestListStatusID);

                #region Bind _system Folder

                //
                // Set Field Entries
                //


                //
                // Set Children Selections
                //


                #endregion

                #region Bind General Folder

                //
                // Set Field Entries
                //

                ltName.Text        = dojoTestListStatus.Name.ToString();
                ltDescription.Text = dojoTestListStatus.Description.ToString();
                ltOrderNum.Text    = dojoTestListStatus.OrderNum.ToString();

                //
                // Set Children Selections
                //


                #endregion

                #region Bind Flags Folder

                //
                // Set Field Entries
                //

                ltIsDraft.Text               = dojoTestListStatus.IsDraft.ToString();
                ltIsFinal.Text               = dojoTestListStatus.IsFinal.ToString();
                ltIsComplete.Text            = dojoTestListStatus.IsComplete.ToString();
                ltTeacherEditingEnabled.Text = dojoTestListStatus.TeacherEditingEnabled.ToString();

                //
                // Set Children Selections
                //


                #endregion

                #region Bind Status Changes Folder

                //
                // Set Field Entries
                //


                //
                // Set Children Selections
                //

                // OnFinalized

                if (dojoTestListStatus.OnFinalized != null)
                {
                    ltOnFinalized.Text = dojoTestListStatus.OnFinalized.ToString();
                }
                else
                {
                    ltOnFinalized.Text = string.Empty;
                }

                // OnCompleted

                if (dojoTestListStatus.OnCompleted != null)
                {
                    ltOnCompleted.Text = dojoTestListStatus.OnCompleted.ToString();
                }
                else
                {
                    ltOnCompleted.Text = string.Empty;
                }


                #endregion

                text = "View  - " + dojoTestListStatus.ToString();
            }
        }
Пример #6
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoTestListID == 0)
            {
                obj = new DojoTestList();
            }
            else
            {
                obj = new DojoTestList(dojoTestListID);
            }

            obj.EditorComments = tbEditorComments.Text;
            obj.Field1         = cbField1.Checked;

            if (msTest.SelectedItem != null && msTest.SelectedItem.Value != "Null")
            {
                obj.Test = DojoTest.NewPlaceHolder(
                    int.Parse(msTest.SelectedItem.Value));
            }
            else
            {
                obj.Test = null;
            }

            if (msStatus.SelectedItem != null && msStatus.SelectedItem.Value != "Null")
            {
                obj.Status = DojoTestListStatus.NewPlaceHolder(
                    int.Parse(msStatus.SelectedItem.Value));
            }
            else
            {
                obj.Status = null;
            }

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

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

            if (resetOnAdd)
            {
                tbEditorComments.Text  = string.Empty;
                cbField1.Checked       = false;
                msTest.SelectedIndex   = 0;
                msStatus.SelectedIndex = 0;
                msEditor.SelectedIndex = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #7
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoTestListStatusID == 0)
            {
                obj = new DojoTestListStatus();
            }
            else
            {
                obj = new DojoTestListStatus(dojoTestListStatusID);
            }

            obj.Name                  = tbName.Text;
            obj.Description           = tbDescription.Text;
            obj.OrderNum              = int.Parse(tbOrderNum.Text);
            obj.IsDraft               = cbIsDraft.Checked;
            obj.IsFinal               = cbIsFinal.Checked;
            obj.IsComplete            = cbIsComplete.Checked;
            obj.TeacherEditingEnabled = cbTeacherEditingEnabled.Checked;

            if (msOnFinalized.SelectedItem != null && msOnFinalized.SelectedItem.Value != "Null")
            {
                obj.OnFinalized = DojoTestListStatus.NewPlaceHolder(
                    int.Parse(msOnFinalized.SelectedItem.Value));
            }
            else
            {
                obj.OnFinalized = null;
            }

            if (msOnCompleted.SelectedItem != null && msOnCompleted.SelectedItem.Value != "Null")
            {
                obj.OnCompleted = DojoTestListStatus.NewPlaceHolder(
                    int.Parse(msOnCompleted.SelectedItem.Value));
            }
            else
            {
                obj.OnCompleted = null;
            }

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

            if (resetOnAdd)
            {
                tbName.Text                     = string.Empty;
                tbDescription.Text              = string.Empty;
                tbOrderNum.Text                 = string.Empty;
                cbIsDraft.Checked               = false;
                cbIsFinal.Checked               = false;
                cbIsComplete.Checked            = false;
                cbTeacherEditingEnabled.Checked = false;
                msOnFinalized.SelectedIndex     = 0;
                msOnCompleted.SelectedIndex     = 0;
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #8
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoTestID == 0)
            {
                obj = new DojoTest();
            }
            else
            {
                obj = new DojoTest(dojoTestID);
            }

            obj.Name        = tbName.Text;
            obj.Description = tbDescription.Text;
            obj.TestDate    = DateTime.Parse(tbTestDate.Text);
            if (comboLocation.SelectedItem != null)
            {
                obj.Location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations", int.Parse(comboLocation.SelectedValue));
            }
            else
            {
                obj.Location = null;
            }
            if (comboListMemberType1.SelectedItem != null)
            {
                obj.ListMemberType1 = DojoMemberType.NewPlaceHolder(int.Parse(comboListMemberType1.SelectedValue));
            }
            else
            {
                obj.ListMemberType1 = null;
            }
            if (comboListMemberType2.SelectedItem != null)
            {
                obj.ListMemberType2 = DojoMemberType.NewPlaceHolder(int.Parse(comboListMemberType2.SelectedValue));
            }
            else
            {
                obj.ListMemberType2 = null;
            }
            if (comboListMemberType3.SelectedItem != null)
            {
                obj.ListMemberType3 = DojoMemberType.NewPlaceHolder(int.Parse(comboListMemberType3.SelectedValue));
            }
            else
            {
                obj.ListMemberType3 = null;
            }
            if (ddPanelChief.SelectedItem != null && ddPanelChief.SelectedValue != "null")
            {
                obj.PanelChief = DojoMember.NewPlaceHolder(int.Parse(ddPanelChief.SelectedValue));
            }
            else
            {
                obj.PanelChief = null;
            }
            DojoMemberManager panelMembersManager = new DojoMemberManager();

            obj.PanelMembers = panelMembersManager.DecodeString(tbPanelMembers.Text, "");

            if (comboStatus.SelectedItem != null)
            {
                obj.Status = DojoTestListStatus.NewPlaceHolder(int.Parse(comboStatus.SelectedValue));
            }
            else
            {
                obj.Status = null;
            }
            if (ddActiveTestList.SelectedItem != null && ddActiveTestList.SelectedValue != "null")
            {
                obj.ActiveTestList = DojoTestList.NewPlaceHolder(int.Parse(ddActiveTestList.SelectedValue));
            }
            else
            {
                obj.ActiveTestList = null;
            }
            if (comboItem.SelectedItem != null)
            {
                obj.Item = RHItem.NewPlaceHolder(int.Parse(comboItem.SelectedValue));
            }
            else
            {
                obj.Item = null;
            }
            if (editOnAdd)
            {
                dojoTestID = obj.Save();
            }
            else
            {
                obj.Save();
            }

            if (resetOnAdd)
            {
                DojoTest newObj = new DojoTest();
                tbName.Text        = newObj.Name;
                tbDescription.Text = newObj.Description;
                tbTestDate.Text    = newObj.TestDate.ToString();
                if (newObj.Location != null)
                {
                    comboLocation.Text = newObj.Location.BusinessName;
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboLocation.Items)
                    {
                        if (item.Value == newObj.Location.ID.ToString())
                        {
                            comboLocation.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboLocation.Text         = string.Empty;
                    comboLocation.SelectedItem = null;
                }
                if (newObj.ListMemberType1 != null)
                {
                    comboListMemberType1.Text = newObj.ListMemberType1.Name;
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboListMemberType1.Items)
                    {
                        if (item.Value == newObj.ListMemberType1.ID.ToString())
                        {
                            comboListMemberType1.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboListMemberType1.Text         = string.Empty;
                    comboListMemberType1.SelectedItem = null;
                }
                if (newObj.ListMemberType2 != null)
                {
                    comboListMemberType2.Text = newObj.ListMemberType2.Name;
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboListMemberType2.Items)
                    {
                        if (item.Value == newObj.ListMemberType2.ID.ToString())
                        {
                            comboListMemberType2.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboListMemberType2.Text         = string.Empty;
                    comboListMemberType2.SelectedItem = null;
                }
                if (newObj.ListMemberType3 != null)
                {
                    comboListMemberType3.Text = newObj.ListMemberType3.Name;
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboListMemberType3.Items)
                    {
                        if (item.Value == newObj.ListMemberType3.ID.ToString())
                        {
                            comboListMemberType3.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboListMemberType3.Text         = string.Empty;
                    comboListMemberType3.SelectedItem = null;
                }
                if (newObj.PanelChief != null)
                {
                    foreach (ListItem item in ddPanelChief.Items)
                    {
                        item.Selected = newObj.PanelChief.ID.ToString() == item.Value;
                    }
                }
                else if (ddPanelChief.Items.Count > 0)
                {
                    ddPanelChief.SelectedIndex = 0;
                }

                tbPanelMembers.Text = newObj.PanelMembers.ToEncodedString("\r\n", "");
                if (newObj.Status != null)
                {
                    comboStatus.Text = newObj.Status.ToString();
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboStatus.Items)
                    {
                        if (item.Value == newObj.Status.ID.ToString())
                        {
                            comboStatus.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboStatus.Text         = string.Empty;
                    comboStatus.SelectedItem = null;
                }
                if (newObj.ActiveTestList != null)
                {
                    foreach (ListItem item in ddActiveTestList.Items)
                    {
                        item.Selected = newObj.ActiveTestList.ID.ToString() == item.Value;
                    }
                }
                else if (ddActiveTestList.Items.Count > 0)
                {
                    ddActiveTestList.SelectedIndex = 0;
                }

                if (newObj.Item != null)
                {
                    comboItem.Text = newObj.Item.ToString();
                    foreach (ComponentArt.Web.UI.ComboBoxItem item in comboItem.Items)
                    {
                        if (item.Value == newObj.Item.ID.ToString())
                        {
                            comboItem.SelectedItem = item;
                            break;
                        }
                    }
                }
                else
                {
                    // Necissary to clear prior ViewState - if only we don't need it.
                    comboItem.Text         = string.Empty;
                    comboItem.SelectedItem = null;
                }
            }

            OnUpdated(EventArgs.Empty);
        }
Пример #9
0
        protected void ok_Click(object sender, EventArgs e)
        {
            if (dojoTestID == 0)
            {
                obj = new DojoTest();
            }
            else
            {
                obj = new DojoTest(dojoTestID);
            }

            obj.Name        = tbName.Text;
            obj.Description = tbDescription.Text;
            obj.TestDate    = DateTime.Parse(tbTestDate.Text);

            if (msLocation.SelectedItem != null && msLocation.SelectedItem.Value != "Null")
            {
                obj.Location = GreyFoxContact.NewPlaceHolder("kitTessen_Locations",
                                                             int.Parse(msLocation.SelectedItem.Value));
            }
            else
            {
                obj.Location = null;
            }

            if (msListMemberType1.SelectedItem != null && msListMemberType1.SelectedItem.Value != "Null")
            {
                obj.ListMemberType1 = DojoMemberType.NewPlaceHolder(
                    int.Parse(msListMemberType1.SelectedItem.Value));
            }
            else
            {
                obj.ListMemberType1 = null;
            }

            if (msListMemberType2.SelectedItem != null && msListMemberType2.SelectedItem.Value != "Null")
            {
                obj.ListMemberType2 = DojoMemberType.NewPlaceHolder(
                    int.Parse(msListMemberType2.SelectedItem.Value));
            }
            else
            {
                obj.ListMemberType2 = null;
            }

            if (msListMemberType3.SelectedItem != null && msListMemberType3.SelectedItem.Value != "Null")
            {
                obj.ListMemberType3 = DojoMemberType.NewPlaceHolder(
                    int.Parse(msListMemberType3.SelectedItem.Value));
            }
            else
            {
                obj.ListMemberType3 = null;
            }

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

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

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

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

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

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

            if (msStatus.SelectedItem != null && msStatus.SelectedItem.Value != "Null")
            {
                obj.Status = DojoTestListStatus.NewPlaceHolder(
                    int.Parse(msStatus.SelectedItem.Value));
            }
            else
            {
                obj.Status = null;
            }

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

            if (msItem.SelectedItem != null && msItem.SelectedItem.Value != "Null")
            {
                obj.Item = RHItem.NewPlaceHolder(
                    int.Parse(msItem.SelectedItem.Value));
            }
            else
            {
                obj.Item = null;
            }

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

            if (resetOnAdd)
            {
                tbName.Text                     = string.Empty;
                tbDescription.Text              = string.Empty;
                tbTestDate.Text                 = DateTime.Now.ToString();
                msLocation.SelectedIndex        = 0;
                msListMemberType1.SelectedIndex = 0;
                msListMemberType2.SelectedIndex = 0;
                msListMemberType3.SelectedIndex = 0;
                msPanelChief.SelectedIndex      = 0;
                msPanelMember1.SelectedIndex    = 0;
                msPanelMember2.SelectedIndex    = 0;
                msPanelMember3.SelectedIndex    = 0;
                msPanelMember4.SelectedIndex    = 0;
                msPanelMember5.SelectedIndex    = 0;
                msStatus.SelectedIndex          = 0;
                msActiveTestList.SelectedIndex  = 0;
                msItem.SelectedIndex            = 0;
            }

            OnUpdated(EventArgs.Empty);
        }