Example #1
0
 public VIPUpTacticSet()
 {
     this.DataContext = _dataContext;
     InitializeComponent();
     _access = RoleVM.GetCurrentUserDataFormCommand(BasicInfoEnum.VIP策略);
     myRadDataForm.CommandButtonsVisibility = _access;
 }
        public RetailTacticSet()
        {
            this.DataContext = _dataContext;
            InitializeComponent();

            _access = RoleVM.GetCurrentUserDataFormCommand(BasicInfoEnum.零售策略);
            myRadDataForm.CommandButtonsVisibility = _access;
            //if (_access != DataFormCommandButtonsVisibility.All)
            //    RadGridView1.Columns["colOperate"].IsVisible = false;
        }
Example #3
0
        public ReceiveMoney()
        {
            this.DataContext = _dataContext;
            //var list = context.Query.LinqOP.Search<BusiDataDictionary>(o => o.ParentCode == "02" && o.IsEnabled).ToList();
            var list = VMGlobal.DistributionQuery.LinqOP.Search <VoucherItemKind>(o => o.Kind == 2 && o.OrganizationID == VMGlobal.CurrentUser.OrganizationID).ToList();

            this.Resources.Add("itemKinds", list);
            var enabledList = list.FindAll(o => o.IsEnabled);

            this.Resources.Add("enabledItemKinds", enabledList);

            InitializeComponent();
            _access = RoleVM.GetCurrentUserDataFormCommand(BasicInfoEnum.财务收款);
            myRadDataForm.CommandButtonsVisibility = _access;
        }
Example #4
0
        public DeductMoney()
        {
            this.DataContext = _dataContext;
            var list = VMGlobal.DistributionQuery.LinqOP.Search <VoucherItemKind>(o => o.Kind == 1 && o.OrganizationID == VMGlobal.CurrentUser.OrganizationID).ToList();

            this.Resources.Add("itemKinds", list);
            var enabledList = list.FindAll(o => o.IsEnabled);

            this.Resources.Add("enabledItemKinds", enabledList);//不知为何,新增或更新好之后属性ItemKindCode将变为null,我估计直接将列表存储为资源给前台绑定会发生这种情况
            //this.Resources.Add("itemKinds", new FinanceVM());//这样也不行
            //后来发现假如直接用telerik:DataFormComboBoxField绑定的话就有这种问题,因此改为以telerik:RadComboBox绑定,具体请看前台xaml
            //但是其它如品牌下拉绑定都不会产生这个问题,难道是因为DataFormComboBoxField的SelectedValuePath的类型只能为int,不能为string吗?待日后研究

            InitializeComponent();

            _access = RoleVM.GetCurrentUserDataFormCommand(BasicInfoEnum.财务收款);
            myRadDataForm.CommandButtonsVisibility = _access;
        }
        /// <summary>
        /// Returns whether or not the specified type of command button is visible.
        /// </summary>
        /// <param name="commandButtonVisibility">The type of command button.</param>
        /// <returns>Whether or not the type of command button is visible.</returns>
        private bool IsCommandButtonVisible(DataFormCommandButtonsVisibility commandButtonVisibility)
        {
            if (this.CommandButtonsVisibility.HasValue)
            {
                return (this.CommandButtonsVisibility.Value & commandButtonVisibility) == commandButtonVisibility;
            }

            return false;
        }