Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't Save records on MM.NET 3.5
Message
From
06/10/2008 03:12:05
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Can't Save records on MM.NET 3.5
Environment versions
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01352917
Message ID:
01352917
Views:
65
hello guys i generated a set of business of objects using the new MM.NET 3.5 Business Layer Generator... but instead of using the EntityCentric feature of the new BO, i want to it to behave like an old BO from the previous version.. so i edited the generated BO object and set it's EntityCentric value property equals to FALSE so i can use the old "HookSetDefaultValue(Datarow row)" Method.

Here is the scenario:

1. i have a child form with some controls binded to the business object registered in the form...

2. when the child form is shown i would want to create a new row using the BusinessObjects.NewRow method,so i put it in the form loading event so my code looks like this.
private void NewRecord()
{

           BusinessObject.GetEmptyDataSet();
           BusinessObject.NewRow();
}



form_load(object sender,  EventArgs e)
{
          this.NewRecord();
}
3. when i press the save button (i used an ordinary button not the mmButton) i want to save the record, remember the controls are binded so i dont have to set the values in my code manually. so i just called the save method of the business form "this.Save(BusinessObject)" fortunately the 1st record was saved successfuly, but i want to clear the current dataset and create a new record again. so i called the method "NewRecord()" again, the dataset was cleared successfuly and a new row is created... but when i save the record again.... it does not save.

what is the problem? this code is working on the old version of the MM.NET but now its not working.

My Code looks like this
button_click(object sender,  EventArgs e)
{

                this.Save(oBusinessObject);
                if (this.oBusinessObject.State != OakLeaf.MM.Main.Business.mmBusinessState.BrokenRulesWarnings)
                {
                            this.NewRecord();
                }
}
Reply
Map
View

Click here to load this message in the networking platform