Esempio n. 1
0
        private bool Create()
        {
            this.guid = Guid.NewGuid();

            int rowsAffected = DBContentWorkflow.Create(
                this.guid,
                this.siteGuid,
                this.moduleGuid,
                this.userGuid,
                this.createdDateUtc,
                this.contentText,
                this.customData,
                this.customReferenceNumber,
                this.customReferenceGuid,
                this.status.ToString());

            //make entry in approval process table
            DBContentWorkflow.DeactivateAudit(moduleGuid);
            DBContentWorkflow.CreateAuditHistory(
                Guid.NewGuid(),
                this.guid,
                this.moduleGuid,
                this.lastModUserGuid,
                this.lastModUtc,
                this.status.ToString(),
                this.notes,
                true);



            return(rowsAffected > 0);
        }
Esempio n. 2
0
        /// <summary>
        /// Updates an existing instance of ContentHistory. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Update()
        {
            int rowsAffected = DBContentWorkflow.Update(
                this.guid,
                this.lastModUserGuid,
                this.lastModUtc,
                this.contentText,
                this.customData,
                this.customReferenceNumber,
                this.customReferenceGuid,
                this.status.ToString());

            if (status == ContentWorkflowStatus.Approved)
            {
                //make entry in approval process table
                DBContentWorkflow.CreateAuditHistory(
                    Guid.NewGuid(),
                    this.guid,
                    this.moduleGuid,
                    this.lastModUserGuid,
                    this.lastModUtc,
                    this.status.ToString(),
                    this.notes,
                    false);

                DBContentWorkflow.DeactivateAudit(moduleGuid);
            }
            else if (status != originalStatus)
            {
                DBContentWorkflow.DeactivateAudit(moduleGuid);
                DBContentWorkflow.CreateAuditHistory(
                    Guid.NewGuid(),
                    this.guid,
                    this.moduleGuid,
                    this.lastModUserGuid,
                    this.lastModUtc,
                    this.status.ToString(),
                    this.notes,
                    true);
            }

            return(rowsAffected > 0);
        }