当前位置: 首页>>代码示例>>C#>>正文


C# UserAccount类代码示例

本文整理汇总了C#中UserAccount的典型用法代码示例。如果您正苦于以下问题:C# UserAccount类的具体用法?C# UserAccount怎么用?C# UserAccount使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UserAccount类属于命名空间,在下文中一共展示了UserAccount类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Connect

        public Task Connect()
        {
            UserAccount ua = new UserAccount(Context.User.Identity.Name);

            ChatRoomUser cru = new ChatRoomUser();

            cru.GetChatRoomUserByUserAccountID(ua.UserAccountID);

            if (cru.ChatRoomUserID == 0)
            {
                cru.CreatedByUserID = ua.UserAccountID;
                cru.ConnectionCode = Context.ConnectionId;
                cru.Create();
            }
            else
            {
                cru.ConnectionCode = Context.ConnectionId;
                cru.UpdatedByUserID = ua.UserAccountID;
                cru.Update();
            }

            Send(@"<i style=""color:yellow;font-size:10px;font-style: italic;"">CONNECTION OPENED</i>", ua.UserAccountID);

            return Clients.joined(Context.ConnectionId, DateTime.UtcNow.ToString());
        }
开发者ID:pakoito,项目名称:web,代码行数:25,代码来源:ChatController.cs

示例2: UpdateFrom

        /// <summary>
        /// Updates session from DB object
        /// </summary>
        /// <param name="user"></param>
        public void UpdateFrom(UserAccount user)
        {
            UpdatedOn = DateTime.UtcNow;
            UserId = user.Id;

            OnUpdate(user);
        }
开发者ID:NVentimiglia,项目名称:Unity3d-Foundation,代码行数:11,代码来源:AppSession.Helper.cs

示例3: GetUsersInRole

        public static UserAccounts GetUsersInRole(int roleID)
        {
            UserAccounts uars = null;

            // get a configured DbCommand object
            DbCommand comm = DbAct.CreateCommand();
            // set the stored procedure name
            comm.CommandText = "up_GetUsersInRole";

            ADOExtenstion.AddParameter(comm, "roleID", roleID);

            // execute the stored procedure
            DataTable dt = DbAct.ExecuteSelectCommand(comm);

            // was something returned?
            if (dt != null && dt.Rows.Count > 0)
            {
                uars = new UserAccounts();
                UserAccount art = null;
                foreach (DataRow dr in dt.Rows)
                {
                    art = new UserAccount(dr);
                    uars.Add(art);
                }
            }
            return uars;
        }
开发者ID:pakoito,项目名称:web,代码行数:27,代码来源:UserAccountRole.cs

示例4: CreateAccount

        public UserCreateStatus CreateAccount(string username, string password, string fullname, string email)
        {
            bool exists = Repository.FirstOrDefault(u => u.LocalCredentials != null && u.LocalCredentials.Username == username) != null;
            if (!exists)
            {
                if (!Validator.CheckPassword(password))
                    return UserCreateStatus.InsufficientPassword;

                UserAccount user = new UserAccount
                {
                    PublicIdentifier = HashHelper.ComputePublicIdentifier(typeof(UserAccount).Name, username),
                    LocalCredentials = new LocalCredentials
                    {
                        Username = username,
                        Password = HashHelper.ComputePassword(username, password)
                    },
                    Enabled = true,
                    Created = DateTime.Now,
                    Fullname = fullname,
                    Email = email,
                    UserRole = UserRole.User
                };
                Repository.Insert(user);
                return UserCreateStatus.Created;
            }
            ActivityService.UserRegistered(username);
            return UserCreateStatus.UsernameUsed;
        }
开发者ID:jacklau88,项目名称:Forms,代码行数:28,代码来源:UserService.cs

示例5: ProfileController

        public ProfileController(IMailService mail)
        {
            _mail = mail;
            _mu = MembershipWrapper.GetUser();

            if (_mu != null) _ua = new UserAccount(_mu.UserName);
        }
开发者ID:dasklub,项目名称:kommunity,代码行数:7,代码来源:ProfileController.cs

示例6: SaveToken

    private void SaveToken(string token, string shopName)
    {
        string isExistingShop = Request.QueryString["isES"];

        // save token in database
        DataModelEntities context = new DataModelEntities();

        if (isExistingShop == "0") // new user
        {
            UserAccount userAccount = new UserAccount();

            userAccount.User_Code = UserKey;
            userAccount.Account_Code = (int)Constant.Accounts.Shopify;
            userAccount.Application_Name = shopName;
            userAccount.Config_Value1 = token;
            userAccount.Created_Date = DateTime.Now;
            userAccount.Is_Active = true;

            context.UserAccounts.AddObject(userAccount);
        }
        else
        {
            UserAccount userAccount = context.UserAccounts.First(u => u.User_Code == UserKey && u.Is_Active == true && u.Account_Code == (int)Constant.Accounts.Shopify);
            userAccount.Application_Name = shopName;
            userAccount.Config_Value1 = token;
            userAccount.Modified_Date = DateTime.Now;
            userAccount.User_IP = Request.UserHostAddress;
        }

        context.SaveChanges();
        context = null;
    }
