示例#1
0
        private void subm3_Click(object sender, EventArgs e)
        {
            String day = DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + "-" + DateTime.Today.Day.ToString();

            int r = genRefNo(1);

            refNum.Text = "Reference Number : ";
            for (int i = 1; i <= (5 - r.ToString().Length); i++)        //apends 0 to the front of the generated reference number to
            {                                                           //make its length exactly 5
                refNum.Text += "0";
            }
            refNum.Text   += r;
            refNum.Visible = true;

            Appeal temp = new Appeal(r, Int32.Parse(accNumBx.Text), applCmb.SelectedItem.ToString(), aplSubCmb.SelectedItem.ToString(), day);

            cdb.storeAppeal(db2, temp);
        }
示例#2
0
        //Takes the details of an appeal object into a string array for display purposes
        private String[] printAppeal(String rn)
        {
            Appeal temp = cdb.retAppeal(db2, rn);

            if (temp == null)
            {
                return(new String[] { "Appeal not found!", "Please check whether the entered reference number is correct." });
            }

            String[] r = new String[6];

            r[0] = "Appeal : " + temp.getType() + " - " + temp.getSub();
            r[1] = "Reference Number : " + temp.getReference();
            r[2] = "Submitted on : " + temp.getSubmit();

            if (temp.isValidated())
            {
                r[3] = "Validated: Yes";
            }
            else
            {
                r[3] = "Validated: No";
            }

            if (temp.isCompleted())
            {
                r[4] = "Completed on : " + temp.getComplete();
            }
            else
            {
                r[4] = "Progress : " + temp.getProgress();
            }

            if (String.IsNullOrWhiteSpace(temp.getAdd()))
            {
                r[5] = "";
            }
            else
            {
                r[5] = "Additional details: " + temp.getAdd();
            }

            return(r);
        }
示例#3
0
        //Retrieves the Appeal object with the given reference number from the database
        public Appeal retAppeal(Water_Board_Management.Database d, String rn)
        {
            if (!(d.hasEntry(rn)))
                return null;

            String[] det = d.getRow(rn);
            Appeal temp = new Appeal(Int32.Parse(det[0]), Int32.Parse(det[1]), det[2], det[3], det[6]);
            if (det[5].Equals("True"))
            {
                temp.complete();
                temp.setComplete(det[7]);
            }
            if (det[9].Equals("True"))
                temp.validate();
            temp.setAdditional(det[4]);
            temp.setProgress(det[8]);

            return temp;
        }
示例#4
0
        //Retrieves the Appeal object with the given reference number from the database
        public Appeal retAppeal(Water_Board_Management.Database d, String rn)
        {
            if (!(d.hasEntry(rn)))
            {
                return(null);
            }

            String[] det  = d.getRow(rn);
            Appeal   temp = new Appeal(Int32.Parse(det[0]), Int32.Parse(det[1]), det[2], det[3], det[6]);

            if (det[5].Equals("True"))
            {
                temp.complete();
                temp.setComplete(det[7]);
            }
            if (det[9].Equals("True"))
            {
                temp.validate();
            }
            temp.setAdditional(det[4]);
            temp.setProgress(det[8]);

            return(temp);
        }
示例#5
0
 //Stores an Appeal object in the database
 public void storeAppeal(Water_Board_Management.Database d, Appeal apl)
 {
     Water_Board_Management.AppealRow ar = new Water_Board_Management.AppealRow(apl.getReference(), apl.getAccount(), apl.getType(), apl.getSub(), apl.getAdd(), apl.isCompleted(), apl.getSubmit(), apl.getComplete(), apl.getProgress(), apl.isValidated());
     d.insert(ar);
 }
示例#6
0
 //Stores an Appeal object in the database
 public void storeAppeal(Water_Board_Management.Database d, Appeal apl)
 {
     Water_Board_Management.AppealRow ar = new Water_Board_Management.AppealRow(apl.getReference(), apl.getAccount(), apl.getType(), apl.getSub(), apl.getAdd(), apl.isCompleted(), apl.getSubmit(), apl.getComplete(), apl.getProgress(), apl.isValidated());
     d.insert(ar);
 }
示例#7
0
        private void subm3_Click(object sender, EventArgs e)
        {
            String day = DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + "-" + DateTime.Today.Day.ToString();

            int r = genRefNo(1);
            refNum.Text = "Reference Number : ";
            for (int i = 1; i <= (5 - r.ToString().Length); i++)	//apends 0 to the front of the generated reference number to
            {														//make its length exactly 5
                refNum.Text += "0";
            }
            refNum.Text += r;
            refNum.Visible = true;

            Appeal temp = new Appeal(r, Int32.Parse(accNumBx.Text),applCmb.SelectedItem.ToString(),aplSubCmb.SelectedItem.ToString(),day);
            cdb.storeAppeal(db2, temp);
        }