forked from DevExpress-Examples/out-of-maintenance-XPO_tutorial-1-your-first-data-aware-application-with-xpo-e4555
-
Notifications
You must be signed in to change notification settings - Fork 0
/
XtraForm1.cs
33 lines (31 loc) · 988 Bytes
/
XtraForm1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.Xpo;
using XpoTutorial1.DataModel;
namespace XpoTutorial1 {
public partial class XtraForm1 : DevExpress.XtraEditors.XtraForm {
public XtraForm1() {
InitializeComponent();
}
private void XtraForm1_Load(object sender, EventArgs e) {
if (xpCollection1.Count == 0) {
var customer1 = new Customer(session1);
customer1.Name = "John";
customer1.Age = 21;
customer1.Save();
xpCollection1.Add(customer1);
var customer2 = new Customer(session1);
customer2.Name = "Bob";
customer2.Age = 37;
customer2.Save();
xpCollection1.Add(customer2);
}
}
}
}