private void btn_Save_Click(object sender, EventArgs e) { try { string userName = this.txtUserName.Text.Trim(); string sex = this.cbBox_Sex.SelectedIndex.ToString(); DateTime birthday = this.dtp_Birthday.Value; string tel = this.txt_Tel.Text.Trim(); string address = this.txt_Address.Text.Trim(); string addressNew = this.txt_AddressNew.Text.Trim(); string idcard = this.txt_IDCard.Text.Trim(); ArchivesModel addArchivess = new ArchivesModel(); addArchivess.UserName = userName; addArchivess.Tel = tel; addArchivess.Sex = sex; addArchivess.IdCard = idcard; addArchivess.Birthday = birthday; addArchivess.Address = address; addArchivess.AddressNew = addressNew; //SourceHelper._ArchivesSource.Add(addArchivess); MessageBox.Show("保存成功"); this.ClearData(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void treeView_Patient_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { if (e.Node.Name.ToLower() == "parentnode") { this.ClearControl(); return; } ArchivesModel model = e.Node.Tag as ArchivesModel; this.label2.Text = string.Format("姓名:{0}", model.UserName); this.label3.Text = string.Format("性别:{0}", model.Sex); this.label4.Text = string.Format("出生日期:{0}", model.Birthday.ToShortDateString()); this.label5.Text = string.Format("联系方式:{0}", model.Tel); this.label6.Text = string.Format("家庭住址:{0}", model.Address); this.label7.Text = string.Format("现住址:{0}", model.AddressNew); this.SetKuaiJianResult(); }