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


C# UserService.GetByID方法代码示例

本文整理汇总了C#中UserService.GetByID方法的典型用法代码示例。如果您正苦于以下问题:C# UserService.GetByID方法的具体用法?C# UserService.GetByID怎么用?C# UserService.GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserService的用法示例。


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

示例1: Page_Load

 /// <summary>
 /// Handles the Load event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 private void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         UserService service = new UserService();
         ProfileControl1.AdminView = true;
         ProfileControl1.FillForm(service.GetByID(UserID));
     }
 }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:14,代码来源:EditUser.aspx.cs

示例2: Submit_Click

        /// <summary>
        /// Handles the Click event of the Submit control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Submit_Click(object sender, EventArgs e)
        {
            if (!IsValid)
            {
                return;
            }

            //store new user information to database
            UserService service = new UserService();
            User user = service.GetByID(UserID);
            ProfileControl1.FillUser(user);
            service.Update(user);
        }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:18,代码来源:EditUser.aspx.cs

示例3: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ProfileControl1.Editable = false;
                // get the developer
                UserService service = new UserService();
                User dev = service.GetByID(DevID);

                // fill the form
                ProfileControl1.FillForm(dev);

                // bind complevels
                ddlComp.DataSource = Enum.GetNames(typeof (CompLevel));
                ddlComp.DataBind();
                ddlComp.Items.Insert(0, String.Empty);

                // select dev's comp level
                //ListItem item = ddlComp.Items.FindByValue(dev.Competency.ToString());
                //if (item != null)
                //    item.Selected = true;
            }
        }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:23,代码来源:ViewDevProfile.aspx.cs

示例4: UpdateEnabled

        public void UpdateEnabled()
        {
            UserService target = new UserService();
            User user = (User) CreateRecord();
            Insert(user);

            user.Enabled = !user.Enabled;
            target.Enable(user.ID, user.Enabled);

            User updated = target.GetByID(user.ID);

            Assert.AreEqual(user.Enabled, updated.Enabled);
        }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:13,代码来源:UserServiceTests.cs

示例5: Update

        public override void Update()
        {
            UserService target = new UserService();
            User user = (User) CreateRecord();
            Insert(user);

            user.LastName = "updated last name";
            target.Update(user);

            User updated = target.GetByID(user.ID);
            Assert.AreEqual(user.LastName, updated.LastName);
        }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:12,代码来源:UserServiceTests.cs

示例6: Insert

        public override void Insert()
        {
            UserService target = new UserService();
            User user = (User) CreateRecord();
            Insert(user);

            Assert.IsNotNull(target.GetByID(user.ID));
            Assert.IsTrue(target.Exists(user.ID));
        }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:9,代码来源:UserServiceTests.cs

示例7: GetByUsername

        public void GetByUsername()
        {
            UserService target = new UserService();
            User user = (User) CreateRecord();
            Insert(user);

            User user2 = target.GetByID(user.Username);

            Assert.IsNotNull(user2);
            Assert.AreEqual(user.Username, user2.Username);
        }
开发者ID:jrummell,项目名称:projmgt-net,代码行数:11,代码来源:UserServiceTests.cs


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