Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't Save records on MM.NET 3.5
Message
De
06/10/2008 03:12:05
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Can't Save records on MM.NET 3.5
Versions des environnements
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01352917
Message ID:
01352917
Vues:
64
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();
                }
}
Répondre
Fil
Voir

Click here to load this message in the networking platform