private void btnSave_Click(object sender, EventArgs e) { oPosition = new DataAccess.Position(); if (tbxPosition.Text.Trim() != String.Empty) { oMPosition = new Model.Position(); oMPosition.ID = eVariable.sID; oMPosition.POSITION = tbxPosition.Text; oMPosition.STATUS = chkStatus.Checked == true ? "ACTIVE" : "INACTIVE"; if (TransactionType == eVariable.TransactionType.EDIT) { oPosition.UpdatePosition(oMPosition); } else { if (oPosition.IsPositionExists(tbxPosition.Text)) { oFrmMsgBox = new frmMessageBox("RECORD ALREADY EXISTS"); oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); return; } oPosition = new DataAccess.Position(); oPosition.InsertPosition(oMPosition); } oFrmMsgBox = new frmMessageBox("RECORD SUCCESSFULLY SAVED"); oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO; oFrmMsgBox.ShowDialog(); LoadPosition(); eVariable.ClearText(panel3); TransactionType = eVariable.TransactionType.ADD; } }
void LoadPosition() { oPostion = new DataAccess.Position(); cboPosition.Items.Clear(); cboPosition.DataSource = oPostion.getPosition("", ""); cboPosition.DisplayMember = "POSITION"; cboPosition.ValueMember = "ID"; }
public void LoadPosition() { try { oPosition = new DataAccess.Position(); dgPosition.Rows.Clear(); eVariable.DisableGridColumnSort(dgPosition); foreach (DataRow row in oPosition.getPosition("", "").Rows) { dgPosition.Rows.Add(row[0], row[1], row[2]); } } catch (Exception ex) { } }
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) { } }