private void button1_Click(object sender, EventArgs e)
        {
            if (HasError() == true)
            {
                MessageBox.Show("Errors detected!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            Fee fee = new Fee();

            fee.FeeID        = _Fee.FeeID;
            fee.FeeDesc      = txtFee.Text;
            fee.FeeType      = cmbFeeType.Text;
            fee.YearLeveLID  = YearLevel.GetYearLevel(cmbEducationLevel.Text, cmbYearLevel.Text).YearLevelID;
            fee.Amount       = Convert.ToDouble(txtFeeAmount.Text);
            fee.SchoolYearID = Utilties.GetActiveSchoolYear();
            fee.SemesterID   = Utilties.GetActiveSemester();

            bool result = false;

            result = Fee.InsertUpdateFee(fee);

            if (result == true)
            {
                MessageBox.Show("Fee has been successfully saved!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Fee saving failed!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemple #2
0
        private int GetStudentYearLevelID()
        {
            _educationLevel = txtEducationLevel.Text;
            _yearLevel      = txtYearLevel.Text;
            _section        = txtSection.Text;

            int yearLevelID = YearLevel.GetYearLevel(_educationLevel, _yearLevel).YearLevelID;

            return(yearLevelID);
        }
        public frm_settings_fee_entry(Fee fee)
        {
            InitializeComponent();

            _Fee = fee;
            YearLevel yearLevel = YearLevel.GetYearLevel(fee.YearLeveLID);

            txtFee.Text            = fee.FeeDesc;
            txtFeeAmount.Text      = fee.Amount.ToString("n");
            cmbFeeType.Text        = fee.FeeType;
            cmbEducationLevel.Text = yearLevel.EducationLevel;
            cmbYearLevel.Text      = yearLevel.YearLvl;
        }
Exemple #4
0
        public frm_discount_entry_percentage(Discount discount)
        {
            InitializeComponent();

            _Discount = discount;
            YearLevel yearLevel = YearLevel.GetYearLevel(discount.YearLeveLID);

            txtDiscountCode.Text   = discount.DiscountCode;
            cmbEducationLevel.Text = yearLevel.EducationLevel;
            cmbYearLevel.Text      = yearLevel.YearLvl;

            txtTFee.Text = discount.TFee.ToString();
            txtMFee.Text = discount.MFee.ToString();
            txtOFee.Text = discount.OFee.ToString();
        }
Exemple #5
0
 private void DisplayDiscounts()
 {
     _Discounts = Discount.GetDiscounts();
     dataGridView3.Rows.Clear();
     foreach (var item in _Discounts)
     {
         if (item.Type == "PERCENTAGE")
         {
             dataGridView3.Rows.Add(item.DiscountID, YearLevel.GetYearLevel(item.YearLeveLID).YearLvl, item.DiscountCode, item.Type, item.TotalValue, item.TFee, item.MFee, item.OFee, item.DateCreated);
         }
         else
         {
             dataGridView3.Rows.Add(item.DiscountID, YearLevel.GetYearLevel(item.YearLeveLID).YearLvl, item.DiscountCode, item.Type, item.TotalValue.ToString("n"), item.TFee * 100, item.MFee * 100, item.OFee * 100, item.DateCreated);
         }
     }
 }
Exemple #6
0
        private void dgSummary_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            YearLevel  yearLevel = YearLevel.GetYearLevel(dgSummary.Rows[e.RowIndex].Cells[0].Value.ToString(), dgSummary.Rows[e.RowIndex].Cells[1].Value.ToString());
            List <Fee> fees      = Fee.GetFees(yearLevel.YearLevelID);

            txtEducationLevel.Text = yearLevel.EducationLevel;
            txtYearLevel.Text      = yearLevel.YearLvl;

            dgBreakdown.Tag = fees;
            comboBox1.Text  = "ALL";
            dgBreakdown.Rows.Clear();

            foreach (var item in fees)
            {
                dgBreakdown.Rows.Add(item.FeeID, item.FeeDesc, item.FeeType, item.Amount.ToString("n"));
            }
        }
Exemple #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (HasError() == true)
            {
                MessageBox.Show("Errors detected!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }


            Discount discount = new Discount()
            {
                DiscountID   = _Discount.DiscountID,
                DiscountCode = txtDiscountCode.Text,
                YearLeveLID  = YearLevel.GetYearLevel(cmbEducationLevel.Text, cmbYearLevel.Text).YearLevelID,
                Type         = "PERCENTAGE",
                TotalValue   = Convert.ToDouble(txtTFee.Text) + Convert.ToDouble(txtMFee.Text) + Convert.ToDouble(txtOFee.Text),
                TFee         = Convert.ToDouble(txtTFee.Text),
                MFee         = Convert.ToDouble(txtMFee.Text),
                OFee         = Convert.ToDouble(txtOFee.Text),
                SchoolYearID = Utilties.GetActiveSchoolYear()
            };

            bool result = false;

            result = Discount.InsertUpdateDiscount(discount);



            if (result == true)
            {
                MessageBox.Show("Discount has been successfully saved!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Close();
                Dispose();
            }
            else
            {
                MessageBox.Show("Some error occured while trying to save discount in database!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public frm_discount_entry_amount(Discount discount)
        {
            InitializeComponent();

            _Discount = discount;
            YearLevel yearLevel = YearLevel.GetYearLevel(discount.YearLeveLID);

            txtDiscountCode.Text   = discount.DiscountCode;
            cmbEducationLevel.Text = yearLevel.EducationLevel;
            cmbYearLevel.Text      = yearLevel.YearLvl;
            txtAmountValue.Text    = discount.TotalValue.ToString("n");

            if (Convert.ToBoolean(discount.TFee))
            {
                ch_TFee.Checked = true;
            }
            else
            {
                ch_TFee.Checked = false;
            }

            if (Convert.ToBoolean(discount.MFee))
            {
                ch_MFee.Checked = true;
            }
            else
            {
                ch_MFee.Checked = false;
            }

            if (Convert.ToBoolean(discount.OFee))
            {
                ch_OFee.Checked = true;
            }
            else
            {
                ch_OFee.Checked = false;
            }
        }