示例#1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (toOtherFees == true)
            {
                if (Convert.ToDouble(txtAmountGiven.Text) < Convert.ToDouble(lblAmount_Due.Text))
                {
                    MessageBox.Show("Please check the payment", "GOC_INFO_SYS", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    Billing_Other_Fees fee = new Billing_Other_Fees();
                    fee.GocNumber = GOCNo;
                    fee.OrNo      = txtORNo.Text;
                    fee.GLevel    = GLEVEL;
                    fee.Uniform   = txtUniform.Text;
                    fee.Books     = txtBooks.Text;
                    fee.Locker    = txtLocker.Text;

                    fee.Save();
                }
            }
            else//for Enrollment Fees
            {
            }
        }
示例#2
0
        }//End of Load

        public List <Billing_Other_Fees> GetById()
        {
            try
            {
                //prepare connection string
                using (MySqlConnection con = new MySqlConnection(GOCSystem2018.Config.GetConnectionString()))
                {
                    //try to open connection
                    con.Open();

                    //prepare sql query
                    string sql = "SELECT * FROM billing_other_fees WHERE gocNumber =@gocNumber;";


                    MySqlCommand cmd = new MySqlCommand(sql, con);
                    cmd.Parameters.AddWithValue("gocNumber", gocNumber);

                    MySqlDataReader reader = cmd.ExecuteReader();

                    //loop while have record
                    while (reader.Read())
                    {
                        //instantiate model
                        Billing_Other_Fees other = new Billing_Other_Fees();

                        //prepare properties
                        other.gocNumber = reader["gocNumber"].ToString();
                        other.orNo      = reader["orno"].ToString();
                        other.gLevel    = reader["grade_level"].ToString();
                        other.uniform   = reader["uniform"].ToString();
                        other.books     = reader["books"].ToString();
                        other.locker    = reader["locker"].ToString();

                        otherFees.Add(other);
                    }
                }
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("ERROR : " + ex.ToString(), "GOCINFOSYS", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(otherFees);
        }