void tempForm_OnUIRefreshed() { if (ctr is EmployeeInfoForm) { EmployeeInfoForm temp = ctr as EmployeeInfoForm; //pnlEntity.Children.Clear(); temp.Visibility = Visibility.Collapsed; if (entryAddForm == null) { int employeeType = 0;//0 表示新增 1表示使用原有的员工信息 if (userForm.leaveMessage.Count > 0) { employeeType = 1; } entryAddForm = new EmployeeEntryAddForm(temp.Employee, employeeType); entryAddForm.IsEntryBefore = temp.IsEntryBefore; //EmployeeEntryAddForm form = new EmployeeEntryAddForm(FormTypes.New,""); ctr = entryAddForm as Control; ctr.HorizontalAlignment = HorizontalAlignment.Stretch; ctr.VerticalAlignment = VerticalAlignment.Top; //this.Width = 700; //this.Height = 300; pnlEntity.Children.Add(entryAddForm); } else { entryAddForm.Visibility = Visibility.Visible; ctr = entryAddForm as Control; //entryAddForm.SysUser.USERNAME = temp.Employee.EMPLOYEEENAME; entryAddForm.txtUser.Text = temp.Employee.EMPLOYEEENAME; if (temp.Employee.IDNUMBER.Length > 6) { //entryAddForm.SysUser.PASSWORD = temp.Employee.IDNUMBER.Substring(temp.Employee.IDNUMBER.Length - 6); entryAddForm.txtPwd.Password = "******" + temp.Employee.IDNUMBER.Substring(temp.Employee.IDNUMBER.Length - 6); } else { entryAddForm.txtPwd.Password = temp.Employee.IDNUMBER; } } //entryAddForm.ComputerNo = temp.txtComputerNO.Text.Trim(); // entryAddForm.PensionCardID = temp.txtCardID.Text.Trim(); // entryAddForm.SocialServiceYear = temp.dtpStartWorkTime.SelectedDate.Value.ToShortDateString(); entryAddForm.eminfo = temp; ctr.MinHeight = 300; ctr.MinWidth = 680; this.ParentWindow.Height = 340; this.ParentWindow.Width = 700; GenerateEntityInfoCtr("2"); } }
void btnFinshed_Click(object sender, RoutedEventArgs e) { if (ctr is EmployeeEntryAddForm) { EmployeeEntryAddForm temp = ctr as EmployeeEntryAddForm; temp.OnUIRefreshed += new EmployeeEntryAddForm.refreshGridView(tempFinshed_OnUIRefreshed); temp.txtPwd.IsEnabled = false; if (temp.canSave) { temp.Save(); } } }