private void NewEditForm() { EmployeeEdit pro = new EmployeeEdit(); EmployeeEditVM eevm = new EmployeeEditVM(); eevm.evm = this; pro.DataContext = eevm; pro.Show(); pro.txtID.IsReadOnly = true; pro.txtBranch.ItemsSource = BranchDao.Instance().getAll(); pro.txtDepartment.ItemsSource = DepartmentDao.Instace().getAll(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Employee_edit = ((Sales.Employee.EmployeeEdit)(target)); return; case 2: this.txtID = ((System.Windows.Controls.TextBox)(target)); return; case 3: this.txtStart_Date = ((System.Windows.Controls.DatePicker)(target)); return; case 4: this.txtFirst_name = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.txtLast_name = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.txtTitle = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.txtBranch = ((System.Windows.Controls.ComboBox)(target)); return; case 8: this.txtDepartment = ((System.Windows.Controls.ComboBox)(target)); return; case 9: this.txtSupervisorEM = ((System.Windows.Controls.TextBox)(target)); return; case 10: this.btnOk = ((System.Windows.Controls.Button)(target)); return; case 11: this.btnCancel = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
private void ShowEditForm(EmployeeView pv) { if (pv != null) { EmployeeEdit pro = new EmployeeEdit(); EmployeeEditVM eevm = new EmployeeEditVM(); eevm.evm = this; eevm.EmployeeViewObj = pv; pro.DataContext = eevm; pro.Show(); pro.txtID.IsReadOnly = true; pro.txtBranch.ItemsSource = BranchDao.Instance().getAll(); pro.txtDepartment.ItemsSource = DepartmentDao.Instace().getAll(); } }