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); } } } }
public ViewModelBase NewDetail() { VMExampleBillDetail d = new VMExampleBillDetail(); d = ViewModelProxy.Proxy(d); _details.Add(d); return(d); }
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); }
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); }
public LoginForm() { InitializeComponent(); //InitViewModel _vm = new VMLoginForm(); _vm = ViewModelProxy.Proxy(_vm); _vm.ValidateFailed = ValidateFialed; DataBind(); }
private void InitViewModel() { _vm = new ViewModel(); _vm = ViewModelProxy.Proxy(_vm); _vm.PropertyChanged += ViewModelPropertyChanged; }