Ejemplo n.º 1
0
    public List <PayScholarData> getAllWaveSchlar(string payment_id)
    {
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        List <PayScholarData> payscholarData = new List <PayScholarData>();

        string sql = "Select * From SCHOLAR_WAVE_DATA Where PAYMENT_ID='" + payment_id + "'";

        try
        {
            oracleObj.SelectCommand = sql;
            DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

            foreach (DataRowView rowData in allData)
            {
                PayScholarData payscholar_data = new PayScholarData();
                payscholar_data.Payment_ID           = rowData["PAYMENT_ID"].ToString();
                payscholar_data.Scholar_Code         = rowData["SCHOLAR_CODE"].ToString();
                payscholar_data.Academic_Year        = rowData["ACADEMIC_YEAR"].ToString();
                payscholar_data.Semester             = rowData["SEMESTER"].ToString();
                payscholar_data.Student_ID           = rowData["STUDENT_ID"].ToString();
                payscholar_data.Nation_ID            = rowData["NATION_ID"].ToString();
                payscholar_data.Passport_ID          = rowData["PASSPORT_ID"].ToString();
                payscholar_data.Student_Name         = rowData["STUDENT_NAME"].ToString();
                payscholar_data.Payment_Date         = rowData["PAYMENT_DATE"].ToString();
                payscholar_data.Payment_Time         = rowData["PAYMENT_TIME"].ToString();
                payscholar_data.Theory_Practice_Fee  = Convert.ToInt32(rowData["THEORY_PRACTICE_FEE"].ToString());
                payscholar_data.Thesis_Project_Fee   = Convert.ToInt32(rowData["THESIS_PROJECT_FEE"].ToString());
                payscholar_data.Packet_Fee           = Convert.ToInt32(rowData["PACKET_FEE"].ToString());
                payscholar_data.NewRegis_Fee         = Convert.ToInt32(rowData["NEW_REGIS_FEE"].ToString());
                payscholar_data.Card_Fee             = Convert.ToInt32(rowData["CARD_FEE"].ToString());
                payscholar_data.Student_Facility_Fee = Convert.ToInt32(rowData["STUDY_FACILITY_FEE"].ToString());
                payscholar_data.IT_Fee            = Convert.ToInt32(rowData["IT_FEE"].ToString());
                payscholar_data.Health_Fee        = Convert.ToInt32(rowData["HEALTH_FEE"].ToString());
                payscholar_data.Library_Fee       = Convert.ToInt32(rowData["LIBRARY_FEE"].ToString());
                payscholar_data.Properties_Fee    = Convert.ToInt32(rowData["PROPERTIES_FEE"].ToString());
                payscholar_data.Accident_Fee      = Convert.ToInt32(rowData["ACCIDENT_FEE"].ToString());
                payscholar_data.Academic_Fee      = Convert.ToInt32(rowData["ACADEMIC_FEE"].ToString());
                payscholar_data.Moral_Fee         = Convert.ToInt32(rowData["MORAL_FEE"].ToString());
                payscholar_data.Activity_Fee      = Convert.ToInt32(rowData["ACTIVITY_FEE"].ToString());
                payscholar_data.Status            = rowData["STATUS"].ToString();
                payscholar_data.Amount            = Convert.ToInt32(rowData["AMOUNT"].ToString());
                payscholar_data.StudentStatus_Fee = Convert.ToInt32(rowData["STUDENT_STATUS_FEE"].ToString());
                payscholar_data.StudentReturn_Fee = Convert.ToInt32(rowData["STUDENT_RETURN_FEE"].ToString());
                payscholar_data.Charge            = Convert.ToInt32(rowData["CHARGE"].ToString());
                payscholar_data.QE_Fee            = Convert.ToInt32(rowData["QE_FEE"].ToString());
                payscholar_data.Trainee_Fee       = Convert.ToInt32(rowData["TRAINEE_FEE"].ToString());
                payscholarData.Add(payscholar_data);
            }
        }
        catch
        {
            HttpContext.Current.Session["response"] = "Unit Test:PaySchlar:getWaveSchlar" + " ไม่สามารถดำเนินการได้";
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(payscholarData);
    }
Ejemplo n.º 2
0
    public string insertPaySchlor(PayScholarData insertData)
    {
        string sql      = "";
        string response = "";

        // ======= Log ======
        LogData log_data = new LogData();

        log_data.ModuleCode = new LogData().Module_Registration;

        if (HttpContext.Current.Session["login_data"] != null)
        {
            UserLoginData login_data = (UserLoginData)HttpContext.Current.Session["login_data"];
            log_data.Username = login_data.User_ID;
        }
        else
        {
            log_data.Username = insertData.Student_ID;
        }


        log_data.Message = "Create PayScholar Data With:" + insertData.Payment_ID + "','" + insertData.Student_ID + "','" + insertData.Nation_ID + "','" + insertData.Passport_ID + "','" + insertData.Student_Name + "','" + insertData.Academic_Year + "','" + insertData.Semester + "','" + insertData.Scholar_Code + "','" + insertData.Payment_Date + "','" + insertData.Payment_Time + "'," + insertData.Theory_Practice_Fee + "," + insertData.Thesis_Project_Fee + "," + insertData.Packet_Fee + "," + insertData.NewRegis_Fee + "," + insertData.Card_Fee + "," + insertData.Student_Facility_Fee + "," + insertData.IT_Fee + "," + insertData.Health_Fee + "," + insertData.Library_Fee + "," + insertData.Properties_Fee + "," + insertData.Accident_Fee + "," + insertData.Academic_Fee + "," + insertData.Moral_Fee + "," + insertData.Activity_Fee + "," + insertData.Amount + ",'" + insertData.Status + "'," + insertData.StudentReturn_Fee + "," + insertData.Charge + "," + insertData.QE_Fee + "," + insertData.Trainee_Fee;
        // ==================

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        try
        {
            sql = "Insert Into SCHOLAR_PAY_DATA(PAYMENT_ID,STUDENT_ID,NATION_ID,PASSPORT_ID,STUDENT_NAME,ACADEMIC_YEAR,SEMESTER,SCHOLAR_CODE,PAYMENT_DATE,PAYMENT_TIME,THEORY_PRACTICE_FEE,THESIS_PROJECT_FEE,PACKET_FEE,NEW_REGIS_FEE,CARD_FEE,STUDY_FACILITY_FEE,IT_FEE,HEALTH_FEE,LIBRARY_FEE,PROPERTIES_FEE,ACCIDENT_FEE,ACADEMIC_FEE,MORAL_FEE,ACTIVITY_FEE,AMOUNT,STATUS,STUDENT_STATUS_FEE,STUDENT_RETURN_FEE,CHARGE,QE_FEE,TRAINEE_FEE) Values('" + insertData.Payment_ID + "','" + insertData.Student_ID + "','" + insertData.Nation_ID + "','" + insertData.Passport_ID + "','" + insertData.Student_Name + "','" + insertData.Academic_Year + "','" + insertData.Semester + "','" + insertData.Scholar_Code + "','" + insertData.Payment_Date + "','" + insertData.Payment_Time + "'," + insertData.Theory_Practice_Fee + "," + insertData.Thesis_Project_Fee + "," + insertData.Packet_Fee + "," + insertData.NewRegis_Fee + "," + insertData.Card_Fee + "," + insertData.Student_Facility_Fee + "," + insertData.IT_Fee + "," + insertData.Health_Fee + "," + insertData.Library_Fee + "," + insertData.Properties_Fee + "," + insertData.Accident_Fee + "," + insertData.Academic_Fee + "," + insertData.Moral_Fee + "," + insertData.Activity_Fee + "," + insertData.Amount + ",'" + insertData.Status + "'," + insertData.StudentReturn_Fee + "," + insertData.Charge + "," + insertData.QE_Fee + "," + insertData.Trainee_Fee + ")";

            oracleObj.InsertCommand = sql;


            if (oracleObj.Insert() == 1)
            {
                response            = "OK";
                log_data.StatusCode = log_data.LogStatus_SUCCESS;
            }
            else
            {
                log_data.StatusCode = log_data.LogStatus_FAILED;
            }

            new Log().WriteLog(log_data);
        }
        catch (Exception e)
        {
            log_data.StatusCode = log_data.LogStatus_ERROR;
            log_data.Message   += " [" + e.ToString() + "]";
            new Log().WriteLog(log_data);

            HttpContext.Current.Session["response"] = "Unit Test:PaySchlar:insertPaySchlor" + " ไม่สามารถดำเนินการได้";
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }
        return(response);
    }