private void ShowEditForm(AccountView pv) { if (pv != null) { AccountEdit ac = new AccountEdit(); ac.Show(); AccountEditVM avm = new AccountEditVM(); ac.DataContext = avm; avm.vm = this; avm.AccountViewObj = AccountViewObj; avm.Account_tranObj = Account_tranObj; avm.CustId = AccountViewObj.customer.CUST_ID; avm.cv = "update"; ac.ComBranch.ItemsSource = BranchDao.Instance().getAll(); ac.ComProduct.ItemsSource = listpro; avm.listem = listem; ac.ComEm.ItemsSource = listem; } }
private void NewEditForm() { if (AccountViewObj != null) { AccountEdit ac = new AccountEdit(); ac.Show(); AccountEditVM avm = new AccountEditVM(); ac.DataContext = avm; avm.vm = this; avm.CustId = AccountViewObj.customer.CUST_ID; avm.AccountViewObj.NameCus = AccountViewObj.NameCus; avm.cv = "insert"; avm.listem = listem; ac.ComBranch.ItemsSource = BranchDao.Instance().getAll(); ac.ComProduct.ItemsSource = listpro; ac.ComEm.ItemsSource = listem; } else { MessageBox.Show("Chưa có tên khách hàng"); } }