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


C# Users.getUserByID方法代码示例

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


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

示例1: Page_Load

    /// <summary>
    /// Loads the page and analizes the QueryString to catch de GET vars.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Request.QueryString.Get("id") != null)
            {
                int idUser = Convert.ToInt16(Request.QueryString.Get("id"));

                Users user = new Users();
                DataTable dt;

                dt = user.getUserByID(idUser);

                if (dt != null && dt.Columns[0].Caption == "User_Dont_Exists")
                {
                    Response.Redirect(webURL + "views/users/viewallusers.aspx");
                }
                else if (dt.Rows.Count == 1)
                {
                    this.userid = dt.Rows[0].ItemArray[0].ToString();
                    this.username = dt.Rows[0].ItemArray[1].ToString() + " " + dt.Rows[0].ItemArray[2].ToString();

                    DetailsView1.DataSource = dt;
                    DetailsView1.DataBind();
                }
                else
                {
                    Response.Redirect(webURL + "views/users/viewallusers.aspx");
                }

            }
            else
            {
                Response.Redirect(webURL + "views/users/viewallusers.aspx");
            }
        } catch(Exception ex)
        {
            Response.Redirect(webURL + "views/users/viewallusers.aspx");
        }
    }
开发者ID:efigarolam,项目名称:Snackthat,代码行数:45,代码来源:viewuser.aspx.cs

示例2: loadForm

    /// <summary>
    /// Method to loads the form with the data of the selected User
    /// </summary>
    /// <param name="idCustomer">Int ID of the Customer</param>
    protected void loadForm(int idUser)
    {
        Users user = new Users();
        user.idUser = idUser;

        user.getUserByID();

        if (user.idUser != 0)
        {
            HiddenField1.Value = user.idUser.ToString();
            TextBox1.Text = user.Name;
            TextBox2.Text = user.LastName;
            TextBox3.Text = user.Username;
            DropDownList1.SelectedValue = user.idPrivilege.ToString();
            TextBox5.Text = user.Email;
            TextBox6.Text = user.RFC;
            TextBox7.Text = user.Address;
            TextBox8.Text = user.Phone;
        }
        else
        {
            Response.Redirect(webURL + "views/users/viewallusers.aspx?action=notify&id=3", false);
        }
    }
开发者ID:efigarolam,项目名称:Snackthat,代码行数:28,代码来源:edituser.aspx.cs


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