예제 #1
0
        private void openAdvanceSearch(SacramentType t)
        {
            using (AdvanceSearch s = new AdvanceSearch(t))
            {
                DialogResult dr = s.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    DataGridView dgv = getDGV(t);
                    DataTable    dt  = ((BindingSource)dgv.DataSource).DataSource as DataTable;

                    dt.DefaultView.RowFilter = s.filter;
                    clearAndDisable(t);
                }
            }
        }
예제 #2
0
 private DataGridView getDGV(SacramentType t)
 {
     if (t == SacramentType.Baptism)
     {
         return(dgvBaptism);
     }
     else if (t == SacramentType.Confirmation)
     {
         return(dgvConfirmation);
     }
     else
     {
         return(dgvMarriage);
     }
 }
예제 #3
0
        public SacramentForm(OperationType operation, SacramentType type, DataRow dr)
        {
            InitializeComponent();

            this.dh        = DataHandler.getDataHandler();
            this.row       = dr;
            this.type      = type;
            this.operation = operation;

            Draggable drag = new Draggable(this);

            drag.makeDraggable(controlBar_panel);



            if (type == SacramentType.Confirmation)
            {
                legitimacyCBox.Hide();
                label3.Hide();
                sacramentDateLabel.Text = "Confirmation Date";
                this.Text = "Confirmation Fill-up Form";
            }

            int       profileID = Convert.ToInt32(row["profileID"].ToString());
            DataTable dt        = dh.getGeneralProfile(profileID);



            //4 - First Name 5 - MI 6 - Last Name   7 - Suffix
            nameLabel.Text = string.Format("{0} {1}. {2} {3}", row["firstName"], row["midName"], row["lastName"], row["suffix"]);
            //MessageBox.Show(dt.Rows[0]["birthDate"].ToString());
            birthdateLabel.Text = DateTime.ParseExact(dt.Rows[0]["birthDate"].ToString(), "dd/MM/yyyy hh:mm:ss tt", null).ToString("yyyy-MM-dd");
            genderLabel.Text    = dt.Rows[0]["gender"].ToString() == "1" ? "Male" : "Female";

            txtBirthplace.Text        = dt.Rows[0]["birthplace"].ToString();
            legitimacyCBox.DataSource = Enum.GetValues(typeof(Legitimacy));
            loadMinisters();
            loadParents();

            if (operation == OperationType.Edit)
            {
                //Baptism Date or COnfirmation Date
                sacramentDateDTP.MinDate = DateTime.ParseExact(dt.Rows[0]["birthdate"].ToString(), "dd/MM/yyyy hh:mm:ss tt", null);
                remarksText.Text         = row["remarks"].ToString();
                loadSponsors();
            }
        }
예제 #4
0
        public AdvanceSearch(SacramentType t)
        {
            InitializeComponent();
            DataTable dt = dh.getMinisters();

            this.t = t;

            Draggable drag = new Draggable(this);

            drag.makeDraggable(panel2);

            foreach (DataRow dr in dt.Rows)
            {
                ComboboxContent cc = new ComboboxContent(int.Parse(dr["ministerID"].ToString()), dr["name"].ToString());
                cmbMinister.Items.Add(cc);
            }
        }
예제 #5
0
        private GetSacrament getSacrament(SacramentType t)
        {
            GetSacrament s;

            if (t == SacramentType.Baptism)
            {
                s = dh.getBaptisms;
            }
            else if (t == SacramentType.Confirmation)
            {
                s = dh.getConfirmations;
            }
            else
            {
                s = dh.getMarriages;
            }

            return(s);
        }
예제 #6
0
        public ApplicationPayment(SacramentType type, DataGridViewRow dr, DataHandler dh)
        {
            InitializeComponent();
            this.dh   = dh;
            this.type = type;
            this.row  = dr.Cells;

            Draggable drag = new Draggable(this);

            drag.makeDraggable(panel1);

            int applicationID = int.Parse(row[0].Value.ToString());

            sacramentIncomeID = dh.getSacramentIncomeID(applicationID);


            if (type == SacramentType.Marriage)
            {
                //Escaped ampersand by &&
                lblName.Text = row["groomName"].Value + " && " + row["brideName"].Value;
            }
            else
            {
                lblName.Text = string.Join(" ", row[4].Value, row[5].Value, row[6].Value, row[7].Value);
            }

            DataTable sacramentIncome = dh.getSacramentIncome(applicationID);

            lblPaymentFor.Text = type.ToString();
            lblOR.Text         = dh.getNextOR(BookType.Parish).ToString();
            lblDate.Text       = DateTime.Now.ToString("yyyy-MM-dd");

            lblPrice.Text    = string.Format("{0:C}", double.Parse(sacramentIncome.Rows[0]["price"].ToString()));
            remainingBalance = dh.getBalanceOfSacramentIncome(sacramentIncomeID);
            lblBalance.Text  = string.Format("{0:C}", remainingBalance);

            dgvPaymentHistory.AutoGenerateColumns = false;
            dgvPaymentHistory.DataSource          = dh.getPaymentHistory(sacramentIncomeID);

            nudPayment.Maximum = Convert.ToDecimal(remainingBalance);
        }
예제 #7
0
        public AddApplication(SacramentType type)
        {
            InitializeComponent();
            sacramentType = type;

            this.dh = DataHandler.getDataHandler();

            Draggable drag = new Draggable(this);

            drag.makeDraggable(this);
            drag.makeDraggable(panel1);

            birthdate_dtp.MaxDate = DateTime.Today;
            birthdate_dtp.Value   = DateTime.Today;

            this.sacramentType = type;
            label1.Text        = sacramentType + " Application";
            sacramentItem      = dh.getItem(sacramentType.ToString());
            nupPrice.Maximum   = Int32.MaxValue;
            nupPrice.Text      = sacramentItem.Rows[0]["suggestedPrice"].ToString();
        }