public override void OnPageLoad(object sender, EventArgs e)
 {
     //获取页面信息
     model = new ProductBrandWarrantyQueryVM();
     QuerySection.DataContext = model;
     facade = new ProductBrandWarrantyFacade(this);
     this.QueryResultGrid.LoadingDataSource += new EventHandler <LoadingDataEventArgs>(QueryResultGrid_LoadingDataSource);
 }
예제 #2
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            ProductBrandWarrantyFacade facade = new ProductBrandWarrantyFacade();
            var vm = DataContext as ProductBrandWarrantyQueryVM;

            if (vm == null || !ValidationManager.Validate(this))
            {
                return;
            }
            if (ValidatePage(vm))
            {
                //新增
                if (EditSysNos == null)
                {
                    facade.BrandWarrantyInfoByAddOrUpdate(vm, (obj, arg) =>
                    {
                        if (arg.FaultsHandle())
                        {
                            return;
                        }
                        CPApplication.Current.CurrentPage.Context.Window.MessageBox.Show("保存成功!", MessageBoxType.Success);
                    });
                }
                else
                {
                    //批量更新
                    facade.UpdateBrandWarrantyInfoBySysNo(EditSysNos, vm, (obj, arg) =>
                    {
                        if (arg.FaultsHandle())
                        {
                            return;
                        }
                        CPApplication.Current.CurrentPage.Context.Window.MessageBox.Show("保存成功!", MessageBoxType.Success);
                    });
                }
                CloseDialog(DialogResultType.OK);
            }
        }