示例#1
0
        private async void LoadDataFromServer(object sender, RoutedEventArgs e)
        {
            try
            {
                var Ds = new DevExpress.Xpo.DB.InMemoryDataStore(DevExpress.Xpo.DB.AutoCreateOption.DatabaseAndSchema, true);
                XpoHelper.InitXpo(Ds);

                BoLogic.CreateCustomer(1, "Joche Ojeda");
                BoLogic.CreateCustomer(2, "Jaime Macias");
                BoLogic.CreateCustomer(3, "Javier Columbie");
                BoLogic.CreateCustomer(4, "Rafael Gonzales");
                BoLogic.CreateCustomer(5, "Rocco Ojeda");
                BoLogic.CreateInvoice(new System.DateTime(2020, 1, 1), 1);

                var Count = XpoHelper.CreateUnitOfWork().Query <Invoice>().Count();
                Console.WriteLine("Its working");
                this.LoadData.Content = "Its working";
                XPCollection <Customer> customer = new XPCollection <Customer>(XpoHelper.CreateUnitOfWork());
                this.MasterListView.ItemsSource = customer;
            }
            catch (Exception ex)
            {
                var messsa = ex.Message;
                throw ex;
            }
        }
        protected override void OnStart(string[] args)
        {
            XpoHelper.InitXpo(_ConnectionString);

            var Ds = new DevExpress.Xpo.DB.InMemoryDataStore(DevExpress.Xpo.DB.AutoCreateOption.DatabaseAndSchema, true);

            XpoHelper.InitXpo(Ds);

            BoLogic.CreateCustomer("001", "Joche Ojeda");

            BoLogic.CreateInvoice(new System.DateTime(2020, 1, 1), "001");
        }
        static void Main(string[] args)
        {
            var Ds = new DevExpress.Xpo.DB.InMemoryDataStore(DevExpress.Xpo.DB.AutoCreateOption.DatabaseAndSchema, true);

            XpoHelper.InitXpo(Ds);

            BoLogic.CreateCustomer("001", "Joche Ojeda");

            BoLogic.CreateInvoice(new System.DateTime(2020, 1, 1), "001");

            var Count = XpoHelper.CreateUnitOfWork().Query <Invoice>().Count();
        }
示例#4
0
        public void TestBusinessObject()
        {
            var Ds = new DevExpress.Xpo.DB.InMemoryDataStore(DevExpress.Xpo.DB.AutoCreateOption.DatabaseAndSchema, true);

            XpoHelper.InitXpo(Ds);

            BoLogic.CreateCustomer("001", "Joche Ojeda");

            BoLogic.CreateInvoice(new System.DateTime(2020, 1, 1), "001");

            var Count = XpoHelper.CreateUnitOfWork().Query <Invoice>().Count();


            Assert.AreEqual(1, Count);
        }