Events (BeforeSave/BeforeDelete - AfterSave/AfterDelete)


Author
Message
Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
Trent... Bom Dia !!!

(*) I wait that the Portuguese translated with Babel Fish has been intelligible. Smile

I am with doubts in the events: Before(Save, Delete) / After(Save, Delete).

I think that the calls of acceptance of the modifications are not running in the certain order or I am not understanding logical the proposal.

I would like that you evaluated the attached project observing if the statuses of the rows in some phases correspond to the waited result.

It makes tests adding and excluding registers in table two that it is in the list of table one.

It confers the status of rows in the events of the BO. Special attention for the status of rows when the register is excluded in table two.

I make this questioning because I intend to implement processes that affect registers in other tables from launchings in the main table, using for this the control of status of rows with modification. Also, if you will have some example for this, you would be been thankful.

Code area:

        #region SAVE
        private void TbLevelTwoBO_BeforeSave(MicroFour.StrataFrame.Data.BeforeSaveUndoEventArgs e)
        {
            foreach (DataRow row in this.CurrentDataTable.Rows)
            {
                string a = row.RowState.ToString();
            }
        }
        private void TbLevelTwoBO_AfterSave(MicroFour.StrataFrame.Data.AfterSaveUndoEventArgs e)
        {
            foreach (DataRow row in this.CurrentDataTable.Rows)
            {
                string a = row.RowState.ToString();
            }
        }
        #endregion

        #region DELETE
        private void TbLevelTwoBO_BeforeDelete(BeforeDeleteEventArgs e)
        {
            foreach (DataRow row in this.CurrentDataTable.Rows)
            {
                string a = row.RowState.ToString();
            }
        }
        private void TbLevelTwoBO_AfterDelete(AfterDeleteEventArgs e)
        {
            foreach (DataRow row in this.CurrentDataTable.Rows)
            {
                string a = row.RowState.ToString();
            }
        }
        #endregion

Rogério Mauri Smile



Attachments
TesteStrataFrame.zip (102 views, 904.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Rogerio,

Sorry, I might have to get Ivan involed on this one.  I really didn't understand what you were trying to accomplish on this one Ermm

However, from looking at your code, I don't really understand what you are trying to do in the BeforeSave by enumerating all of the rows.  This is really the purpose of the CheckRulesOnCurrenRow event and it will allow you to talk to each row individually versus you re-enumerating all of the rows.  You could then check on the CurrentRow.RowState.

We use the Before and After Save events all of the time for a number of different purposes (i.e. updating UI details, performing some type of audit, etc).

Hope this helps Smile

Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
Ok... Ivan will be able assisting in them

Rogério Mauri Smile

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search