コード例 #1
0
 /// <summary>
 ///     Send data to the data base invoke
 /// </summary>
 /// <param name="args">Arguments (what should be updated)</param>
 private protected virtual void OnSendNewData
 (
     NewPersonalInfoHandler args
 )
 {
     SendNewData?.Invoke
     (
         args
     );
 }
コード例 #2
0
        /// <summary>
        ///     Update information
        /// </summary>
        /// <param name="args">Arguments</param>
        public virtual void UpdateAuthorizedHuman
        (
            NewPersonalInfoHandler args
        )
        {
            IUpdate db = new QQContext();

            switch (args.CurrentUpdateType)
            {
            case NewPersonalInfoHandler.UpdateType.Avatar:
            {
                db.UpdateAvatar
                (
                    User.Avatar,
                    User.UserId
                );
                break;
            }

            case NewPersonalInfoHandler.UpdateType.AvatarAndTextInfo:
            {
                db.UpdateExtraInformationAndAvatar
                (
                    User.Avatar,
                    User.Address,
                    User.Name,
                    User.SecondName,
                    User.FatherName,
                    User.EMail,
                    User.PhoneNumber,
                    User.Organization,
                    User.UserId
                );
                break;
            }

            case NewPersonalInfoHandler.UpdateType.Password:
            {
                db.UpdatePassword
                (
                    User.Password,
                    User.UserId
                );
                break;
            }

            default: return;
            }
        }