public void LoadParty() { try { oParty = new DataAccess.Party(); dgParty.Rows.Clear(); eVariable.DisableGridColumnSort(dgParty); foreach (DataRow row in oParty.getParty("", "").Rows) { dgParty.Rows.Add(row[0], row[1], row[2]); } } catch (Exception ex) { } }
private void btnSave_Click(object sender, EventArgs e) { oParty = new DataAccess.Party(); if (txtParty.Text.Trim() != String.Empty) { oMParty = new Model.Party(); oMParty.ID = eVariable.sID; oMParty.PARTY = txtParty.Text; oMParty.STATUS = chkStatus.Checked == true ? "ACTIVE" : "INACTIVE"; if (TransactionType == eVariable.TransactionType.EDIT) { if (!oParty.UpdateParty(oMParty)) { oFrmMsgBox = new frmMessageBox("THIS RECORD CANNOT BE UPDATED"); oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); TransactionType = eVariable.TransactionType.ADD; LoadParty(); eVariable.ClearText(panel3); return; } } else { if (oParty.IsPartyExists(txtParty.Text)) { oFrmMsgBox = new frmMessageBox("RECORD ALREADY EXISTS"); oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); return; } oParty = new DataAccess.Party(); oParty.InsertParty(oMParty); } oFrmMsgBox = new frmMessageBox("RECORD SUCCESSFULLY SAVED"); oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); TransactionType = eVariable.TransactionType.ADD; LoadParty(); eVariable.ClearText(panel3); } }
private void LoadRecords() { try { if (RecordType == RECORD_TYPE.STUDENT) { StudentGrid(); oStudent = new DataAccess.Student(); dgDetails.Rows.Clear(); foreach (DataRow row in oStudent.getCandidate(cboSearch.Text, txtSearch.Text).Rows) { dgDetails.Rows.Add(row["STUDENT_ID"], row["FIRST_NAME"], row["MIDDLE_NAME"], row["LAST_NAME"], row["DOB"], row["AGE"], row["COURSE"], row["SECTION"], row["ADDRESS"], row["CONTACT_NO"]); } } else if (RecordType == RECORD_TYPE.POSITION) { PositionGrid(); oPosition = new DataAccess.Position(); dgDetails.Rows.Clear(); foreach (DataRow row in oPosition.getCandidatePosition(cboSearch.Text, txtSearch.Text).Rows) { dgDetails.Rows.Add(row[0], row[1]); } } else if (RecordType == RECORD_TYPE.PARTY) { PartyGrid(); oParty = new DataAccess.Party(); dgDetails.Rows.Clear(); foreach (DataRow row in oParty.getCandidateParty(cboSearch.Text, txtSearch.Text).Rows) { dgDetails.Rows.Add(row[0], row[1]); } } } catch (Exception ex) { } }