Ejemplo n.º 1
0
        public UserViewModel()
        {
            _querytablecallbackdelegate = new QueryTableCallBackDelegate(QueryTableCallBack);
            _addtablecallbackdelegate   = new AddTableCallBackDelegate(AddTableCallBack);
            _excutesqlCallBackDelegate  = new ExcutesqlCallBackDelegate(ExcutesqlCallBack);

            AddCommand     = new DelegateCommand <object>(Add);
            DeleteCommand  = new DelegateCommand <object>(Delete);
            ModifyCommand  = new DelegateCommand <object>(Modify);
            OperateCommand = new DelegateCommand <object>(Operate);
            QueryCommand   = new DelegateCommand <object>(QueryYongHuguanli);

            FirstPageCommand = new DelegateCommand <object>(FirstPage);
            PrePageCommand   = new DelegateCommand <object>(PrePage);
            NextPageCommand  = new DelegateCommand <object>(NextPage);
            GotoPageCommand  = new DelegateCommand <object>(GotoPage);


            _tableList   = new ObservableCollection <GUANLIYUANModel>();
            _customInfo  = new GUANLIYUANModel();
            _customInfo1 = new GUANLIYUANModel();
            _customInfo1.Youxiaoqikaishi = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd HH:mm:ss");
            _customInfo1.Youxiaoqijieshu = DateTime.Now.AddDays(7).ToString("yyyy-MM-dd HH:mm:ss");

            _pagePercent = "0/0";
        }
Ejemplo n.º 2
0
        public DevicemaViewModel()
        {
            _querytablecallbackdelegate = new QueryTableCallBackDelegate(QueryTableCallBack);
            _addtablecallbackdelegate   = new AddTableCallBackDelegate(AddTableCallBack);
            _excutesqlCallBackDelegate  = new ExcutesqlCallBackDelegate(ExcutesqlCallBack);
            AddCommand     = new DelegateCommand <object>(Add);
            ModifyCommand  = new DelegateCommand <object>(Modify);
            OperateCommand = new DelegateCommand <object>(Operate);
            DeleteCommand  = new DelegateCommand <object>(Delete);
            QueryCommand   = new DelegateCommand <object>(QueryShebeiguanli);

            FirstPageCommand = new DelegateCommand <object>(FirstPage);
            PrePageCommand   = new DelegateCommand <object>(PrePage);
            NextPageCommand  = new DelegateCommand <object>(NextPage);
            GotoPageCommand  = new DelegateCommand <object>(GotoPage);



            _deviceList     = new ObservableCollection <DeviceModel>();
            _city           = new ObservableCollection <string>();
            _ju             = new ObservableCollection <string>();
            _danwei         = new ObservableCollection <string>();
            _tableList      = new ObservableCollection <SHEBEIGUANLIModel>();
            _customInfo     = new SHEBEIGUANLIModel();
            _customInfogrid = new SHEBEIGUANLIModel();
            _customInfo1    = new SHEBEIGUANLIModel();
            _pagePercent    = "0/0";
        }
Ejemplo n.º 3
0
        public AddWndViewModel()
        {
            _querytablecallbackdelegate = new QueryTableCallBackDelegate(QueryTableCallBack);
            _addtablecallbackdelegate   = new AddTableCallBackDelegate(AddTableCallBack);
            _excutesqlCallBackDelegate  = new ExcutesqlCallBackDelegate(ExcutesqlCallBack);


            SelectedCommand      = new DelegateCommand <object>(Selected);
            AddCommand           = new DelegateCommand <object>(Add);
            QueryCommand         = new DelegateCommand <object>(Query);
            AddItemCommand       = new DelegateCommand <object>(AddItem);
            DeleteCommand        = new DelegateCommand <object>(Delete);
            CopyItemCommand      = new DelegateCommand <object>(CopyItem);
            DeleteItemCommand    = new DelegateCommand <object>(DeleteItem);
            UpdateAllRiqiCommand = new DelegateCommand <object>(UpdateAllRiqi);

            bool bAddWnd = false;

            foreach (string key in ConfigurationManager.AppSettings)
            {    //检索当前选中的分辨率
                if (key == "AddWnd")
                {
                    bAddWnd = Convert.ToBoolean(ConfigurationManager.AppSettings[key]);
                }
            }

            if (!bAddWnd)
            {
                visible = Visibility.Hidden;
            }
            else
            {
                visible = Visibility.Visible;
            }

            _tableList0 = new ObservableCollection <object>();
            _tableList0.Add(new ZHIQIANSHUJUModel());

            curCnt          = "当前数量:" + tableList0.Count;
            _ignoreXuhao    = true;
            _bSetAllcurtime = true;

            Riqi = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd HH:mm:ss");
        }