protected override void AttachChildControls() { this.txtRealName = (System.Web.UI.WebControls.TextBox) this.FindControl("txtRealName"); this.txtEmail = (System.Web.UI.WebControls.TextBox) this.FindControl("txtEmail"); this.dropRegionsSelect = (RegionSelector)this.FindControl("dropRegions"); this.gender = (GenderRadioButtonList)this.FindControl("gender"); this.calendDate = (WebCalendar)this.FindControl("calendDate"); this.txtAddress = (System.Web.UI.WebControls.TextBox) this.FindControl("txtAddress"); this.txtQQ = (System.Web.UI.WebControls.TextBox) this.FindControl("txtQQ"); this.txtMSN = (System.Web.UI.WebControls.TextBox) this.FindControl("txtMSN"); this.txtTel = (System.Web.UI.WebControls.TextBox) this.FindControl("txtTel"); this.txtHandSet = (System.Web.UI.WebControls.TextBox) this.FindControl("txtHandSet"); this.btnOK1 = ButtonManager.Create(this.FindControl("btnOK1")); this.Statuses = (SmallStatusMessage)this.FindControl("Statuses"); this.btnOK1.Click += new System.EventHandler(this.btnOK1_Click); PageTitle.AddSiteNameTitle("个人信息", HiContext.Current.Context); if (!this.Page.IsPostBack) { Member member = HiContext.Current.User as Member; if (member != null) { this.BindData(member); } } }
protected override void AttachChildControls() { this.txtRealName = (TextBox)this.FindControl("txtRealName"); this.txtEmail = (TextBox)this.FindControl("txtEmail"); this.dropRegionsSelect = (RegionSelector)this.FindControl("dropRegions"); this.gender = (GenderRadioButtonList)this.FindControl("gender"); this.calendDate = (CalendarPanel)this.FindControl("calendDate"); this.txtAddress = (TextBox)this.FindControl("txtAddress"); this.txtQQ = (TextBox)this.FindControl("txtQQ"); this.txtMSN = (TextBox)this.FindControl("txtMSN"); this.txtTel = (TextBox)this.FindControl("txtTel"); this.txtHandSet = (TextBox)this.FindControl("txtHandSet"); this.btnOK1 = ButtonManager.Create(this.FindControl("btnOK1")); this.Statuses = (SmallStatusMessage)this.FindControl("Statuses"); this.hidePicture = (HiddenField)this.FindControl("fmSrc"); this.smallpic = (Image)this.FindControl("smallpic"); this.btnOK1.Click += this.btnOK1_Click; PageTitle.AddSiteNameTitle("个人信息"); if (!this.Page.IsPostBack) { MemberInfo user = HiContext.Current.User; if (user.UserId != 0) { this.BindData(user); } } }
protected void AddButton_Click(object sender, EventArgs e) { DELIVERY_MAN dM = new DELIVERY_MAN(); dM.firstname = FirstNameTextBox.Text.Trim(); dM.lastname = LastNameTextBox.Text.Trim(); dM.gender = GenderRadioButtonList.SelectedValue; dM.phone = PhoneTextBox.Text.Trim(); dM.email = EmailTextBox1.Text.Trim(); dM.password = Crypto.HashPassword(PasswordTextBox1.Text); dM.photo = "delivery_man.png"; dM.authorized = true; dM.id_admin = ((TADMIN)HttpContext.Current.Session["admin"]).id_admin; db.DELIVERY_MAN.Add(dM); db.SaveChanges(); FirstNameTextBox.Text = ""; LastNameTextBox.Text = ""; GenderRadioButtonList.ClearSelection(); PhoneTextBox.Text = ""; EmailTextBox1.Text = ""; PasswordTextBox1.Text = ""; }