private void ShowInfo() { Maticsoft.Model.Ms.EntryForm model = new Maticsoft.BLL.Ms.EntryForm().GetModel(this.Id); if (model != null) { this.lblId.Text = model.Id.ToString(); this.lblUserName.Text = model.UserName; if (model.Age.HasValue) { this.lblAge.Text = model.Age.ToString(); } this.lblEmail.Text = model.Email; this.lblTelPhone.Text = model.TelPhone; this.lblPhone.Text = model.Phone; this.lblQQ.Text = model.QQ; this.lblMSN.Text = model.MSN; this.lblHouseAddress.Text = model.HouseAddress; this.lblCompanyAddress.Text = model.CompanyAddress; if (model.RegionId.HasValue) { this.lblRegionId.Text = this.GetRegionNameByRID(model.RegionId.Value); } this.lblSex.Text = this.GetSex(model.Sex); this.lblDescription.Text = model.Description; this.lblremark.Text = model.Remark; if (model.State.HasValue) { this.lblState.Text = this.GetState(model.State); } } }
protected void btnSave_Click(object sender, EventArgs e) { string str = this.txtUserName.Text.Trim(); string str2 = this.txtRemark.Text.Trim(); if (string.IsNullOrWhiteSpace(str)) { MessageBox.ShowFailTip(this, MsEntryForm.ErrorNameNotNull); } else if (str2.Length > 300) { MessageBox.ShowFailTip(this, MsEntryForm.ErrorRemarkoverlength); } else { Maticsoft.Model.Ms.EntryForm model = new Maticsoft.Model.Ms.EntryForm { UserName = this.txtUserName.Text.Trim(), Age = new int?(int.Parse(this.dropAge.SelectedValue)), Email = this.txtEmail.Text.Trim(), TelPhone = this.txtTelPhone.Text.Trim(), Phone = this.txtPhone.Text.Trim(), QQ = this.txtQQ.Text.Trim(), MSN = this.txtMSN.Text.Trim(), HouseAddress = this.txtHouseAddress.Text.Trim(), CompanyAddress = this.txtCompanyAddress.Text.Trim(), RegionId = new int?(Convert.ToInt32(this.dropProvince.Area_iID)), Sex = this.dropSex.SelectedValue, Description = this.txtDescription.Text.Trim(), Remark = str2, State = new int?(int.Parse(this.dropState.SelectedValue)) }; Maticsoft.BLL.Ms.EntryForm form2 = new Maticsoft.BLL.Ms.EntryForm(); if (form2.Add(model) > 0) { this.btnCancle.Enabled = false; this.btnSave.Enabled = false; MessageBox.ShowSuccessTip(this, Site.TooltipSaveOK, "list.aspx"); } } }