private void btn_Customer_Delete_Click(object sender, EventArgs e) { if (this.CustomerInfoListView.SelectedRows.Count <= 0) { MessageBox.Show("请选择要删除的人员"); } else { DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo(); if (customerdal.deleteCustomerWithId(this.CustomerInfoListView.SelectedRows[0].Cells[0].Value.ToString())) { MessageBox.Show("删除成功!"); { DataTable _dt = customerdal.selectCustomerInfoWithGroupAndKey(this.txb_SearchPassKey.Text, this.cmb_group.Text, ""); if (_dt != null) { this.CustomerInfoListView.DataSource = _dt; } } } else { MessageBox.Show("删除失败!"); } } }
private bool CheckInfoBeforeAdd() { if (!Regex.IsMatch(txb_VehicleNum.Text, @"^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$")) { MessageBox.Show("请填写正确的车牌号"); return(false); } if (cmb_VehicleKind.Text == "") { MessageBox.Show("请选择车辆类型"); return(false); } if (cmb_VehicleType.Text == "") { MessageBox.Show("请填写正确的车牌号"); return(false); } if (cbx_IsNewCustomer.Checked == false && SelectUserGrid.SelectedRows.Count <= 0) { MessageBox.Show("请选择车辆的所属人员"); return(false); } if (cbx_IsNewCustomer.Checked == true && !CheckInfo()) { MessageBox.Show("新增人员信息填写不正确"); return(false); } if (cbx_IsNewCustomer.Checked == true && txb_CustomerName.Text != "" && txb_IDCard.Text != "") { DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo(); DAL.DAO.CustomerDao customerdao = new DAL.DAO.CustomerDao(); customerdao.Name = this.txb_CustomerName.Text; customerdao.Sex = this.cmb_CustomerSex.Text; customerdao.Nation = this.cmb_Nation.Text; if (cmb_CustomerType.SelectedIndex == 0) { customerdao.Istemp = 0; } else { customerdao.Istemp = 1; } customerdao.Idcard = this.txb_IDCard.Text; customerdao.Address = this.txb_Address.Text; if (!customerdal.insertCustomerInfo(customerdao)) { MessageBox.Show("新增人员时出现错误!添加车辆失败"); return(false); } vehicle_ownerid = customerdal.GetCustomerIDWithIDCard(customerdao.Idcard); } return(true); }
private void btn_SearchUser_Click(object sender, EventArgs e) { DAL.DAL_CustomerInfo _customerdal = new DAL.DAL_CustomerInfo(); DataTable _dt = _customerdal.selectCustomerInfoWithGroupAndKey(this.txb_SearchUserKey.Text, "全部", ""); this.SelectGroupGrid.DataSource = _dt; }
private void btn_Customer_Search_Click(object sender, EventArgs e) { DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo(); DataTable _dt = customerdal.selectCustomerInfoWithGroupAndKey(this.txb_SearchPassKey.Text, this.cmb_group.Text, ""); if (_dt != null) { this.CustomerInfoListView.DataSource = _dt; } }
private void CustomerAuthorize_Load(object sender, EventArgs e) { DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo(); DAL.DAO.CustomerDao customerdao = customerdal.selectCustomerInfoID(customerid); this.lab_username.Text = customerdao.Name; this.lab_rfid.Text = customerdao.Rfid; GetCustomerGroup(); LoadLanguage(""); }
private void NewVehicleForm_Load(object sender, EventArgs e) { LoadLanguage(""); this.cmb_Nation.Items.Clear(); DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo(); DataTable _dt = customerdal.getNationTable(); if (_dt.Rows.Count > 0) { foreach (DataRow _row in _dt.Rows) { this.cmb_Nation.Items.Add(_row[1]); } } }
private void GetCustomerGroup() { DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo(); DataTable _dt = customerdal.SelectGroupWithCustomerID(customerid); if (_dt != null) { GroupCustomerIn.DataSource = _dt; } _dt = customerdal.SelectGroupCanJoinWithCustomerID(customerid); if (_dt != null) { GroupCanJoin.DataSource = _dt; } }
private void btn_Customer_ADD_Click(object sender, EventArgs e) { NewCustomerForm newcutomerform = new NewCustomerForm(); if (newcutomerform.ShowDialog() == DialogResult.OK) { { DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo(); DataTable _dt = customerdal.selectCustomerInfoWithGroupAndKey(this.txb_SearchPassKey.Text, this.cmb_group.Text, ""); if (_dt != null) { this.CustomerInfoListView.DataSource = _dt; } } } }
private void EditCustomerForm_Load(object sender, EventArgs e) { LoadLanguage(""); this.cmb_Nation.Items.Clear(); DAL.DAL_CustomerInfo userdal = new DAL.DAL_CustomerInfo(); DataTable _dt = userdal.getNationTable(); if (_dt.Rows.Count > 0) { foreach (DataRow _row in _dt.Rows) { this.cmb_Nation.Items.Add(_row[1]); } } userdao = userdal.selectCustomerInfoID(customerid); if (userdao == null) { MessageBox.Show("获取用户信息失败!"); this.Close(); } else { this.combo_CustomerSex.Text = userdao.Sex; this.txb_CustomerName.Text = userdao.Name; this.cmb_Nation.Text = userdao.Nation; this.txb_Address.Text = userdao.Address; this.txb_IDCard.Text = userdao.Idcard; this.txb_Rfid.Text = userdao.Rfid; this.txb_Remark.Text = userdao.Remark; if (userdao.Istemp == 0) { cmb_CustomerType.SelectedIndex = 0; } else { cmb_CustomerType.SelectedIndex = 1; } } }
private void btn_OK_Click(object sender, EventArgs e) { if (!CheckInfo()) { return; } userdao.Sex = this.combo_CustomerSex.Text; userdao.Name = this.txb_CustomerName.Text; userdao.Nation = this.cmb_Nation.Text; userdao.Address = this.txb_Address.Text; userdao.Idcard = this.txb_IDCard.Text; userdao.Rfid = this.txb_Rfid.Text; userdao.Remark = this.txb_Remark.Text; if (cmb_CustomerType.SelectedIndex == 0) { userdao.Istemp = 0; } else { userdao.Istemp = 1; } DAL.DAL_CustomerInfo userdal = new DAL.DAL_CustomerInfo(); bool updateresult = userdal.updateCustomerInfo(customerid, userdao); if (updateresult) { MessageBox.Show("修改成功"); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("修改失败"); } }
private void btn_OK_Click(object sender, EventArgs e) { if (!CheckInfo()) { return; } DAL.DAO.CustomerDao customerdao = new DAL.DAO.CustomerDao(); customerdao.Sex = this.cmb_CustomerSex.Text; customerdao.Name = this.txb_CustomerName.Text; customerdao.Nation = this.cmb_Nation.Text; customerdao.Address = this.txb_Address.Text; customerdao.Idcard = this.txb_IDCard.Text; customerdao.Rfid = this.txb_Rfid.Text; customerdao.Remark = this.txb_Remark.Text; if (cmb_CustomerType.SelectedIndex == 0) { customerdao.Istemp = 0; } else { customerdao.Istemp = 1; } DAL.DAL_CustomerInfo customerdal = new DAL.DAL_CustomerInfo(); if (customerdal.insertCustomerInfo(customerdao)) { MessageBox.Show("添加人员成功"); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("添加人员失败"); } }
public NewVehicleForm() { _resc = new ResourceManager(typeof(NewVehicleForm)); _customerdal = new DAL.DAL_CustomerInfo(); InitializeComponent(); }