예제 #1
0
        /// <summary>
        /// 更新礼品券商品
        /// </summary>
        /// <param name="voucherProductVM"></param>
        /// <param name="callback"></param>
        public void UpdateVoucherProductInfo(GiftCardProductVM voucherProductVM, Action <GiftCardProductVM> callback)
        {
            string             relativeUrl = "/IMService/GiftCardInfo/UpdateVoucherProductInfo";
            GiftVoucherProduct entity      = new GiftVoucherProduct();

            entity.RelationProducts = new List <GiftVoucherProductRelation>();

            entity = voucherProductVM.ConvertVM <GiftCardProductVM, GiftVoucherProduct>((s, t) =>
            {
                foreach (var s1 in s.RelationProducts)
                {
                }
            });

            entity.Status = GiftVoucherProductStatus.Audit;

            restClient.Create <GiftVoucherProduct>(relativeUrl, entity, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                var vm = args.Result.Convert <GiftVoucherProduct, GiftCardProductVM>();

                callback(vm);
            });
        }
        public override void OnPageLoad(object sender, EventArgs e)
        {
            base.OnPageLoad(sender, e);

            this._voucherProductVM = new GiftCardProductVM();
            this._facade           = new GiftCardFacade(this);
            selected = new List <int>();
            this.voucherProduct.ProductSelected += voucherProduct_ProductSelected;

            _facade.GetGiftCardC3SysNo((no) =>
            {
                _c3SysNo = no;
            });
            if (RequestSysNo.HasValue)
            {
                this._voucherProductVM.SysNo = RequestSysNo.Value;

                _facade.GetGiftVoucherProductInfo(RequestSysNo.Value, (ret) =>
                {
                    this._voucherProductVM = ret;
                    foreach (var item in this._voucherProductVM.RelationProducts)
                    {
                        item.IsChecked = false;
                    }
                    SetDataContext();
                });
            }
            else
            {
                //this.voucherProductgd
                SetDataContext();
            }
        }
        void UCGiftCardProductMaintain_Loaded(object sender, RoutedEventArgs e)
        {
            Loaded                     -= new RoutedEventHandler(UCGiftCardProductMaintain_Loaded);
            facade                      = new GiftCardFacade(CPApplication.Current.CurrentPage);
            giftCardProductVM           = giftCardProductVM ?? new GiftCardProductVM();
            this.LayoutRoot.DataContext = giftCardProductVM;

            voucherProduct.ProductSelected += voucherProduct_ProductSelected;

            facade.GetGiftCardC3SysNo((no) =>
            {
                C3SysNo = no;
            });
        }
예제 #4
0
        /// <summary>
        /// 添加礼品券商品
        /// </summary>
        /// <param name="voucherProductVM"></param>
        /// <param name="callback"></param>
        public void AddGiftVoucherProductInfo(GiftCardProductVM voucherProductVM, Action <int> callback)
        {
            string             relativeUrl = "/IMService/GiftCardInfo/AddGiftVoucherProductInfo";
            GiftVoucherProduct entity      = new GiftVoucherProduct();

            entity.RelationProducts = new List <GiftVoucherProductRelation>();

            entity = voucherProductVM.ConvertVM <GiftCardProductVM, GiftVoucherProduct>((s, t) =>
            {
            });

            restClient.Create <int>(relativeUrl, entity, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }
                callback(args.Result);
            });
        }
예제 #5
0
        private void hlEdit_Click(object sender, RoutedEventArgs e)
        {
            var selected = this.giftVoucherProductdg.SelectedItem as dynamic;
            //Window.Navigate(string.Format("/ECCentral.Portal.UI.MKT/GiftCardProductMaintain/{0}", selected.SysNo), null, true);
            UCGiftCardProductMaintain ucMaintain = new UCGiftCardProductMaintain();
            GiftCardProductVM         item       = ECCentral.Portal.Basic.Utilities.DynamicConverter <GiftCardProductVM> .ConvertToVM(selected);

            item.Price = decimal.Parse(item.Price).ToString("f2");
            ucMaintain.giftCardProductVM = item;

            //礼品卡商品维护
            ucMaintain.Dialog = Window.ShowDialog("礼品卡商品维护", ucMaintain, (obj, args) =>
            {
                if (args != null)
                {
                    if (args.DialogResult == DialogResultType.OK)
                    {
                        giftVoucherProductdg.Bind();
                    }
                }
            });
        }