示例#1
0
        public override void LoadByID(long id)
        {
            if (id > 0)
            {
                Number     = "0001";
                CreateDate = DateTime.Today;
                BillerName = ClientInfo.CurrentUser.DisplayName;
                StatusName = "编辑中";

                using (SnokyeContainer c = new SnokyeContainer())
                {
                    UserInfo[] users = c.UserInfoSet.Where((u) => true).ToArray();
                    foreach (UserInfo u in users)
                    {
                        VMExampleBillDetail d = new VMExampleBillDetail
                        {
                            ID       = id,
                            UserID   = u.Id,
                            UserName = u.UserName,
                        };
                        d = ViewModelProxy.Proxy(d);
                        _details.Add(d);
                    }
                }
            }
        }
示例#2
0
        public ViewModelBase NewDetail()
        {
            VMExampleBillDetail d = new VMExampleBillDetail();

            d = ViewModelProxy.Proxy(d);
            _details.Add(d);
            return(d);
        }
示例#3
0
        private void changePwdToolStripMenuItem_Click(object sender, EventArgs e)
        {
            VMChangePwd model = new VMChangePwd();

            model.ID = ClientInfo.CurrentUser.Id;
            model    = ViewModelProxy.Proxy(model);

            OpenDialogForm(typeof(ChangePasswordForm), "修改密码", model);
        }
示例#4
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            VMExampleBill b = new VMExampleBill();

            b.LoadByID(1);
            b = ViewModelProxy.Proxy(b);
            ExampleBillEditForm f = new ExampleBillEditForm(b, "演示表单", EditFormPurpose.Create);

            f.ShowDialog(this);
        }
示例#5
0
        public LoginForm()
        {
            InitializeComponent();

            //InitViewModel
            _vm = new VMLoginForm();
            _vm = ViewModelProxy.Proxy(_vm);
            _vm.ValidateFailed = ValidateFialed;

            DataBind();
        }
示例#6
0
 private void InitViewModel()
 {
     _vm = new ViewModel();
     _vm = ViewModelProxy.Proxy(_vm);
     _vm.PropertyChanged += ViewModelPropertyChanged;
 }