private void btnNew_Click(object sender, RoutedEventArgs e) { ShipTypeSMSMaintain DialogPage = new ShipTypeSMSMaintain(); DialogPage.Dialog = this.Window.ShowDialog(ECCentral.Portal.UI.Customer.Resources.ResShipTypeSMSQuery.Title_Add, DialogPage, (obj, args) => { if (args.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK) { dataGrid1.Bind(); } }); }
private void btnEdit_Click(object sender, RoutedEventArgs e) { if (dataGrid1.SelectedItem != null) { ShipTypeSMSVM vm = DynamicConverter <ShipTypeSMSVM> .ConvertToVM(dataGrid1.SelectedItem, "SMSType"); //渠道信息何用 vm.ChannelID = "1"; vm.SMSType = (dataGrid1.SelectedItem as dynamic).SMSTypeSysNo; ShipTypeSMSMaintain DialogPage = new ShipTypeSMSMaintain(); DialogPage.viewModel.EntityVM = vm; DialogPage.Dialog = this.Window.ShowDialog(ECCentral.Portal.UI.Customer.Resources.ResShipTypeSMSQuery.Title_Edit, DialogPage, (obj, args) => { if (args.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK) { dataGrid1.Bind(); } }); } else { CPApplication.Current.CurrentPage.Context.Window.MessageBox.Show("请先选中一条数据"); } }