Exemplo n.º 1
0
        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");
            }
        }
Exemplo n.º 2
0
 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("");
     }
 }
Exemplo n.º 3
0
        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");
            }
        }
Exemplo n.º 4
0
        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");
            }
        }
Exemplo n.º 5
0
        void btnSave_Click(object sender, RoutedEventArgs e)
        {
            EmployeeInfoForm tempForm = ctr as EmployeeInfoForm;

            tempForm.Save("Save");
        }