예제 #1
0
        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;
            }
        }
예제 #2
0
 private void dgParty_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (oMParty.ID.Trim() != String.Empty)
     {
         eVariable.sID     = oMParty.ID;
         txtParty.Text     = oMParty.PARTY;
         chkStatus.Checked = oMParty.STATUS == "ACTIVE" ? true : false;
         TransactionType   = eVariable.TransactionType.EDIT;
     }
 }
예제 #3
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (oMPosition.ID.Trim() != String.Empty)
     {
         eVariable.sID     = oMPosition.ID;
         tbxPosition.Text  = oMPosition.POSITION;
         chkStatus.Checked = oMPosition.STATUS == "ACTIVE" ? true : false;
         TransactionType   = eVariable.TransactionType.EDIT;
     }
 }
예제 #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            oStudent  = new DataAccess.Student();
            oMStudent = new Model.Student();

            foreach (var oText in pnlMain.Controls.OfType <TextBox>().ToList())
            {
                if (oText.Text.Trim() == String.Empty)
                {
                    oFrmMsgBox             = new Forms.frmMessageBox(eVariable.MESSAGE.ALL_FIELDS_ARE_ALL_REQUIRED.ToString().Replace("_", " "));
                    oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
                    oFrmMsgBox.ShowDialog();
                    return;
                }
            }

            oMStudent.UNIQUE_ID   = txtStudentID.Text;
            oMStudent.FIRST_NAME  = txtFname.Text;
            oMStudent.MIDDLE_NAME = txtMname.Text;
            oMStudent.LAST_NAME   = txtLname.Text;
            oMStudent.DOB         = dtDOB.Value.ToString("yyyy-MM-dd");
            oMStudent.AGE         = txtAge.Text;
            oMStudent.COURSE      = txtCourse.Text;
            oMStudent.SECTION     = txtSection.Text;
            oMStudent.CONTACT_NO  = txtContactNo.Text;
            oMStudent.ADDRESS     = txtAddress.Text;

            if (TransactionType == eVariable.TransactionType.EDIT)
            {
                oStudent.UpdateStudent(oMStudent);
            }
            else
            {
                if (!oStudent.IsRecordExists(oMStudent))
                {
                    oStudent.InsertStudent(oMStudent);
                }
                else
                {
                    oFrmMsgBox             = new frmMessageBox(eVariable.MESSAGE.RECORD_ALREADY_EXISTS.ToString().Replace("_", " "));
                    oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
                    oFrmMsgBox.ShowDialog();
                    return;
                }
            }
            oFrmStudents.LoadStudents();
            oFrmMsgBox             = new frmMessageBox(eVariable.MESSAGE.RECORD_HAS_BEEN_SUCCESSFULLY_SAVE.ToString().Replace("_", " "));
            oFrmMsgBox.MessageType = frmMessageBox.MESSAGE_TYPE.INFO;
            oFrmMsgBox.ShowDialog();
            TransactionType = eVariable.TransactionType.ADD;
            Close();
        }
예제 #5
0
        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);
            }
        }
예제 #6
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     eVariable.ClearText(pnlMain);
     pImage.Image    = null;
     TransactionType = eVariable.TransactionType.ADD;
 }
예제 #7
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     eVariable.ClearText(panel3);
     TransactionType = eVariable.TransactionType.ADD;
 }
예제 #8
0
 private void frmParty_Load(object sender, EventArgs e)
 {
     LoadParty();
     TransactionType = eVariable.TransactionType.ADD;
 }