public EntityPageForm() { InitializeComponent(); TitleContent = Utility.GetResourceStr("EMPLOYEEENTRY"); userForm = new EmployeeUserForm(); ctr = userForm as Control; ctr.Width = 400; ctr.Height = 200; ctr.VerticalAlignment = VerticalAlignment.Stretch; ctr.HorizontalAlignment = HorizontalAlignment.Stretch; pnlEntity.Children.Add(userForm); }
void btnNext_Click(object sender, RoutedEventArgs e) { if (ctr is EmployeeUserForm) { EmployeeUserForm temp = ctr as EmployeeUserForm; temp.OnUIRefreshed += new EmployeeUserForm.refreshGridView(temp_OnUIRefreshed); temp.save(); } else { EmployeeInfoForm tempForm = ctr as EmployeeInfoForm; tempForm.OnUIRefreshed += new EmployeeInfoForm.refreshGridView(tempForm_OnUIRefreshed); tempForm.Save(""); } }
void temp_OnUIRefreshed() { if (ctr is EmployeeUserForm) { EmployeeUserForm temp = ctr as EmployeeUserForm; //pnlEntity.Children.Clear(); temp.Visibility = Visibility.Collapsed; if (infoForm == null) { //if (string.IsNullOrEmpty(temp.leaveMessage[0])) if (temp.leaveMessage.Count <= 0) { infoForm = new EmployeeInfoForm(temp.sNumberID.Text.Trim().ToUpper(), temp.sName.Text.Trim()); } else { infoForm = new EmployeeInfoForm(temp.leaveMessage[0]); if (!string.IsNullOrEmpty(temp.leaveMessage[1])) { infoForm.IsEntryBefore = true; } else { infoForm.IsEntryBefore = false; } } ctr = infoForm as Control; ctr.HorizontalAlignment = HorizontalAlignment.Stretch; ctr.VerticalAlignment = VerticalAlignment.Top; pnlEntity.Children.Add(infoForm); } else { if (temp.leaveMessage.Count > 0) { infoForm = new EmployeeInfoForm(temp.leaveMessage[0]); if (!string.IsNullOrEmpty(temp.leaveMessage[1])) { infoForm.IsEntryBefore = true; } else { infoForm.IsEntryBefore = false; } ctr = infoForm as Control; ctr.HorizontalAlignment = HorizontalAlignment.Stretch; ctr.VerticalAlignment = VerticalAlignment.Top; pnlEntity.Children.Add(infoForm); } else { infoForm.Employee.EMPLOYEECNAME = temp.sName.Text.Trim(); infoForm.Employee.IDNUMBER = temp.sNumberID.Text.Trim().ToUpper(); infoForm.Visibility = Visibility.Visible; ctr = infoForm as Control; ctr.HorizontalAlignment = HorizontalAlignment.Stretch; ctr.VerticalAlignment = VerticalAlignment.Top; } //infoForm.Visibility = Visibility.Visible; //ctr = infoForm as Control; //ctr.HorizontalAlignment = HorizontalAlignment.Stretch; //ctr.VerticalAlignment = VerticalAlignment.Top; } //ctr.MinHeight = 500; ctr.Height = 500; ctr.MinWidth = 450; this.ParentWindow.Width = 700; this.ParentWindow.Height = 605; GenerateEntityInfoCtr("1"); } }