private void NewEditForm() { DepartmentEdit depart = new DepartmentEdit("insert", this); depart.txtDepID.Text = (DepartmentDao.Instace().GetLastID() + 1).ToString(); depart.txtDepID.IsReadOnly = true; depart.Show(); }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.departmentedit = ((Sales.Department.DepartmentEdit)(target)); return; case 2: this.grdepartment = ((System.Windows.Controls.Grid)(target)); return; case 3: this.txtDepID = ((System.Windows.Controls.TextBox)(target)); return; case 4: this.txtName = ((System.Windows.Controls.TextBox)(target)); return; case 5: this.btnOK = ((System.Windows.Controls.Button)(target)); return; case 6: this.btnCancel = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
private void ShowEditForm(DEPARTMENT p) { if (p != null) { DepartmentEdit depart = new DepartmentEdit("update", this); depart.Show(); depart.txtDepID.Text = p.DEPT_ID.ToString(); depart.txtDepID.IsReadOnly = true; depart.txtName.Text = p.NAME; } }