private void button1_Click(object sender, EventArgs e) { string jobnumber = textBox1_GH.Text; string name = textBox2_Name.Text; string sex = comboBox1_Sex.Text; string workunit = comboBox2_GZDW.Text; string birth = dateTimePicker1.Text; string password = textBox6_Pass.Text; string phone = textBox7_Phone.Text; string address = textBox8_Addr.Text; string idnumber = textBox9_SFZH.Text; string hiredate = dateTimePicker2.Text; WorkerEntity worker = new WorkerEntity(jobnumber, password, name, idnumber, sex, address, workunit, phone, birth, hiredate); IWorkerManageController manageController = new WorkerManageControllerImpl(); bool term = manageController.InsertWorkerInfo(worker); if (term == true) { WorkerManage form = new WorkerManage(); MessageBox.Show("添加职工信息成功!"); this.DialogResult = DialogResult.OK; this.Hide(); } else { MessageBox.Show("添加职工信息失败!"); } }
private void button1_Click(object sender, EventArgs e) { string supplierId = textBox1_GHSID.Text; string businessName = textBox2_Shop.Text; string contacts = textBox3_Name.Text; string phone = textBox4_Phone.Text; string address = textBox5_Address.Text; string settlementMethod = comboBox1_Cost.Text; SupplierEntity entity = new SupplierEntity(supplierId, businessName, contacts, phone, address, settlementMethod); ISupplierManageController manageController = new SupplierManageControllerImpl(); bool term = manageController.InsertSupplierInfo(entity); if (term == true) { WorkerManage form = new WorkerManage(); MessageBox.Show("添加供货商信息成功"); this.DialogResult = DialogResult.OK; this.Hide(); } else { MessageBox.Show("添加供货商信息失败!"); } }