예제 #1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            Staff staff = this.GetSaveStaff();

            if (staff != null)
            {
                if (ValidationUtil.IsValid(this))
                {
                    if (this.inViewModel.ChangeStatus(staff))
                    {
                        INWindow inWindow = this.dataService.INWindow as INWindow;
                        if (inWindow != null)
                        {
                            inWindow.userHead.ImageSource = staff.HeaderImage;
                            inWindow.tbkName.Text         = staff.Name;
                            inWindow.lblSignature.Text    = staff.Signature;
                        }
                        if (!this.inViewModel.ProfileUpdate(staff))
                        {
                            Alert.Show("个人资料更新失败", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                        }
                        else
                        {
                            Alert.Show("个人信息保存成功", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                        }
                    }
                    else
                    {
                        Alert.Show("个人状态更新失败包括,用户名,头象,状态,个人签名", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
                    }
                }
            }
            else
            {
                Alert.Show("个人档案资料为空,保存失败", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk);
            }
        }