コード例 #1
0
        public void SaveUserinfo()
        {
            Model.BJUTInfoCenterUserinfo BJUTInfoCenterUserinfo = new Model.BJUTInfoCenterUserinfo();
            BJUTInfoCenterUserinfo.Username = AccountModifyVM.Username;
            BJUTInfoCenterUserinfo.Password = AccountModifyVM.Password;
            //保存到数据库
            Service.DbService.SaveInfoCenterUserinfo(BJUTInfoCenterUserinfo);
            //同时修改当前选定账号
            WIFIHelperVM.InfoUser = BJUTInfoCenterUserinfo;

            GalaSoft.MvvmLight.Messaging.Messenger.Default.Send <string>("保存成功", messageToken);
        }
コード例 #2
0
        public async void SaveUserinfo()
        {
            if (BJUTInfoCenterUserinfo == null)
            {
                BJUTInfoCenterUserinfo = new Model.BJUTInfoCenterUserinfo();
            }

            BJUTInfoCenterUserinfo.Username = AccountModifyVM.Username;
            BJUTInfoCenterUserinfo.Password = AccountModifyVM.Password;

            Service.DbService.SaveInfoCenterUserinfo(BJUTInfoCenterUserinfo);

            GalaSoft.MvvmLight.Messaging.Messenger.Default.Send <string>("保存成功", messageToken);
        }
コード例 #3
0
 public object ConvertBack(object value, Type targetType, object parameter, string language)
 {
     Model.BJUTInfoCenterUserinfo user = (Model.BJUTInfoCenterUserinfo)value;
     return(user);
 }
コード例 #4
0
        public void Save()
        {
            GalaSoft.MvvmLight.Messaging.Messenger.Default.Send("测试", messageToken);
            if (string.IsNullOrWhiteSpace(Username))
            {
                GalaSoft.MvvmLight.Messaging.Messenger.Default.Send("账号填写不正确", messageToken);
                return;
            }
            if (string.IsNullOrWhiteSpace(Password))
            {
                GalaSoft.MvvmLight.Messaging.Messenger.Default.Send("密码填写不正确", messageToken);
                return;
            }
            switch (UserType.Name)
            {
            case "BJUTInfoCenterUserinfo":
                var InfoUser = new Model.BJUTInfoCenterUserinfo()
                {
                    Username = Username, Password = Password
                };
                Service.DbService.SaveInfoCenterUserinfo(InfoUser);
                if (BJUTInfoCenterUserinfos != null)
                {
                    if (BJUTInfoCenterUserinfos.Count(m => m.Username == InfoUser.Username) <= 0)
                    {
                        BJUTInfoCenterUserinfos.Add(InfoUser);
                    }
                }
                break;

            case "BJUTLibCenterUserinfo":

                var LibUser = new Model.BJUTLibCenterUserinfo()
                {
                    Username = Username, Password = Password
                };
                Service.DbService.SaveInfoCenterUserinfo(LibUser);

                if (BJUTLibCenterUserinfos != null)
                {
                    if (BJUTLibCenterUserinfos.Count(m => m.Username == LibUser.Username) <= 0)
                    {
                        BJUTLibCenterUserinfos.Add(LibUser);
                    }
                }
                break;

            case "BJUTEduCenterUserinfo":

                var EduUser = new Model.BJUTEduCenterUserinfo()
                {
                    Username = Username, Password = Password
                };
                Service.DbService.SaveInfoCenterUserinfo(EduUser);

                if (BJUTEduCenterUserinfos != null)
                {
                    if (BJUTEduCenterUserinfos.Count(m => m.Username == EduUser.Username) <= 0)
                    {
                        BJUTEduCenterUserinfos.Add(EduUser);
                    }
                }
                break;

            case "StudentID":
            //Service.FileService.SetStudentID(StudentID); break;
            default:
                break;
            }
            GalaSoft.MvvmLight.Messaging.Messenger.Default.Send("保存成功", messageToken);
        }