开发者ID:asrasalman,项目名称:Auto-Price-Manager,代码行数:32,代码来源:ShopifyConnect.aspx.cs

示例7: CallsUpdateOnRepository

 public void CallsUpdateOnRepository()
 {
     var repo = new Mock<IUserAccountRepository>();
     var sub = new UserAccountService(repo.Object, null, null);
     var ua = new UserAccount();
     sub.Update(ua);
     repo.Verify(x => x.Update(ua));
 }
开发者ID:kijanawoodard,项目名称:BrockAllen.MembershipReboot,代码行数:8,代码来源:UserAccountServiceTests.cs

示例8: Post

 /// <summary>
 /// Posts the specified user account.
 /// </summary>
 /// <param name="userAccount">The user account.</param>
 /// <returns>
 /// The Task.
 /// </returns>
 /// <remarks>
 /// This operation allows to authenticate user account.
 /// </remarks>
 /// <response code="400">Bad request</response>
 /// <response code="401">Unauthorized</response>
 /// <response code="404">Account not found</response>
 /// <response code="500">Internal Server Error</response>
 /// <response code="200">Successful</response>
 public async Task<IHttpActionResult> Post(UserAccount userAccount)
 {
     return await this.CreateAsync<User>(async operationResult =>
     {
         await this.AuthenticateUser(operationResult, userAccount);
         return string.Empty;
     });
 }
开发者ID:JaipurAnkita,项目名称:mastercode,代码行数:23,代码来源:AuthenticateUserController.cs

示例9: Update

 public void Update(UserAccount item)
 {
     var other = Get(item.ID);
     if (other != item)
     {
         Remove(other);
         Add(item);
     }
 }
开发者ID:nmsampaio,项目名称:BrockAllen.MembershipReboot,代码行数:9,代码来源:FakeUserAccountRepository.cs

示例10: OnUpdate

 /// <summary>
 ///  TODO Update Custom Session fields here
 /// </summary>
 /// <param name="user"></param>
 protected void OnUpdate(UserAccount user)
 {
     Email = user.Email;
     if (user.UserFacebookClaims != null && user.UserFacebookClaims.Any())
     {
         var social = user.UserFacebookClaims.First();
         FacebookId = social.Id;
     }
 }
开发者ID:NVentimiglia,项目名称:Unity3d-Foundation,代码行数:13,代码来源:AppSession.cs

示例11: btnSearch_Click

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtSearch.Text))
            {
                ua = new UserAccount(txtSearch.Text);

                LoadUserAddress(ua.UserAccountID);
            }
        }
开发者ID:dasklub,项目名称:kommunity,代码行数:9,代码来源:UserAddress.aspx.cs

示例12: CheckNewNotifications

        public List<Notification> CheckNewNotifications(UserAccount user, bool isRead)
        {
            List<Notification> notificationList =
                Translators.Notification.ToBusinessObject(
                    _dataAccessObjects.GetNotificationByJobRoleAndIsRead(
                        user.HighestPermission.ToString(), isRead));

            return notificationList;
        }
开发者ID:sqlhammer,项目名称:CIS470-Devry-Senior-Project,代码行数:9,代码来源:BusinessObjects.cs

示例13: Validate

 public ValidationResult Validate(UserAccountService service, UserAccount account, string value)
 {
     if (value.Length < 4)
     {
         return new ValidationResult("Password must be at least 4 characters long");
     }
     
     return null;
 }
开发者ID:paulute,项目名称:BrockAllen.MembershipReboot,代码行数:9,代码来源:MembershipRebootConfiguration.cs

示例14: CheckAllNotifications

        public List<Notification> CheckAllNotifications(UserAccount user)
        {
            List<Notification> notificationList =
                Translators.Notification.ToBusinessObject(
                    _dataAccessObjects.GetNotificationByJobRole(
                        user.HighestPermission.ToString()));

            return notificationList;
        }
开发者ID:sqlhammer,项目名称:CIS470-Devry-Senior-Project,代码行数:9,代码来源:BusinessObjects.cs

示例15: Register

        public void Register(string account, string password)
        {
            var userAccount = new UserAccount();
            userAccount.Account = account;
            userAccount.Password = password.ToBinary();
            userAccount.DelFlag = 0;

            UserAccountDao.Save(userAccount);
        }
开发者ID:BGCX261,项目名称:zmw-dev-svn-to-git,代码行数:9,代码来源:UserAccountLogic.cs


注:本文中的UserAccount类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。