Exemple #1
0
        public UCPageTypeMaintain(int currentSysNo)
        {
            InitializeComponent();

            if (currentSysNo > 0)
            {
                //当前界面正在编辑模式,加载数据
                _isEditing = true;
                var bannerDimensionFacade = new PageTypeFacade(CPApplication.Current.CurrentPage);
                bannerDimensionFacade.Load(currentSysNo, (s, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    _currentVM           = args.Result.Convert <PageType, PageTypeVM>();
                    _currentVM.ChannelID = "1";
                    _currentVM.Status    = ADStatus.Active;
                    this.DataContext     = _currentVM;
                });
            }
            else
            {
                _isEditing           = false;
                _currentVM           = new PageTypeVM();
                _currentVM.Status    = ADStatus.Active;
                _currentVM.ChannelID = "1";
                this.DataContext     = _currentVM;
            }
        }
Exemple #2
0
        public void Update(PageTypeVM vm, EventHandler <RestClientEventArgs <object> > callback)
        {
            var data = vm.ConvertVM <PageTypeVM, PageType>();

            data.CompanyCode = CPApplication.Current.CompanyCode;
            data.WebChannel  = new WebChannel
            {
                ChannelID = vm.ChannelID
            };
            data.InUser   = CPApplication.Current.LoginUser.DisplayName;
            data.EditUser = CPApplication.Current.LoginUser.DisplayName;
            string relativeUrl = "/MKTService/PageType/Update";

            restClient.Update(relativeUrl, data, callback);
        }