private CCCSDDSS GetFormData() { CCCSDDSS oCCSDDSS = new CCCSDDSS(); oCCSDDSS.Code = txtCode.Text.Trim(); oCCSDDSS.Name = txtName.Text.Trim(); oCCSDDSS.IsActive = true; return(oCCSDDSS); }
private void btnUpdate_Click(object sender, EventArgs e) { CCCSDDSS oCCSDDSS = GetFormData(); CCCSDDSSBO oCCSDDSSBO = new CCCSDDSSBO(); CResult oResult = new CResult(); oResult = oCCSDDSSBO.Update(oCCSDDSS, this.eTable); if (oResult.IsSuccess) { MessageBox.Show("Updated successfully"); } else { MessageBox.Show(oResult.ErrMsg); } LoadAllCCSDDSS(); }
private void btnDelete_Click(object sender, EventArgs e) { if (DialogResult.OK == MessageBox.Show("Are you want to delete " + txtCode.Text + " ?", "Confirmation!", MessageBoxButtons.OKCancel)) { CCCSDDSS oCCSDDSS = GetFormData(); CCCSDDSSBO oCCSDDSSBO = new CCCSDDSSBO(); CResult oResult = new CResult(); oResult = oCCSDDSSBO.Delete(oCCSDDSS, this.eTable); if (oResult.IsSuccess) { MessageBox.Show("Deleted successfully"); } else { MessageBox.Show(oResult.ErrMsg); } LoadAllCCSDDSS(); } }