private void mtbIdCard_Leave(object sender, EventArgs e) { //if (!CheckIDCard(mtbIdCard.Text.Trim())) //{ // MessageBox.Show("身份证格式不正确,请重新输入!"); // mtbIdCard.Focus(); // return; //} if (this.mtbIdCard.MaskCompleted) { DateTime time; this.mtbIdCard.Text = this.mtbIdCard.Text; // string str = this.mtbIdCard.Text.Substring(6, 8); //if (this.rd15.Checked) //{ // string str2 = this.mtbIdCard.Text.Substring(6, 6); // int num = DateTime.Now.Year - 0x7d0; // str = (int.Parse(str2.Substring(0, 2)) <= num) ? ("20" + str2) : ("19" + str2); //} //if (this.rd18.Checked) //{ // str = this.mtbIdCard.Text.Substring(6, 8); //} RecordsBaseInfoBLL archive_baseinfo = new RecordsBaseInfoBLL(); if (!string.IsNullOrEmpty(this.mtbIdCard.Text)) { RecordsBaseInfoModel model = archive_baseinfo.GetModel(this.mtbIdCard.Text); if (model != null) { this.inputIdCardInfo = model; this.tbName.Text = this.inputIdCardInfo.CustomerName; this.tbAddress.Text = this.inputIdCardInfo.HouseHoldAddress; //this.hadFoundIt(true); } else { this.hadFoundIt(false); } } } }
private void pbxSearch_Click(object sender, EventArgs e) { RecordsBaseInfoBLL archive_baseinfo = new RecordsBaseInfoBLL(); if (!string.IsNullOrEmpty(this.mtbIdCard.Text)) { RecordsBaseInfoModel model = archive_baseinfo.GetModel(this.mtbIdCard.Text); if (model != null) { int num2; this.inputIdCardInfo = model; this.tbName.Text = this.inputIdCardInfo.CustomerName; this.tbAddress.Text = this.inputIdCardInfo.HouseHoldAddress; this.hadFoundIt(true); } else { this.hadFoundIt(false); } } }
private void FrmInputIDCard_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(IDCardNo)) { this.mtbIdCard.Text = IDCardNo; RecordsBaseInfoBLL archive_baseinfo = new RecordsBaseInfoBLL(); if (!string.IsNullOrEmpty(this.mtbIdCard.Text)) { RecordsBaseInfoModel model = archive_baseinfo.GetModel(this.mtbIdCard.Text); if (model != null) { this.inputIdCardInfo = model; this.tbName.Text = this.inputIdCardInfo.CustomerName; this.tbAddress.Text = this.inputIdCardInfo.HouseHoldAddress; } else { this.hadFoundIt(false); } } } }
private void btnOK_Click(object sender, EventArgs e) { int num; if (string.IsNullOrWhiteSpace(this.mtbIdCard.Text)) { return; } bool flag = true; RecordsBaseInfoBLL archive_baseinfo = new RecordsBaseInfoBLL(); if (this.inputIdCardInfo == null) { this.inputIdCardInfo = archive_baseinfo.GetModel(this.mtbIdCard.Text.Trim()); } if (this.inputIdCardInfo == null) { if (!CheckIDCard(mtbIdCard.Text.Trim())) { MessageBox.Show("身份证格式不正确,请重新输入!"); mtbIdCard.Focus(); return; } if (string.IsNullOrEmpty(this.tbName.Text.Trim())) { flag = false; this.tbName.BackColor = Color.LightSalmon; } if (string.IsNullOrEmpty(this.mtbIdCard.Text.Trim())) { flag = false; this.mtbIdCard.BackColor = Color.LightSalmon; } else if (!this.mtbIdCard.MaskCompleted) { flag = false; this.mtbIdCard.BackColor = Color.LightSalmon; } if (!flag) { return; } this.inputIdCardInfo = new RecordsBaseInfoModel(); this.inputIdCardInfo.IDCardNo = this.mtbIdCard.Text.Trim(); this.inputIdCardInfo.Address = this.tbAddress.Text.Trim(); this.inputIdCardInfo.HouseHoldAddress = this.tbAddress.Text.Trim(); this.inputIdCardInfo.CustomerName = this.tbName.Text.Trim(); int id = int.Parse(mtbIdCard.Text.Substring(mtbIdCard.Text.Length - 2, 1)); if (id % 2 == 0) { this.inputIdCardInfo.Sex = "2"; } else { this.inputIdCardInfo.Sex = "1"; } DataSender.UserName = this.tbName.Text.Trim(); goto Label_0434; } if (((this.inputIdCardInfo.HouseHoldAddress == this.tbAddress.Text.Trim()) && (this.inputIdCardInfo.HouseHoldAddress == this.tbAddress.Text.Trim()))) { //if (((!bIRTHDAY.HasValue ? 0 : ((bIRTHDAY.GetValueOrDefault() == date) ? 1 : 0)) != 0) // && (this.inputIdCardInfo.Sex == Convert.ToString(this.cbSex.SelectedValue))) //{ // num = (this.inputIdCardInfo.CustomerName == this.tbName.Text) ? 1 : 0; // goto Label_016A; //} } num = 0; Label_016A: //if ((num == 0) && (MessageBox.Show("当前输入信息和原身份信息不一致,是否替换?", "输入不一致", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)) //{ // if (this.tbName.Text.Trim() == "") // { // MessageBox.Show("身份证姓名不能为空!无法替换原信息", "替换信息", MessageBoxButtons.OK, MessageBoxIcon.Hand); // return; // } // this.inputIdCardInfo.IDCardNo = this.mtbIdCard.Text.Trim(); // this.inputIdCardInfo.Address = this.tbAddress.Text.Trim(); // this.inputIdCardInfo.HouseHoldAddress = this.tbAddress.Text.Trim(); // this.inputIdCardInfo.CustomerName = this.tbName.Text.Trim(); // DataSender.UserName = this.tbName.Text.Trim(); //} Label_0434: this.inputIdCardInfo.CustomerName = this.tbName.Text.Trim(); base.DialogResult = DialogResult.OK; }