public void UpdateBrandRecommended(BrandRecommendedVM model, EventHandler <RestClientEventArgs <dynamic> > callback) { BrandRecommendedInfo info = new BrandRecommendedInfo() { //BrandRank = model.BrandRank, BrandSysNo = model.BrandSysNo.Value, Level_Name = model.Level_Name, Sysno = model.Sysno, User = new UserInfo() { UserName = CPApplication.Current.LoginUser.LoginName, SysNo = CPApplication.Current.LoginUser.UserSysNo } }; restClient.Update(UpdateBrandRecommendedUrl, info, callback); }
private void ButtonCreate_Click(object sender, RoutedEventArgs e) { BrandRecommendedVM model = new BrandRecommendedVM() { Sysno = 0, Level_No = 0, Level_Code = 0 }; BrandRecommendedMaintain maintain = new BrandRecommendedMaintain(); maintain.Brand = model; maintain.myCategoryList.IsEnabled = true; maintain.Dialog = Window.ShowDialog(ResBrandRecommended.ResourceManager.GetString("UpdateReBrand", CurrentCulture), maintain, (s, args) => { if (args.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK) { BrandRecommendedResult.Bind(); } }, new Size(500, 300)); }
private void HyperlinkButton_Click(object sender, RoutedEventArgs e) { dynamic d = this.BrandRecommendedResult.SelectedItem as dynamic; BrandRecommendedVM model = new BrandRecommendedVM() { Sysno = d.SysNo, BrandSysNo = d.BrandSysNo, Level_Name = d.Level_Name, Level_No = d.Level_No, Level_Code = d.Level_Code }; BrandRecommendedMaintain maintain = new BrandRecommendedMaintain(); maintain.Brand = model; maintain.myCategoryList.Level_No = model.Level_No; maintain.myCategoryList.Level_Code = model.Level_Code; maintain.myCategoryList.IsEnabled = false; maintain.ucBrandPicker.SelectedBrandName = d.BrandName; maintain.Dialog = Window.ShowDialog(ResBrandRecommended.ResourceManager.GetString("UpdateReBrand", CurrentCulture), maintain, (s, args) => { if (args.DialogResult == Newegg.Oversea.Silverlight.Controls.Components.DialogResultType.OK) { BrandRecommendedResult.Bind(); } }, new Size(560, 400)); }
private void btnOk_Click(object sender, RoutedEventArgs e) { if (!ValidationManager.Validate(this)) { return; } BrandRecommendedVM model = this.DataContext as BrandRecommendedVM; //if (model.BrandRank.Split(',').Count() > 20) //{ // CPApplication.Current.CurrentPage.Context.Window.Alert("编辑失败,至多输入20个推荐品牌", MessageType.Warning); // return; //} if (model.Sysno == 0) //新增 { model.Level_No = (int)this.myCategoryList.cbTopCatrory.SelectedValue; if (model.Level_No == 0) { model.Level_Code = 0; //model.Level_Name = string.Empty; } else if (model.Level_No == 1) { model.Level_Code = (int)this.myCategoryList.cbShow1Catrory.SelectedValue; //model.Level_Name = string.Empty; } else if (model.Level_No == 2) { model.Level_Code = (int)this.myCategoryList.cbShow2Catrory.SelectedValue; //model.Level_Name = string.Empty; } if (model.Level_No > 0 && model.Level_No < 3 && model.Level_Code == 0) { CPApplication.Current.CurrentPage.Context.Window.Alert("请选择一个类别!", MessageType.Warning); return; } if (!model.BrandSysNo.HasValue || model.BrandSysNo.Value == 0) { CPApplication.Current.CurrentPage.Context.Window.Alert("请选择一个品牌!", MessageType.Warning); return; } facade.CreateBrandRecommended(model, (obj, arg) => { if (arg.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert(ResComment.Information_SettingSuccessful); CloseDialog(DialogResultType.OK); }); } else { if (!model.BrandSysNo.HasValue || model.BrandSysNo.Value == 0) { CPApplication.Current.CurrentPage.Context.Window.Alert("请选择一个品牌!", MessageType.Warning); return; } facade.UpdateBrandRecommended(model, (obj, arg) => { if (arg.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert(ResComment.Information_UpdateSuccessful); CloseDialog(DialogResultType.OK); }); } }