Exemplo n.º 1
0
        protected void ValidSubmit(EditContext context)
        {
            using (var transaction = PinhuaContext.Database.BeginTransaction())
            {
                try
                {
                    PinhuaContext.RecordEdit <dto字典, tb_字典表>(main);

                    Action <dto字典D> adding = item =>
                    {
                        item.字典号 = main.字典号;
                        item.组号  = main.组号;
                    };

                    Action <dto字典D> updating = item =>
                    {
                        item.字典号 = main.字典号;
                        item.组号  = main.组号;
                    };

                    var remote = PinhuaContext.RecordDetailsEdit <dto字典, dto字典D, tb_字典表, tb_字典表D>(main, detailsTableDataSource, adding, updating);

                    PinhuaContext.SaveChanges();
                    transaction.Commit();

                    Navigation.NavigateTo(routeA);
                }
                catch (Exception)
                {
                    transaction.Rollback();
                }
            }
        }
Exemplo n.º 2
0
        protected void HandleValidSubmit(EditContext context)
        {
            using (var transaction = PinhuaContext.Database.BeginTransaction())
            {
                try
                {
                    var remote = PinhuaContext.RecordEdit <dto往来, tb_往来表>(main);

                    transaction.Commit();

                    Navigation.NavigateTo(routeA);
                }
                catch (Exception)
                {
                    transaction.Rollback();
                }
            }
        }