示例#1
0
        public MinisterForm()
        {
            InitializeComponent();

            Draggable drag = new Draggable(this);

            drag.makeDraggable(controlBar_panel);

            dtpBirthdate.Value   = DateTime.Now;
            dtpBirthdate.MaxDate = DateTime.Now;


            cmbMinistryType.DataSource = Enum.GetValues(typeof(MinistryType));
            cmbStatus.DataSource       = Enum.GetValues(typeof(MinisterStatus));
        }
示例#2
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();
            }
        }
示例#3
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);
            }
        }
示例#4
0
        private void IncomeType_Load(object sender, EventArgs e)
        {
            Draggable draggable = new Draggable(this);

            draggable.makeDraggable(controlBar_panel);

            refreshIncomeType();

            if ((IncomeTypeID == 1 || IncomeTypeID == 2 || IncomeTypeID == 3) && cashreceipt_cashdisbursment == 1)
            {
                cancel_button.Visible      = false;
                save_button.Visible        = false;
                name_textbox.Enabled       = false;
                book_combobox.Enabled      = false;
                suggestedPrice_nud.Enabled = false;
                active_button.Enabled      = false;
                details_textbox.Enabled    = false;
            }
        }
示例#5
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);
        }
示例#6
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();
        }
        private void Bloodletting_Details_Popup_Load(object sender, EventArgs e)
        {
            Draggable draggable = new Draggable(this);

            draggable.makeDraggable(controlBar_panel);

            if (hasProfile)
            {
                profileViewmode();
                DataTable dt = dh.getBloodDonor(ProfileID);
                firstname_label_bloodletting.Text = dt.Rows[0]["firstname"].ToString();
                mi_label_bloodletting.Text        = dt.Rows[0]["midname"].ToString();
                lastname_label_bloodletting.Text  = dt.Rows[0]["lastname"].ToString();
                suffix_label_bloodletting.Text    = dt.Rows[0]["suffix"].ToString();
                bloodtype_label.Text       = bloodType[int.Parse(dt.Rows[0]["bloodtype"].ToString()) - 1];
                address_textbox.Text       = dt.Rows[0]["address"].ToString();
                contactNumber_textbox.Text = dt.Rows[0]["contactNumber"].ToString();
            }
            else
            {
                profileEditmode();
            }
        }
