using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class etwuser_edit_childaccount : System.Web.UI.Page
{
    public int id = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
         HttpCookie GetCookie = Request.Cookies["cookEtwuser"];
        if (Request.Cookies["cookEtwuser"] == null)
        {
            Response.Redirect("../index.aspx");
        }
        if (Request.QueryString["id"] != null)
        {
            id = Convert.ToInt32(Request.QueryString["id"]);
            etw.chat_user lead = new etw.chat_user();
            if (!IsPostBack)
            {
                lead.id = id;
                lead.GetModel();
                companytxt.Text = lead.companyname;
                usernametxt.Text = lead.username;
                passwordtxt.Text = lead.password;
                repasswordtxt.Text = lead.password;
                realnametxt.Text = lead.realname;
                regtimetxt.Text = lead.regtime;
            }
        }
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        etw.chat_user lead = new etw.chat_user();
        lead.companyname = companytxt.Text.Trim();
        lead.password = passwordtxt.Text.Trim();
        lead.realname = realnametxt.Text.Trim();
        lead.regtime = regtimetxt.Text.Trim();
        lead.id = id;
        lead.Update();
        Fun.JsAlerT("修改成功！", "childaccount.aspx"); 
    }
}
