예제 #1
0
        /// <summary>
        /// 保存职工的基本信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void BtnSaveBasicClickAsync(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(_CurPageViewModel.EntityMember.Id))
            {
                AppFuns.ShowMessage("员工的身份证号必须输入!");
                Tb_UserId.Focus();
                return;
            }
            if (string.IsNullOrWhiteSpace(_CurPageViewModel.EntityMember.Name))
            {
                AppFuns.ShowMessage("员工的姓名必须输入!");
                Tb_UserName.Focus();
                return;
            }
            ExcuteResult excuteResult;

            if (_CurPageViewModel.isEditFlag)
            {
                excuteResult = await DataMemberRepository.UpdateEntity(_CurPageViewModel.EntityMember);

                AppFuns.ShowMessage(excuteResult.Msg);
            }
            else
            {
                excuteResult = await DataMemberRepository.AddEntity(_CurPageViewModel.EntityMember);

                if (excuteResult.State == 0)
                {
                    //保存成功表示可以进行编辑了,即其他控件可以保存了。
                    _CurPageViewModel.isEditFlag = true;
                    //只传递两个字段信息,不实际读取(因为此时没有必要读取)
                    InitUcControlFilesAsync(false);
                    AppFuns.ShowMessage(excuteResult.Msg);
                }
            }
        }
예제 #2
0
        /// <summary>
        /// 更新员工的工作信息、受教育信息、更新备注信息等。
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void BtnUpdateClickAsync(object sender, RoutedEventArgs e)
        {
            ExcuteResult excuteResult = await DataMemberRepository.UpdateEntity(_CurPageViewModel.EntityMember);

            AppFuns.ShowMessage(excuteResult.Msg);
        }