/// <summary>
        /// Duplicates DojoTestListJournalEntryType object into a database; may or may not be the same database
        /// as the parent object.
        /// </summary>
        /// <returns> A new DojoTestListJournalEntryType object reflecting the replicated DojoTestListJournalEntryType object.</returns>
        public DojoTestListJournalEntryType Duplicate()
        {
            DojoTestListJournalEntryType clonedDojoTestListJournalEntryType = this.Clone();

            // Insert must be called after children are replicated!
            clonedDojoTestListJournalEntryType.iD       = DojoTestListJournalEntryTypeManager._insert(clonedDojoTestListJournalEntryType);
            clonedDojoTestListJournalEntryType.isSynced = true;
            return(clonedDojoTestListJournalEntryType);
        }
        /// <summary>
        /// Ensures that the object's fields and children are
        /// pre-loaded before any updates or reads.
        /// </summary>
        public void EnsurePreLoad()
        {
            if (!isPlaceHolder)
            {
                return;
            }

            DojoTestListJournalEntryTypeManager._fill(this);
            isPlaceHolder = false;
        }
示例#3
0
        private void bindDropDownLists()
        {
            #region Bind General Child Data

            msTestList.Items.Add(new ListItem("Null", "Null"));
            DojoTestListManager    testListManager    = new DojoTestListManager();
            DojoTestListCollection testListCollection = testListManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoTestList testList in testListCollection)
            {
                ListItem i = new ListItem(testList.ToString(), testList.ID.ToString());
                msTestList.Items.Add(i);
            }

            msMember.Items.Add(new ListItem("Null", "Null"));
            DojoMemberManager    memberManager    = new DojoMemberManager();
            DojoMemberCollection memberCollection = memberManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMember member in memberCollection)
            {
                ListItem i = new ListItem(member.ToString(), member.ID.ToString());
                msMember.Items.Add(i);
            }

            msEntryType.Items.Add(new ListItem("Null", "Null"));
            DojoTestListJournalEntryTypeManager    entryTypeManager    = new DojoTestListJournalEntryTypeManager();
            DojoTestListJournalEntryTypeCollection entryTypeCollection = entryTypeManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoTestListJournalEntryType entryType in entryTypeCollection)
            {
                ListItem i = new ListItem(entryType.ToString(), entryType.ID.ToString());
                msEntryType.Items.Add(i);
            }

            #endregion

            #region Bind Details Child Data

            msEditor.Items.Add(new ListItem("Null", "Null"));
            DojoMemberManager    editorManager    = new DojoMemberManager();
            DojoMemberCollection editorCollection = editorManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoMember editor in editorCollection)
            {
                ListItem i = new ListItem(editor.ToString(), editor.ID.ToString());
                msEditor.Items.Add(i);
            }

            msPromotion.Items.Add(new ListItem("Null", "Null"));
            DojoPromotionManager    promotionManager    = new DojoPromotionManager();
            DojoPromotionCollection promotionCollection = promotionManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoPromotion promotion in promotionCollection)
            {
                ListItem i = new ListItem(promotion.ToString(), promotion.ID.ToString());
                msPromotion.Items.Add(i);
            }

            #endregion
        }
        /// <summary>
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void RenderContent(HtmlTextWriter output)
        {
            DojoTestListJournalEntryTypeManager    m = new DojoTestListJournalEntryTypeManager();
            DojoTestListJournalEntryTypeCollection dojoTestListJournalEntryTypeCollection = m.GetCollection(string.Empty, string.Empty, null);

            // Render Header Row
            this.headerLockEnabled = true;
            RenderRow(this.HeaderRowCssClass, "Entry Type");

            bool   rowflag = false;
            string rowCssClass;

            //
            // Render Records
            //
            foreach (DojoTestListJournalEntryType dojoTestListJournalEntryType in dojoTestListJournalEntryTypeCollection)
            {
                if (rowflag)
                {
                    rowCssClass = defaultRowCssClass;
                }
                else
                {
                    rowCssClass = alternateRowCssClass;
                }
                rowflag = !rowflag;
                output.WriteBeginTag("tr");
                output.WriteAttribute("i", dojoTestListJournalEntryType.ID.ToString());
                output.WriteLine(HtmlTextWriter.TagRightChar);
                output.Indent++;
                output.WriteBeginTag("td");
                output.WriteAttribute("class", rowCssClass);
                output.Write(HtmlTextWriter.TagRightChar);
                output.Write(dojoTestListJournalEntryType.Name);
                output.WriteEndTag("td");
                output.Indent--;
                output.WriteEndTag("tr");
                output.WriteLine();
            }
        }
        /// <summary>
        /// Saves the DojoTestListJournalEntryType object state to the database.
        /// </summary>
        public int Save()
        {
            if (isSynced)
            {
                return(iD);
            }

            if (iD == -1)
            {
                throw (new Exception("Invalid record; cannot be saved."));
            }
            if (iD == 0)
            {
                iD = DojoTestListJournalEntryTypeManager._insert(this);
            }
            else
            {
                DojoTestListJournalEntryTypeManager._update(this);
            }
            isSynced = iD != -1;
            return(iD);
        }
 /// <summary>
 /// Overwrites and existing DojoTestListJournalEntryType object in the database.
 /// </summary>
 public void Overwrite(int id)
 {
     iD = id;
     DojoTestListJournalEntryTypeManager._update(this);
     isSynced = true;
 }
 public void Delete()
 {
     DojoTestListJournalEntryTypeManager._delete(this.iD);
     this.iD  = 0;
     isSynced = false;
 }
 public DojoTestListJournalEntryType(int id)
 {
     this.iD  = id;
     isSynced = DojoTestListJournalEntryTypeManager._fill(this);
 }
        private void bindDropDownLists()
        {
            #region Bind Status Changes Child Data

            msOnRemovedStatus.Items.Add(new ListItem("Null", "Null"));
            DojoTestListJournalEntryTypeManager    onRemovedStatusManager    = new DojoTestListJournalEntryTypeManager();
            DojoTestListJournalEntryTypeCollection onRemovedStatusCollection = onRemovedStatusManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoTestListJournalEntryType onRemovedStatus in onRemovedStatusCollection)
            {
                ListItem i = new ListItem(onRemovedStatus.ToString(), onRemovedStatus.ID.ToString());
                msOnRemovedStatus.Items.Add(i);
            }

            msOnFailedStatus.Items.Add(new ListItem("Null", "Null"));
            DojoTestListJournalEntryTypeManager    onFailedStatusManager    = new DojoTestListJournalEntryTypeManager();
            DojoTestListJournalEntryTypeCollection onFailedStatusCollection = onFailedStatusManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoTestListJournalEntryType onFailedStatus in onFailedStatusCollection)
            {
                ListItem i = new ListItem(onFailedStatus.ToString(), onFailedStatus.ID.ToString());
                msOnFailedStatus.Items.Add(i);
            }

            msOnPassedStatus.Items.Add(new ListItem("Null", "Null"));
            DojoTestListJournalEntryTypeManager    onPassedStatusManager    = new DojoTestListJournalEntryTypeManager();
            DojoTestListJournalEntryTypeCollection onPassedStatusCollection = onPassedStatusManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoTestListJournalEntryType onPassedStatus in onPassedStatusCollection)
            {
                ListItem i = new ListItem(onPassedStatus.ToString(), onPassedStatus.ID.ToString());
                msOnPassedStatus.Items.Add(i);
            }

            msOnPromotedStatus.Items.Add(new ListItem("Null", "Null"));
            DojoTestListJournalEntryTypeManager    onPromotedStatusManager    = new DojoTestListJournalEntryTypeManager();
            DojoTestListJournalEntryTypeCollection onPromotedStatusCollection = onPromotedStatusManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoTestListJournalEntryType onPromotedStatus in onPromotedStatusCollection)
            {
                ListItem i = new ListItem(onPromotedStatus.ToString(), onPromotedStatus.ID.ToString());
                msOnPromotedStatus.Items.Add(i);
            }

            msOnCertificateRequestedStatus.Items.Add(new ListItem("Null", "Null"));
            DojoTestListJournalEntryTypeManager    onCertificateRequestedStatusManager    = new DojoTestListJournalEntryTypeManager();
            DojoTestListJournalEntryTypeCollection onCertificateRequestedStatusCollection = onCertificateRequestedStatusManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoTestListJournalEntryType onCertificateRequestedStatus in onCertificateRequestedStatusCollection)
            {
                ListItem i = new ListItem(onCertificateRequestedStatus.ToString(), onCertificateRequestedStatus.ID.ToString());
                msOnCertificateRequestedStatus.Items.Add(i);
            }

            msOnCertificatePendingStatus.Items.Add(new ListItem("Null", "Null"));
            DojoTestListJournalEntryTypeManager    onCertificatePendingStatusManager    = new DojoTestListJournalEntryTypeManager();
            DojoTestListJournalEntryTypeCollection onCertificatePendingStatusCollection = onCertificatePendingStatusManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoTestListJournalEntryType onCertificatePendingStatus in onCertificatePendingStatusCollection)
            {
                ListItem i = new ListItem(onCertificatePendingStatus.ToString(), onCertificatePendingStatus.ID.ToString());
                msOnCertificatePendingStatus.Items.Add(i);
            }

            msOnCertificateReceivedStatus.Items.Add(new ListItem("Null", "Null"));
            DojoTestListJournalEntryTypeManager    onCertificateReceivedStatusManager    = new DojoTestListJournalEntryTypeManager();
            DojoTestListJournalEntryTypeCollection onCertificateReceivedStatusCollection = onCertificateReceivedStatusManager.GetCollection(string.Empty, string.Empty, null);
            foreach (DojoTestListJournalEntryType onCertificateReceivedStatus in onCertificateReceivedStatusCollection)
            {
                ListItem i = new ListItem(onCertificateReceivedStatus.ToString(), onCertificateReceivedStatus.ID.ToString());
                msOnCertificateReceivedStatus.Items.Add(i);
            }

            #endregion
        }