Example #1
0
        private void buttonWaitingSubmit_Click(object sender, EventArgs e)//save button action
        {
            appToAccept1.setname(textBoxWaitingName.Text);
            appToAccept1.setaddress(textBoxWaitingAddress.Text);
            appToAccept1.setcontact(int.Parse(textBoxWaitingContact.Text));
            //if only one document is confirmed and the other still not, update database 'application'
            if (!(appToAccept1.confirmA == 2 && appToAccept1.confirmG == 2) && !(appToAccept1.confirmA == 1 && appToAccept1.confirmG == 1))
            {
                dbapp1.updateMany(new string[] { "name", "mail", "contact", "confirmG", "confirmA" }, listViewApplicants.SelectedItems[0].Text,
                                  new string[] { textBoxWaitingName.Text, textBoxWaitingAddress.Text, textBoxWaitingContact.Text, appToAccept1.confirmG.ToString()
                                                 , appToAccept1.confirmA.ToString() });
            }

            //if both are confirmed add data to 'inprogress' database and delete data from 'application' database
            else if (appToAccept1.confirmA == 1 && appToAccept1.confirmG == 1)
            {
                string[] vals = dbapp1.getRow(listViewApplicants.SelectedItems[0].Text);
                dbprog.insert(new InProgressRow(vals[0], textBoxWaitingName.Text, vals[2], vals[3], vals[4], vals[5], vals[6], vals[7], textBoxWaitingAddress.Text,
                                                vals[9], int.Parse(textBoxWaitingContact.Text), vals[11], true, vals[13], vals[14], int.Parse(vals[15]), vals[16], vals[17],
                                                "Approved", ""));
                dbapp1.delete(listViewApplicants.SelectedItems[0].Text);
                clr();
            }
            clr();
        }
Example #2
0
        private void buttonProgressSubmit_Click(object sender, EventArgs e)//save button action
        {
            textBoxInProgressName.ReadOnly = textBoxInProgressContact.ReadOnly = textBoxInProgressAddress.ReadOnly = true;
            buttonNextProgress.Enabled     = false;
            if (listboxindex != 7)
            {
                //if not finalized update the datebase 'inprogress'
                appToProgress.setname(textBoxInProgressName.Text);
                appToProgress.setaddress(textBoxInProgressAddress.Text);
                appToProgress.setcontact(int.Parse(textBoxInProgressContact.Text));
                String[] progress = { "Approved",    "Visited",                "Estimated", "Voucher Prepared", "Payment Received",
                                      "Bond Signed", "Connection Established", "Finalized" };
                appToProgress.setprogress(progress[listboxindex]);

                dbprog.updateMany(new string[] { "name", "mail", "contact", "progress" },
                                  listViewInProgress.SelectedItems[0].Text,
                                  new string[] { textBoxInProgressName.Text, textBoxInProgressAddress.Text, textBoxInProgressContact.Text, appToProgress.progress });
                clrprog();
            }
        }