Exemplo n.º 1
0
        public void EditFees(mst_fees mst)
        {
            try
            {
                using (MySqlConnection con = new MySqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()))
                {
                    string query = @"UPDATE mst_fees 
                                    SET 
                                        fees_amount = @fees_amount,
                                        bl_onetime = @bl_onetime,
                                        bl_apr = @bl_apr,
                                        bl_may = @bl_may,
                                        bl_jun = @bl_jun,
                                        bl_jul = @bl_jul,
                                        bl_aug = @bl_aug,
                                        bl_sep = @bl_sep,
                                        bl_oct = @bl_oct,
                                        bl_nov = @bl_nov,
                                        bl_dec = @bl_dec,
                                        bl_jan = @bl_jan,
                                        bl_feb = @bl_feb,
                                        bl_mar = @bl_mar
                                    WHERE
                                        class_id = @class_id
                                            AND acc_id = @acc_id
                                            AND session = (SELECT 
                                                session
                                            FROM
                                                mst_session
                                            WHERE
                                                session_active = 'Y')";

                    con.Execute(query, mst);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public void AddFees(mst_fees mst)
        {
            try
            {
                using (MySqlConnection con = new MySqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()))
                {
                    string query = @"SELECT session FROM mst_session where session_active = 'Y'";

                    string session = con.Query <string>(query).SingleOrDefault();

                    query = @"INSERT INTO mst_fees
                                   (session
                                   ,class_id
                                   ,acc_id
                                   ,fees_amount                                 
                                   ,bl_onetime
                                   ,bl_apr
                                   ,bl_may
                                   ,bl_jun
                                   ,bl_jul
                                   ,bl_aug
                                   ,bl_sep
                                   ,bl_oct
                                   ,bl_nov
                                   ,bl_dec
                                   ,bl_jan
                                   ,bl_feb
                                   ,bl_mar)
                                     VALUES
                                   (@session,
                                   @class_id,
                                   @acc_id,
                                   @fees_amount,
                                   @bl_onetime,
                                   @bl_apr,
                                   @bl_may,
                                   @bl_jun,
                                   @bl_jul,
                                   @bl_aug,
                                   @bl_sep,
                                   @bl_oct,
                                   @bl_nov,
                                   @bl_dec,
                                   @bl_jan,
                                   @bl_feb,
                                   @bl_mar)";

                    mst.session = session;

                    con.Execute(query, new
                    {
                        mst.session,
                        mst.class_id,
                        mst.acc_id,
                        mst.fees_amount,
                        mst.bl_onetime,
                        mst.bl_apr,
                        mst.bl_may,
                        mst.bl_jun,
                        mst.bl_jul,
                        mst.bl_aug,
                        mst.bl_sep,
                        mst.bl_oct,
                        mst.bl_nov,
                        mst.bl_dec,
                        mst.bl_jan,
                        mst.bl_feb,
                        mst.bl_mar
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }