Ejemplo n.º 1
0
        private void btnEdit_Click(object sender, RoutedEventArgs e)
        {
            HyperlinkButton btn = sender as HyperlinkButton;
            dynamic         d   = btn.DataContext as dynamic;
            ProductDomainVM vm  = DynamicConverter <ProductDomainVM> .ConvertToVM(d);

            string      listStr   = d.DepartmentMerchandiserSysNoListStr;
            List <int?> sysNoList = new List <int?>();

            if (!string.IsNullOrEmpty(listStr))
            {
                var list = listStr.Split(new char[] { ';' }).ToList();
                list.ForEach(p =>
                {
                    sysNoList.Add(int.Parse(p));
                });
            }
            vm.DepartmentMerchandiserSysNoList = sysNoList;
            UCProductDomainDetail uc = new UCProductDomainDetail(vm);

            IDialog dialog = CPApplication.Current.CurrentPage.Context.Window.ShowDialog("修改Domain信息", uc, (obj, args) =>
            {
                if (args.DialogResult == DialogResultType.OK)
                {
                    this.BindData(this.dataProductDomainList.QueryCriteria);
                }
            });

            uc.Dialog = dialog;
        }
        private void btnNew_Click(object sender, RoutedEventArgs e)
        {
            var vm = new ProductDomainVM();
            UCProductDomainDetail uc = new UCProductDomainDetail(vm);
            IDialog dialog           = Window.ShowDialog("添加Domain", uc, (obj, args) =>
            {
                if (args.DialogResult == DialogResultType.OK)
                {
                    this.ListControl.BindData(this.Filter);
                }
            });

            uc.Dialog = dialog;
        }
Ejemplo n.º 3
0
        public void UpdateDomain(ProductDomainVM vm, EventHandler <RestClientEventArgs <ProductDomain> > callback)
        {
            string relativeUrl = "/IMService/ProductDomain/UpdateDomain";
            var    msg         = vm.ConvertVM <ProductDomainVM, ProductDomain>();

            msg.ProductDomainName.Content = vm.ProductDomainName;
            var selected = vm.DepartmentMerchandiserListForUI.Where(p => p.IsChecked).ToList();

            msg.DepartmentMerchandiserSysNoList = selected.Select(p => p.SysNo).ToList();

            restClient.Update <ProductDomain>(relativeUrl, msg, (obj, args) =>
            {
                if (args.FaultsHandle())
                {
                    return;
                }

                callback(obj, args);
            });
        }
Ejemplo n.º 4
0
 public UCProductDomainDetail(ProductDomainVM vm)
     : this()
 {
     this.VM = vm;
 }