/// <summary> /// 更新单个选项 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void hlUpdate_Click(object sender, RoutedEventArgs e) { PollItemVM vm = this.PollItemInfoGrid.SelectedItem as PollItemVM; if (string.IsNullOrEmpty(vm.ItemName)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResNewsInfo.Information_PollItemNameIsNull, MessageType.Warning); } else { PollItem item = EntityConvertorExtensions.ConvertVM <PollItemVM, PollItem>(vm, (v, t) => { t.ItemName = new BizEntity.LanguageContent(ConstValue.BizLanguageCode, v.ItemName); }); //PollItemGroup item = vm.ConvertVM<PollItemVM, PollItemGroup>(); facade.UpdatePollItem(item, (obj, args) => { if (args.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert(ResNewsInfo.Information_OperateSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information); PollItemInfoGrid.Bind(); }); } }
void UCEditPollOption_Loaded(object sender, RoutedEventArgs e) { Loaded -= new RoutedEventHandler(UCEditPollOption_Loaded); model = new PollItemVM(); facade = new PollFacade(CPApplication.Current.CurrentPage); PollItemInfo.DataContext = model; if (SysNo > 0) { PollItemInfoGrid.Bind(); } if (pollType != PollType.Other) { this.SearchResult.Visibility = System.Windows.Visibility.Collapsed; } }
/// <summary> /// 数据全部导出 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> //private void PollItemInfoGrid_ExportAllClick(object sender, EventArgs e) //{ // //ColumnSet col = new ColumnSet(this.DataGrid_Product_ResultList); // //col.Insert(0, "ProductId", ResRMAReports.Excel_ProductID, 20) // // .SetWidth("ProductName", 30); // //facade.ExportProductExcelFile(queryVM, new ColumnSet[] { col }); //} /// <summary> /// 删除单个选项 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void hlDelete_Click(object sender, RoutedEventArgs e) { PollItemVM vm = this.PollItemInfoGrid.SelectedItem as PollItemVM; if (vm != null) { facade.DeletePollItem(vm.SysNo.Value, (obj, args) => { if (args.FaultsHandle()) { return; } PollItemInfoGrid.Bind(); }); } }