/// <summary> /// 编辑 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void hlEdit_Click(object sender, RoutedEventArgs e) { ProductDiscussQueryVM item = this.QueryResultGrid.SelectedItem as ProductDiscussQueryVM; UCEditProductDiscuss usercontrol = new UCEditProductDiscuss(); usercontrol.SysNo = item.SysNo.Value; usercontrol.Dialog = Window.ShowDialog(ResComment.Title_EditProductDiscuss, usercontrol, (obj, args) => { QueryResultGrid.Bind(); }); }
public override void OnPageLoad(object sender, EventArgs e) { facade = new ProductDiscussQueryFacade(this); filter = new ProductDiscussQueryFilter(); filterReply = new ProductDiscussReplyQueryFilter(); model = new ProductDiscussQueryVM(); modelReply = new ProductDiscussReplyQueryVM(); model.ChannelID = "1"; modelReply.ChannelID = "1"; model.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode; modelReply.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode; //商品状态 comProductStatus.ItemsSource = EnumConverter.GetKeyValuePairs <ECCentral.BizEntity.IM.ProductStatus>(EnumConverter.EnumAppendItemType.All); comReplyProductStatus.ItemsSource = EnumConverter.GetKeyValuePairs <ECCentral.BizEntity.IM.ProductStatus>(EnumConverter.EnumAppendItemType.All); CodeNamePairHelper.GetList("MKT", "ReplyStatus", CodeNamePairAppendItemType.All, (obj, args) => { if (args.FaultsHandle()) { return; } comDiscussStatus.ItemsSource = args.Result; comReplyReviewStatus.ItemsSource = args.Result; }); //顾客类型 CodeNamePairHelper.GetList("MKT", "CustomerCategory", CodeNamePairAppendItemType.All, (obj, args) => { if (args.FaultsHandle()) { return; } comCustomerCategory.ItemsSource = args.Result; comReplyCustomerCategory.ItemsSource = args.Result; }); //回复类型 //CodeNamePairHelper.GetList("MKT", "ReplySource", CodeNamePairAppendItemType.All, (obj, args) => //{ // if (args.FaultsHandle()) return; // comReplyStatus.ItemsSource = args.Result; //}); ProductDiscussBaseInfo.DataContext = model; btnStackPanel.DataContext = model; replySection.DataContext = modelReply; btnReplyStackPanel.DataContext = modelReply; base.OnPageLoad(sender, e); }
private void UCEditProductDiscuss_Loaded(object sender, RoutedEventArgs e) { Loaded -= new RoutedEventHandler(UCEditProductDiscuss_Loaded); facade = new ProductDiscussQueryFacade(CPApplication.Current.CurrentPage); facade.LoadProductDiscuss(SysNo, (s, args) => { if (args.FaultsHandle()) { return; } vm = args.Result.Convert <ProductDiscussDetail, ProductDiscussQueryVM>(); QueryResultGrid.ItemsSource = vm.ProductDiscussReplyList; LayoutRoot.DataContext = vm; }); }
/// <summary> /// 添加回复 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAndReply_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(tbReplyContent.Text)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResComment.Information_ReplyContentIsNotNull, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Warning); } else { ProductDiscussReply item = vm.ConvertVM <ProductDiscussQueryVM, ProductDiscussReply>(); item.Status = "A";//回复的初始化状态 item.DiscussSysNo = vm.SysNo.Value; item.Content = tbReplyContent.Text; item.NeedAdditionalText = cbNeedAdditionalText.IsChecked.Value ? YNStatus.Yes : YNStatus.No; item.CompanyCode = Newegg.Oversea.Silverlight.ControlPanel.Core.CPApplication.Current.CompanyCode; facade.CreateProductDiscussReply(item, (s, args) => { if (args.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert(ResComment.Information_OperateSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information); facade.LoadProductDiscuss(SysNo, (s2, args2) => { if (args2.FaultsHandle()) { return; } vm = args2.Result.Convert <ProductDiscussDetail, ProductDiscussQueryVM>(); QueryResultGrid.ItemsSource = vm.ProductDiscussReplyList; }); }); } }