private void btnSave_Click(object sender, EventArgs e) { using (OfficialBusiness ob = new OfficialBusiness()) { ob.OBCode = _strOBCode; ob.Fill(); ob.DateFile = clsDateTime.CombineDateTime(dtpFileDate.Value, dtpFileTime.Value); ob.Reason = txtReason.Text; if (_strOBType == "1") { ob.RADate = clsDateTime.CombineDateTime(dtpRDate.Value, dtpRTime.Value); ob.RARemarks = txtRRemarks.Text; ob.RAStatus = cmbRStatus.SelectedValue.ToString(); } ob.HADate = clsDateTime.CombineDateTime(dtpHDate.Value, dtpHTime.Value); ob.HARemarks = txtHRemarks.Text; ob.HAStatus = cmbHStatus.SelectedValue.ToString(); ob.Status = cmbStatus.SelectedValue.ToString(); if (ob.UpdateAdmin() > 0) { _frmOBList.BindOBList(); this.Close(); MessageBox.Show("Official Business Leave has been filed successfully", "OB Leave", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void btnSave_Click(object sender, EventArgs e) { using (OfficialBusiness ob = new OfficialBusiness()) { ob.OBCode = _strOBCode; ob.Fill(); ob.DateFile = clsDateTime.CombineDateTime(dtpFileDate.Value, dtpFileTime.Value); ob.Reason = txtReason.Text; if (_strOBType == "1") { ob.RADate = clsDateTime.CombineDateTime(dtpRDate.Value, dtpRTime.Value); ob.RARemarks = txtRRemarks.Text; ob.RAStatus = cmbRStatus.SelectedValue.ToString(); } ob.HADate = clsDateTime.CombineDateTime(dtpHDate.Value, dtpHTime.Value); ob.HARemarks = txtHRemarks.Text; ob.HAStatus = cmbHStatus.SelectedValue.ToString(); ob.Status = cmbStatus.SelectedValue.ToString(); if (ob.UpdateAdmin() > 0) { _frmOBList.BindOBList(); this.Close(); } } }