Beispiel #1
0
        public override void OnPageLoad(object sender, EventArgs e)
        {
            base.OnPageLoad(sender, e);
            var productSysNo = Request.Param;

            _detailsVM = new ProductAttachmentDetailsVM();
            _vm        = new ProductAttachmentDetailsListVM();
            _facade    = new ProductAttachmentFacade();
            if (!string.IsNullOrEmpty(productSysNo))
            {
                ucProductPicker.IsEnabled = false;
                if (Int32.TryParse(productSysNo, out _sysNo))
                {
                    _vm.ProductSysNo        = _sysNo;
                    _detailsVM.ProductSysNo = _sysNo;
                    BindPage();
                }
                else
                {
                    Window.Alert("商品编号无效!", MessageType.Error);
                    return;
                }
            }
            else
            {
                ucProductPicker.IsEnabled = true;
            }
            expander1.DataContext = _detailsVM;
        }
Beispiel #2
0
        private void hyperlinkOperationDelete_Click(object sender, RoutedEventArgs e)
        {
            dynamic view = this.dgProductAttachmentQueryResult.SelectedItem as dynamic;

            if (view == null)
            {
                Window.Alert(ResProductAttachmentQuery.Msg_OnSelectProductAttachment, MessageType.Error);
                return;
            }
            if (view.ProductStatus == ProductStatus.Active)
            {
                Window.Alert(ResProductAttachmentQuery.Msg_OnDeleteProductAttachment, MessageType.Error);
                return;
            }
            int productSysNo = view.ProductSysNo;

            Window.Confirm(ResProductAttachmentQuery.Confirm_Delete, (obj, args) =>
            {
                if (args.DialogResult == DialogResultType.OK)
                {
                    ProductAttachmentFacade facade = new ProductAttachmentFacade(this);
                    facade.DeleteAttachmentByProductSysNo(productSysNo, (o, a) =>
                    {
                        if (a.FaultsHandle())
                        {
                            return;
                        }
                        Window.Alert(ResProductAttachmentQuery.Info_Successfully);
                        dgProductAttachmentQueryResult.Bind();
                    });
                }
            });
        }