private void Dialog(ProductStepPriceInfoVM entity)
        {
            ProductStepPriceMaintain maintain = new ProductStepPriceMaintain(entity)
            {
                Page = this
            };

            maintain.DiolgHander = Window.ShowDialog(entity == null ? "新建阶梯价格" : "编辑阶梯价格", maintain, (s, args) =>
            {
                if (args.DialogResult == DialogResultType.OK)
                {
                    QueryResult.Bind();
                }
            });
        }
 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 Hyperlink_EditData_Click(object sender, RoutedEventArgs e)
        {
            ProductStepPriceInfoVM entity = new ProductStepPriceInfoVM();
            dynamic row = QueryResult.SelectedItem;

            if (row != null)
            {
                entity.SysNo        = row.SysNo;
                entity.ProductSysNo = row.ProductSysNo;
                entity.ProductID    = row.ProductID.ToString();
                entity.BaseCount    = row.BaseCount;
                entity.TopCount     = row.TopCount;
                entity.StepPrice    = row.StepPrice.ToString();
                Dialog(entity);
            }
        }
 public ProductMaintainStepPriceVM()
 {
     AddEntity       = new ProductStepPriceInfoVM();
     QueryResultList = new List <ProductStepPriceInfoVM>();
 }
Exemple #5
0
        /// <summary>
        /// 创建阶梯价格
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="callback"></param>
        public void CreateProductStepPrice(ProductStepPriceInfoVM entity, EventHandler <RestClientEventArgs <int> > callback)
        {
            string url = "/IMService/Product/CreateProductStepPrice";

            _restClient.Query(url, entity, callback);
        }
 private void Reset_Click(object sender, RoutedEventArgs e)
 {
     _view = new ProductStepPriceInfoVM();
     LayoutRoot.DataContext = _view;
 }