public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); _viewModel = new ProductStepPriceQueryFilterVM(); _facade = new ProductPriceRequestFacade(this); QueryFilter.DataContext = _viewModel; }
private void Save(ProductPriceRequestInfo entity) { _facade = new ProductPriceRequestFacade(); _facade.AuditProductPriceRequest(entity, (obj, args) => { if (args.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert("操作成功"); CloseDialog(DialogResultType.OK); }); }
public ProductStepPriceMaintain(ProductStepPriceInfoVM entity) { InitializeComponent(); if (entity == null) { _view = new ProductStepPriceInfoVM(); ucProductPicker.IsEnabled = true; } else { _view = entity; ucProductPicker.IsEnabled = false; } _facade = new ProductPriceRequestFacade(CPApplication.Current.CurrentPage); LayoutRoot.DataContext = _view; }
private void btnNoPass_Click(object sender, System.Windows.RoutedEventArgs e) { var checkResult = CheckDemo(); if (!checkResult) { return; } var entity = GetProductPriceRequestInfo(ProductPriceRequestStatus.Deny); _facade = new ProductPriceRequestFacade(); _facade.AuditProductPriceRequest(entity, (obj, args) => { if (args.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert("操作成功"); CloseDialog(DialogResultType.OK); }); }
public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); #region 2012-12-18 Jack.G.tang Update /* *修改目的:点击商品列表中的价格链接到此页面,并选中价格tab 其他tab禁用 * 新加一个方法(SetTabFocus)和以下代码 */ string opertionType = string.Empty; string tempSysNo = string.Empty; string cookieTabIndex = string.Empty; if (this.Request.QueryString != null) { opertionType = this.Request.QueryString["operation"]; tempSysNo = this.Request.QueryString["ProductSysNo"]; } if (!string.IsNullOrEmpty(Request.Param)) { tempSysNo = Request.Param; } #endregion this.ucProductMaintainProperty.MyWindow = Window; this.ucProductMaintainAccessory.MyWindow = Window; this.productEntryInfo.MyWindow = Window; int productSysNo; if (Int32.TryParse(tempSysNo, out productSysNo)) { _productFacade = new ProductFacade(this); _vm = new ProductVM(); //cookieTabIndex = GetCookie("CookieTabIndex"); _productLineFacade = new ProductLineFacade(this); ucProductMaintainBasicInfo.ucSpecificationInfo.ucCategoryPicker.LoadCategoryCompleted += (s, args2) => _productFacade.GetProductInfo(productSysNo, (obj, args) => { if (args.FaultsHandle()) { return; } if (args.Result == null || args.Result.ProductBasicInfo == null) { Window.MessageBox.Show("无此商品或商品数据完整性有误,请联系管理员检查", MessageBoxType.Error); return; } if (!_vm.HasItemMaintainAllTypePermission && args.Result.ProductBasicInfo.ProductType != ProductType.OpenBox) { Window.MessageBox.Show("该商品不是二手品,无此商品访问权限!", MessageBoxType.Error); return; } var pmQueryFacade = new PMQueryFacade(CPApplication.Current.CurrentPage); var pmQueryFilter = new ProductManagerQueryFilter { UserName = CPApplication.Current.LoginUser.LoginName, CompanyCode = CPApplication.Current.CompanyCode }; if (AuthMgr.HasFunctionPoint(AuthKeyConst.IM_SeniorPM_Query))//高级权限 { pmQueryFilter.PMQueryType = PMQueryType.All.ToString(); } else if (AuthMgr.HasFunctionPoint(AuthKeyConst.IM_JuniorPM_Query)) { pmQueryFilter.PMQueryType = PMQueryType.SelfAndInvalid.ToString(); } else { pmQueryFilter.PMQueryType = PMQueryType.None.ToString(); } int c3sysno = args.Result.ProductBasicInfo.ProductCategoryInfo.SysNo.HasValue ? args.Result.ProductBasicInfo.ProductCategoryInfo.SysNo.Value : 0; int brandsysno = args.Result.ProductBasicInfo.ProductBrandInfo.SysNo.HasValue ? args.Result.ProductBasicInfo.ProductBrandInfo.SysNo.Value : 0; int usersysno = CPApplication.Current.LoginUser.UserSysNo.Value; _productLineFacade.HasRightByPMUser(usersysno , c3sysno , brandsysno, (pmobj, pmargs) => { if (pmargs.FaultsHandle()) { return; } bool userright = AuthMgr.HasFunctionPoint(AuthKeyConst.IM_SeniorPM_Query); if (!userright) { if (!pmargs.Result) { Window.MessageBox.Show("无此商品访问权限!", MessageBoxType.Error); return; } } _vm.ProductSysNo = args.Result.SysNo; #region 商品退换货信息需要productSysNo productRmaPolicy.ProductSysNo = _vm.ProductSysNo; #endregion _vm.Note = args.Result.ProductBasicInfo.Note; _vm.ProductMaintainBasicInfo = new ProductMaintainBasicInfoVM { ProductMaintainBasicInfoSpecificationInfo = _productFacade.ConvertProductEntityToProductMaintainBasicInfoSpecificationInfoVM(args.Result), ProductMaintainBasicInfoDisplayInfo = _productFacade.ConvertProductEntityToProductMaintainBasicInfoDisplayInfoVM(args.Result), ProductMaintainBasicInfoStatusInfo = _productFacade.ConvertProductEntityToProductMaintainBasicInfoStatusInfoVM(args.Result), ProductMaintainBasicInfoChannelInfo = _productFacade.ConvertProductEntityToProductMaintainBasicInfoChannelInfoVM(args.Result), ProductMaintainBasicInfoDescriptionInfo = _productFacade.ConvertProductEntityToProductMaintainBasicInfoDescriptionInfoVM(args.Result), ProductMaintainBasicInfoOther = _productFacade.ConvertProductEntityToProductMaintainBasicInfoOtherVM(args.Result) }; _vm.ProductMaintainDescription = _productFacade.ConvertProductEntityToProductMaintainDescriptionVM(args.Result); _vm.ProductMaintainBatchManagementInfo = _productFacade.ConvertProductEntityToProductMaintainBatchManagementInfoVM(args.Result); _vm.ProductMaintainAccessory = new ProductMaintainAccessoryVM { ProductAccessoryList = _productFacade.ConvertProductEntityToProductMaintainAccessoryProductAccessoryVMList(args.Result), IsAccessoryShow = args.Result.ProductBasicInfo.IsAccessoryShow }; _vm.ProductMaintainImage = _productFacade.ConvertProductEntityToProductMaintainImageVM(args.Result); var priceInfo = _productFacade.ConvertProductEntityToProductMaintainPriceInfoVM(args.Result); if (args.Result.ProductConsignFlag == VendorConsignFlag.Consign && args.Result.Merchant.SysNo != -1) { priceInfo.ProductMaintainPriceInfoBasicPrice.HasMinCommissionVisible = "Visible"; } _vm.ProductMaintainPriceInfo = priceInfo; //_vm.ProductMaintainThirdPartyInventory = _productFacade.ConvertProductEntityToProductMaintainThirdPartyInventoryVM(args.Result); _productFacade.GetProductGroup(productSysNo, (o, group) => { if (@group.FaultsHandle()) { return; } _vm.ProductMaintainCommonInfo = @group.Result.SysNo.HasValue ? _productFacade.ConvertProductGroupEntityToProductMaintainCommonInfoVM(@group.Result, args.Result) : _productFacade.ConvertProductEntityToProductMaintainCommonInfoVM(args.Result); _vm.ProductMaintainProperty = _productFacade.ConvertProductEntityToProductMaintainPropertyVM(args.Result, group.Result); _productFacade.GetPropertyValueList(args.Result.ProductBasicInfo.ProductProperties.Select(p => p.Property.PropertyInfo.SysNo.HasValue ? p.Property.PropertyInfo.SysNo.Value : 0).ToList(), (ob, arg) => { if (args.FaultsHandle()) { return; } foreach (var productMaintainPropertyPropertyValueVM in _vm.ProductMaintainProperty.ProductPropertyValueList) { productMaintainPropertyPropertyValueVM.PropertyValueList = new List <PropertyValueVM>(); foreach (var i in arg.Result.Keys) { if (productMaintainPropertyPropertyValueVM.Property.SysNo == i) { productMaintainPropertyPropertyValueVM.PropertyValueList = _productFacade.ConvertPropertyValueInfoToPropertyValueVM(arg.Result[i]); } } productMaintainPropertyPropertyValueVM.PropertyValueList.Insert(0, new PropertyValueVM { SysNo = 0, ValueDescription = "请选择..." }); } DataContext = _vm; }); _vm.ProductMaintainWarranty = _productFacade.ConvertProductEntityToProductMaintainWarrantyVM(args.Result); _vm.ProductMaintainDimension = _productFacade.ConvertProductEntityToProductMaintainDimensionVM(args.Result); _vm.ProductMaintainPurchaseInfo = _productFacade.ConvertProductEntityToProductMaintainPurchaseInfoVM(args.Result); _vm.ProductMaintainSalesArea = new ProductMaintainSalesAreaVM { ProductMaintainSalesAreaSaveList = _productFacade.ConvertProductInfoEntityToProductMaintainSalesAreaSelectVM(args.Result) }; DataContext = _vm; ucProductMaintainCommonInfo.dgRelatedProduct.ItemsSource = _vm.ProductMaintainCommonInfo.GroupProductList; foreach (var control in VM.ProductMaintainImage.ProductImageList.Select(i => new ProductMaintainProductImageSingle { VM = i })) { ucProductMaintainImage.ImageListPanel.Children.Add(control); } //Ocean.20130523. 记录上次打开的Tab,会引起商品属性的加载,暂时屏蔽此功能 //int cookieTabIndexVal = 0; //if (!string.IsNullOrEmpty(cookieTabIndex) && int.TryParse(cookieTabIndex, out cookieTabIndexVal)) //{ // ucProductTabList.SelectedIndex = cookieTabIndexVal; //} var areaFacade = new AreaQueryFacade(); areaFacade.QueryProvinceAreaList((areaObj, areaArgs) => { if (areaArgs.FaultsHandle()) { return; } List <ProvinceVM> provinceList = _productFacade.ConvertAreaInfoEntityToProvinceVM(areaArgs.Result); provinceList.Insert(0, new ProvinceVM { ProvinceSysNo = 0, ProvinceName = "请选择..." }); ucProductMaintainSalesArea.cmbProvinceList.ItemsSource = provinceList; ucProductMaintainSalesArea.cmbProvinceList.SelectedValue = 0; List <CityVM> cityList = new List <CityVM>(); cityList.Insert(0, new CityVM { CitySysNo = 0, CityName = "请选择..." }); ucProductMaintainSalesArea.cmbCityList.ItemsSource = cityList; ucProductMaintainSalesArea.cmbCityList.SelectedValue = 0; SetTabFocus(opertionType); }); _facade = new ProductPriceRequestFacade(); _facade.GetProductStepPricebyProductSysNo(productSysNo, (priceobj, priceargs) => { if (priceargs.FaultsHandle()) { return; } VM.ProductMaintainStepPrice.QueryResultList = priceargs.Result; VM.ProductMaintainStepPrice.ProductSysNo = VM.ProductSysNo; }); }); }); if (args.Result.ProductConsignFlag == VendorConsignFlag.GroupBuying || (args.Result.ProductBasicInfo != null && args.Result.ProductBasicInfo.TradeType == TradeType.Internal)) { productEntryInfo_tab.Visibility = System.Windows.Visibility.Collapsed; } }); //TLYH去除商品备案功能 by Key on 2015/7/23 //if (AuthMgr.HasFunctionPoint(AuthKeyConst.IM_ProductMaintain_ItemProductMaintainEntryInfo)) //{ // productEntryInfo_tab.Visibility = System.Windows.Visibility.Visible; //} } else { Window.MessageBox.Show("无效商品编号", MessageBoxType.Error); } }
private void BindPage() { if (SysNo > 0) { txtProductID.Text = ProductID; _facade = new ProductPriceRequestFacade(); _facade.GetNeweggProductPriceRequestBySysNo(SysNo, (obj, args) => { if (args.FaultsHandle()) { return; } if (args.Result == null) { CPApplication.Current.CurrentPage.Context.Window.Alert("没有获得商品价格审核对象"); return; } _vm = new ProductPriceRequestVM() { Category = args.Result.PriceRequestMsg.Category, AlipayVipPrice = args.Result.PriceRequestMsg.AlipayVipPrice, AuditTime = args.Result.PriceRequestMsg.AuditTime, AuditType = args.Result.PriceRequestMsg.AuditType, AuditUser = args.Result.PriceRequestMsg.AuditUser, AvailableQty = args.Result.PriceRequestMsg.AvailableQty, BasicPrice = args.Result.PriceRequestMsg.BasicPrice, CashRebate = args.Result.PriceRequestMsg.CashRebate, ConsignQty = args.Result.PriceRequestMsg.ConsignQty, CreateUser = args.Result.PriceRequestMsg.CreateUser, CurrentPrice = args.Result.PriceRequestMsg.CurrentPrice, DenyReason = args.Result.PriceRequestMsg.DenyReason, DiscountAmount = args.Result.PriceRequestMsg.DiscountAmount, FinalAuditUser = args.Result.PriceRequestMsg.FinalAuditUser, FinalAuditTime = args.Result.PriceRequestMsg.FinalAuditTime, IsExistRankPrice = args.Result.PriceRequestMsg.IsExistRankPrice, IsUseAlipayVipPrice = args.Result.PriceRequestMsg.IsUseAlipayVipPrice, IsWholeSale = args.Result.PriceRequestMsg.IsWholeSale, LastInTime = args.Result.PriceRequestMsg.LastInTime, LastUpdateTime = args.Result.PriceRequestMsg.LastUpdateTime, Margin = args.Result.PriceRequestMsg.Margin, MarginAmount = args.Result.PriceRequestMsg.MarginAmount, MaxCountPerDay = args.Result.PriceRequestMsg.MaxCountPerDay, MinCountPerOrder = args.Result.PriceRequestMsg.MinCountPerOrder, NewMargin = args.Result.PriceRequestMsg.NewMargin, NewMarginAmount = args.Result.PriceRequestMsg.NewMarginAmount, PayType = args.Result.PriceRequestMsg.PayType, PMDMemo = args.Result.PriceRequestMsg.PMDMemo, PMMemo = args.Result.PriceRequestMsg.PMMemo, Point = args.Result.PriceRequestMsg.Point, ProductRankPrice = args.Result.PriceRequestMsg.ProductRankPrice, ProductWholeSalePriceInfo = args.Result.PriceRequestMsg.ProductWholeSalePriceInfo, RequestStatus = args.Result.PriceRequestMsg.RequestStatus, SysNo = args.Result.PriceRequestMsg.SysNo, UnitCost = args.Result.PriceRequestMsg.UnitCost, UnitCostWithoutTax = args.Result.PriceRequestMsg.UnitCostWithoutTax, VirtualPrice = args.Result.PriceRequestMsg.VirtualPrice, TLMemo = args.Result.PriceRequestMsg.TLMemo, GiftSysNo = args.Result.PriceRequestMsg.GiftSysNo, CouponSysNo = args.Result.PriceRequestMsg.CouponSysNo }; _vm.OldPrice = args.Result.PriceRequestMsg.OldPrice.Convert <ProductPriceInfo, ProductPriceInfoVM>(); DataContext = _vm; BindOptionalAccessories(args.Result.PromotionMsg); if (_vm.RequestStatus == ProductPriceRequestStatus.Origin) { tb_PMDMemo.IsReadOnly = true; } else if (_vm.RequestStatus == ProductPriceRequestStatus.NeedSeniorApprove) { tb_TLMemo.IsReadOnly = true; } }); } else { CPApplication.Current.CurrentPage.Context.Window.Alert("没有获得商品价格审核对象"); return; } }