private void btnsave_Click(object sender, EventArgs e) { if (cboEmp.Text != "") { String[] c = cboEmp.Text.ToString().Split('-'); String id = c[1] + "-" + c[2]; Emp_Benefit eb = new Emp_Benefit(); eb.empid = id; eb.benefit_code = cboBenefits.Text; if (chkNa.Checked) { eb.emp_benefit_code = "N/A"; } else { eb.emp_benefit_code = txtemp_benefit_code.Text; } if (eb.save()) { MessageBox.Show("Successful", "Save"); } else { MessageBox.Show("There was a problem saving employee benefits: \n" + db.err.Message, "Failed"); } this.Parent.Height = 0; this.Parent.Controls.Clear(); this.Dispose(); } }
private void emp_benefit_ctrl_Load(object sender, EventArgs e) { Emp_Benefit eb = new Emp_Benefit(); eb.LoadOnListView(this.lv); }