//insert student's cash information into ST_STUDENT_CASH table
        public int insertStuCash(DataSet.DsPSMS.ST_STUDENT_CASHRow dr)
        {
            if (dr == null)
            {
                return(-1);
            }

            Open();
            query = "INSERT INTO ST_STUDENT_CASH (EDU_YEAR, STUDENT_ID, CASH_TITLE, CASH_DATE, ACCOUNT_NO, AMOUNT, CRT_DT_TM, CRT_USER_ID, UPD_DT_TM, UPD_USER_ID, DEL_FLG)";

            data += " '" + dr.EDU_YEAR + "'";
            //data += ", '" + dr.CASH_ID + "'";
            data += ", '" + dr.STUDENT_ID + "'";
            data += ", '" + dr.CASH_TITLE + "'";
            data += ", '" + dr.CASH_DATE + "'";
            data += ", '" + dr.ACCOUNT_NO + "'";
            data += ", '" + dr.AMOUNT + "'";
            data += ", '" + dr.CRT_DT_TM + "'";
            data += ", '" + dr.CRT_USER_ID + "'";
            data += ", '" + dr.UPD_DT_TM + "'";
            data += ", '" + dr.UPD_USER_ID + "'";
            data += ", " + 0;

            query += " VALUES (" + data + ");";
            SqlCommand cmd = new SqlCommand(query, conn);

            result = cmd.ExecuteNonQuery();
            Close();
            return(result);
        }
        //select Cash information from ST_STUDENT_CASH table
        public DataSet.DsPSMS.ST_STUDENT_CASHDataTable selectCashDataByIdYear(DataSet.DsPSMS.ST_STUDENT_CASHRow dr)
        {
            DsPSMS.ST_STUDENT_CASHDataTable stuCashDt = new DsPSMS.ST_STUDENT_CASHDataTable();
            Open();
            query = "SELECT* FROM ST_STUDENT_CASH WHERE STUDENT_ID='" + dr.STUDENT_ID + "' AND EDU_YEAR='" + dr.EDU_YEAR + "'";
            SqlCommand     cmd = new SqlCommand(query, conn);
            SqlDataAdapter da  = new SqlDataAdapter(cmd);

            da.Fill(stuCashDt);
            Close();
            return(stuCashDt);
        }
        public DataSet.DsPSMS.ST_STUDENT_CASHDataTable getCashData(DataSet.DsPSMS.ST_STUDENT_CASHRow dr, out string msg)
        {
            DsPSMS.ST_STUDENT_CASHDataTable stuCashDt = new DsPSMS.ST_STUDENT_CASHDataTable();
            try
            {
                Open();
                stuCashDt = stuCashDb.selectCashDataByIdYear(dr);
                msg       = "Have data";
            }
            catch
            {
                msg = "error occurs when selecting cash data";
                return(null);
            }
            finally
            {
                Close();
            }

            return(stuCashDt);
        }