示例#8
0
        private void ORdetailsPopUp_Load(object sender, EventArgs e)
        {
            Draggable draggable = new Draggable(this);

            draggable.makeDraggable(controlBar_panel);
            or_label.Text = OR.ToString();

            if (OR != 0)
            {
                details_dgv.DataSource = dh.getORdetails(BookType, OR);
                foreach (DataGridViewColumn dc in details_dgv.Columns)
                {
                    dc.Visible = false;
                }
                float sum = 0;
                foreach (DataGridViewRow dgvr in details_dgv.Rows)
                {
                    sum += float.Parse(dgvr.Cells["total"].Value.ToString());
                }
                total_label.Text = sum.ToString("0.00");

                source_name.Text     = details_dgv.Rows[0].Cells["sourceName"].Value.ToString();
                or_label.Text        = details_dgv.Rows[0].Cells["ORnum"].Value.ToString();
                datepaid_label.Text  = details_dgv.Rows[0].Cells["primaryIncomeDateTime"].Value.ToString();
                remarks_textbox.Text = details_dgv.Rows[0].Cells["remarks"].Value.ToString();
                details_dgv.Columns["sourceName"].Visible            = false;
                details_dgv.Columns["ORnum"].Visible                 = false;
                details_dgv.Columns["primaryIncomeDateTime"].Visible = false;
                details_dgv.Columns["remarks"].Visible               = false;

                details_dgv.Columns["price"].Visible    = true;
                details_dgv.Columns["quantity"].Visible = true;
                details_dgv.Columns["total"].Visible    = true;
                details_dgv.Columns["itemType"].Visible = true;

                details_dgv.Columns["price"].HeaderText    = "Price";
                details_dgv.Columns["quantity"].HeaderText = "Quantity";
                details_dgv.Columns["total"].HeaderText    = "Total";
                details_dgv.Columns["itemType"].HeaderText = "Item";
            }
            else
            {
                details_dgv.DataSource = dh.getCVdetails(BookType, CV);
                foreach (DataGridViewColumn dc in details_dgv.Columns)
                {
                    dc.Visible = false;
                }
                float sum = 0;
                foreach (DataGridViewRow dgvr in details_dgv.Rows)
                {
                    sum += float.Parse(dgvr.Cells["releaseAmount"].Value.ToString());
                }
                total_label.Text     = sum.ToString("0.00");
                source_name.Text     = details_dgv.Rows[0].Cells["name"].Value.ToString();
                CN_label.Text        = details_dgv.Rows[0].Cells["checknum"].Value.ToString();
                CV_label.Text        = details_dgv.Rows[0].Cells["CVnum"].Value.ToString();
                datepaid_label.Text  = details_dgv.Rows[0].Cells["cashReleaseDateTime"].Value.ToString();
                remarks_textbox.Text = details_dgv.Rows[0].Cells["remark"].Value.ToString();
                details_dgv.Columns["name"].Visible                = false;
                details_dgv.Columns["checkNum"].Visible            = false;
                details_dgv.Columns["CVnum"].Visible               = false;
                details_dgv.Columns["cashReleaseDateTime"].Visible = false;
                details_dgv.Columns["remark"].Visible              = false;
                foreach (DataGridViewColumn dgvr in details_dgv.Columns)
                {
                    dgvr.Visible = false;
                }
                details_dgv.Columns["releaseAmount"].Visible    = true;
                details_dgv.Columns["itemType"].Visible         = true;
                details_dgv.Columns["releaseAmount"].HeaderText = "Caash Release Amount";
                details_dgv.Columns["itemType"].HeaderText      = "Cash Item Type";

                /*
                 * details_dgv.Columns["price"].Visible = true;
                 * details_dgv.Columns["quantity"].Visible = true;
                 * details_dgv.Columns["total"].Visible = true;
                 * details_dgv.Columns["itemType"].Visible = true;
                 *
                 * details_dgv.Columns["price"].HeaderText = "Price";
                 * details_dgv.Columns["quantity"].HeaderText = "Quantity";
                 * details_dgv.Columns["total"].HeaderText = "Total";
                 * details_dgv.Columns["itemType"].HeaderText = "Item";
                 */
            }
        }
示例#9
0
        private void SAD2_Load(object sender, EventArgs e)
        {
            Draggable drag = new Draggable(this);

            drag.makeDraggable(panel_controlbox);
            drag.makeDraggable(panel2);


            if (User.getCurrentUser().Privilege == 0)//None
            {
                sacrament_cabinet_panel.Visible    = false;
                cash_cabinet_panel.Visible         = false;
                bloodletting_cabinet_panel.Visible = false;
                admin_cabinet_panel.Visible        = false;
            }
            else if (User.getCurrentUser().Privilege == 1)//ADMIN
            {
                sacrament_cabinet_panel.Visible    = false;
                cash_cabinet_panel.Visible         = false;
                bloodletting_cabinet_panel.Visible = false;
                admin_cabinet_panel.Visible        = true;

                SubMenu.Add(admin_cabinet, new Panel_Size_Pair(194, 50, admin_cabinet_panel, false));
            }
            else if (User.getCurrentUser().Privilege == 2)//TREASURER
            {
                sacrament_cabinet_panel.Visible    = false;
                cash_cabinet_panel.Visible         = true;
                bloodletting_cabinet_panel.Visible = false;
                admin_cabinet_panel.Visible        = false;

                SubMenu.Add(cash_cabinet, new Panel_Size_Pair(295, 50, cash_cabinet_panel, false));
            }
            else if (User.getCurrentUser().Privilege == 3)//SECRETARY
            {
                sacrament_cabinet_panel.Visible    = true;
                cash_cabinet_panel.Visible         = true;
                bloodletting_cabinet_panel.Visible = true;
                admin_cabinet_panel.Visible        = false;

                CDBreport_button.Visible    = false;
                CDB_button_menu.Visible     = false;
                CRBreport_button.Visible    = true;
                CRB_button_menu.Visible     = true;
                itemtypemenu_button.Visible = true;
                SubMenu.Add(sacrament_cabinet, new Panel_Size_Pair(204, 50, sacrament_cabinet_panel, false));
                SubMenu.Add(cash_cabinet, new Panel_Size_Pair(198, 50, cash_cabinet_panel, false));
                SubMenu.Add(bloodletting_cabinet, new Panel_Size_Pair(285, 50, bloodletting_cabinet_panel, false));
            }
            else if (User.getCurrentUser().Privilege == 4)//ALL
            {
                sacrament_cabinet_panel.Visible    = true;
                cash_cabinet_panel.Visible         = true;
                bloodletting_cabinet_panel.Visible = true;
                admin_cabinet_panel.Visible        = true;

                SubMenu.Add(sacrament_cabinet, new Panel_Size_Pair(204, 50, sacrament_cabinet_panel, false));
                SubMenu.Add(cash_cabinet, new Panel_Size_Pair(295, 50, cash_cabinet_panel, false));
                SubMenu.Add(bloodletting_cabinet, new Panel_Size_Pair(285, 50, bloodletting_cabinet_panel, false));
                SubMenu.Add(admin_cabinet, new Panel_Size_Pair(194, 50, admin_cabinet_panel, false));
            }
        }
示例#10
0
        private void LoginForm_Load(object sender, EventArgs e)
        {
            Draggable a = new Draggable(this);

            a.makeDraggable(panel1);
        }
示例#11
0
        private void AdminCredentials_Load(object sender, EventArgs e)
        {
            Draggable draggable = new Draggable(this);

            draggable.makeDraggable(controlBar_panel);
        }
示例#12
0
        private void PersonView_Load(object sender, EventArgs e)
        {
            Draggable drag = new Draggable(this);

            drag.makeDraggable(controlBar_panel);

            foreach (DataRow dr in Applications.Rows)
            {
                if (int.Parse(dr["sacramentType"].ToString()) == (int)SacramentType.Baptism)
                {
                    baptism_label_menu.Enabled = true;
                }
                else if (int.Parse(dr["sacramentType"].ToString()) == (int)SacramentType.Confirmation)
                {
                    confirmation_label_menu.Enabled = true;
                }
                else if (int.Parse(dr["sacramentType"].ToString()) == (int)SacramentType.Marriage)
                {
                    marriage_label_menu.Enabled = true;
                }
            }
            DataTable temp = dh.getGeneralProfile(ProfileID);

            lastname_label.Text  = temp.Rows[0]["lastname"].ToString();
            suffix_label.Text    = temp.Rows[0]["suffix"].ToString();
            firstname_label.Text = temp.Rows[0]["firstname"].ToString();
            mi_label.Text        = temp.Rows[0]["midname"].ToString();
            if (temp.Rows[0]["birthdate"].ToString() != "")
            {
                birthdate_label.Text = DateTime.Parse(temp.Rows[0]["birthdate"].ToString()).ToString("MMMM dd, yyyy");
            }
            else
            {
                birthdate_panel.Visible = false;
            }

            if (temp.Rows[0]["gender"].ToString() != "")
            {
                if (int.Parse(temp.Rows[0]["gender"].ToString()) == (int)Gender.Male)
                {
                    gender_label.Text = "Male";
                }
                else if (int.Parse(temp.Rows[0]["gender"].ToString()) == (int)Gender.Female)
                {
                    gender_label.Text = "Female";
                }
            }
            else
            {
                gender_panel.Visible = false;
            }


            if (temp.Rows[0]["birthplace"].ToString() != "")
            {
                po_label.Text = temp.Rows[0]["birthplace"].ToString();
            }
            else
            {
                po_panel.Visible = false;
            }
            if (temp.Rows[0]["residence"].ToString() != "")
            {
                residence_label.Text = temp.Rows[0]["residence"].ToString();
            }
            else
            {
                residence_panel.Visible = false;
            }


            refreshParent();
        }