// V 1.0.0 public List <BankData> getBankData_AllDegree(string selected_date) { List <BankData> bankData = new List <BankData>(); string sql = ""; ConnectDB db = new ConnectDB(); SqlDataSource oracleObj = db.ConnectionOracle(); sql = "Select * From BANK_DATA Where BANK_SUMDATE = '" + selected_date + "' "; oracleObj.SelectCommand = sql; DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData) { BankData bank_data = new BankData(); DegreeData degree_data = new DegreeData(); bank_data.Amount = rowData["AMOUNT"].ToString().ToCharArray(); bank_data.BankCode = rowData["BANK_CODE"].ToString().ToCharArray(); bankcode_data = bankcodeObj.getBankCode(new string(bank_data.BankCode)); bank_data.Bank_ShortName = bankcode_data.Bank_ShortName; bank_data.Bank_ThaiName = bankcode_data.Bank_ThaiName; bank_data.TrancCode = rowData["TRANSACTION_CODE"].ToString().ToCharArray(); bank_data.Student_Name = rowData["STUDENT_NAME"].ToString(); bank_data.Student_ID = rowData["STUDENT_ID"].ToString(); bank_data.Nation_Passport_ID = rowData["NATION_PASSPORT_ID"].ToString(); bank_data.AcademicYear = rowData["ACADEMIC_YEAR"].ToString(); bank_data.Semester = rowData["SEMESTER"].ToString(); bank_data.Paymenty_ID = rowData["PAYMENT_ID"].ToString(); bank_data.Payment_Date = rowData["PAYMENT_DATE"].ToString(); bank_data.Payment_Time = rowData["PAYMENT_TIME"].ToString(); bank_data.ThaiPayment_Date = new utility().getThaiBirthDay(bank_data.Payment_Date); bank_data.Degree_Level = bank_data.Paymenty_ID.Substring(0, 1); degree_data = new DegreeAdmission().getDegreeAdmission(bank_data.Degree_Level); bank_data.Degree_Char = degree_data.Degree_Char; bank_data.Degree_ThaiName = degree_data.Degree_Thai; bank_data.DueDate = rowData["DUE_DATE"].ToString(); bank_data.ThaiDueDate = new utility().getThaiBirthDay(bank_data.DueDate); bank_data.SumDate = rowData["BANK_SUMDATE"].ToString(); bank_data.ThaiSumDate = new utility().getThaiBirthDay(bank_data.SumDate); bank_data.Status = rowData["STATUS"].ToString(); bankData.Add(bank_data); } sql = "Select * From GRAD_BANK_DATA Where BANK_SUMDATE = '" + selected_date + "' "; oracleObj.SelectCommand = sql; DataView allData2 = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty); foreach (DataRowView rowData in allData2) { BankData bank_data = new BankData(); DegreeData degree_data = new DegreeData(); bank_data.Amount = rowData["AMOUNT"].ToString().ToCharArray(); bank_data.BankCode = rowData["BANK_CODE"].ToString().ToCharArray(); bankcode_data = bankcodeObj.getBankCode(new string(bank_data.BankCode)); bank_data.Bank_ShortName = bankcode_data.Bank_ShortName; bank_data.Bank_ThaiName = bankcode_data.Bank_ThaiName; bank_data.TrancCode = rowData["TRANSACTION_CODE"].ToString().ToCharArray(); bank_data.Student_Name = rowData["STUDENT_NAME"].ToString(); bank_data.Student_ID = rowData["STUDENT_ID"].ToString(); bank_data.Nation_Passport_ID = rowData["NATION_PASSPORT_ID"].ToString(); bank_data.AcademicYear = rowData["ACADEMIC_YEAR"].ToString(); bank_data.Semester = rowData["SEMESTER"].ToString(); bank_data.Paymenty_ID = rowData["PAYMENT_ID"].ToString(); bank_data.Payment_Date = rowData["PAYMENT_DATE"].ToString(); bank_data.ThaiPayment_Date = new utility().getThaiBirthDay(bank_data.Payment_Date); bank_data.Degree_Level = bank_data.Paymenty_ID.Substring(0, 1); degree_data = new DegreeAdmission().getDegreeAdmission(bank_data.Degree_Level); bank_data.Degree_Char = degree_data.Degree_Char; bank_data.Degree_ThaiName = degree_data.Degree_Thai; bank_data.DueDate = rowData["DUE_DATE"].ToString(); bank_data.ThaiDueDate = new utility().getThaiBirthDay(bank_data.DueDate); bank_data.SumDate = rowData["BANK_SUMDATE"].ToString(); bank_data.ThaiSumDate = new utility().getThaiBirthDay(bank_data.SumDate); bank_data.Status = rowData["STATUS"].ToString(); bankData.Add(bank_data); } return(bankData); }
protected void Page_Load(object sender, EventArgs e) { if (Session["login_data"] == null) { Response.Redirect("../index.aspx"); } else { //ตรวจสอบสิทธิ์ login_data = (UserLoginData)Session["login_data"]; if (autro_obj.CheckGroupUser(login_data, group_var.admin_university) || autro_obj.CheckGroupUser(login_data, group_var.admin_faculty)) { /*=============================*/ if (!Page.IsPostBack) { //โหลดสำนักงาน bankData = bankObj.getBankCode(); // Head Table string[] ar = { "รหัส", "ชื่อธนาคาร (Thai)", "ชื่อธนาคาร (English)", "Service Code", "แก้ไข", "ลบ" }; //Table tb1 = new Table(); tblBank.Attributes.Add("class", "table table-bordered table-striped table-hover"); tblBank.Attributes.Add("id", "dt_basic"); TableHeaderRow tRowHead = new TableHeaderRow(); tRowHead.TableSection = TableRowSection.TableHeader; for (int cellCtr = 1; cellCtr <= ar.Length; cellCtr++) { // Create a new cell and add it to the row. TableHeaderCell cellHead = new TableHeaderCell(); cellHead.Text = ar[cellCtr - 1]; if (cellCtr == 1 || cellCtr > 4) { cellHead.Width = 100; } tRowHead.Cells.Add(cellHead); } tblBank.Rows.Add(tRowHead); foreach (BankCodeData data in bankData) { TableRow tRowBody = new TableRow(); tRowBody.TableSection = TableRowSection.TableBody; TableCell cellCampusCode = new TableCell(); cellCampusCode.Text = data.Bank_Code; tRowBody.Cells.Add(cellCampusCode); TableCell cellCampusThai = new TableCell(); cellCampusThai.Text = data.Bank_ThaiName; tRowBody.Cells.Add(cellCampusThai); TableCell cellCampusEng = new TableCell(); cellCampusEng.Text = data.Bank_EngName; tRowBody.Cells.Add(cellCampusEng); TableCell cellStatus = new TableCell(); cellStatus.Text = data.Bank_Service_code; tRowBody.Cells.Add(cellStatus); TableCell cellEdit = new TableCell(); string urlEdit = "edit_Bank.aspx?token=" + data.Bank_Code; HyperLink hypEdit = new HyperLink(); //hypEdit.Attributes.Add("data-target", "#editCampus"); //hypEdit.Attributes.Add("data-toggle", "modal"); hypEdit.Text = "<h4><i class='fa fa-edit'></i></h4>"; hypEdit.NavigateUrl = urlEdit; hypEdit.ToolTip = "Edit"; cellEdit.Controls.Add(hypEdit); cellEdit.CssClass = "text-center"; tRowBody.Cells.Add(cellEdit); TableCell cellDel = new TableCell(); //string urlDel = "#"; string urlDel = "delete_Bank.aspx?token=" + data.Bank_Code; HyperLink hypDel = new HyperLink(); hypDel.Attributes.Add("data-target", "#deleteBank"); hypDel.Attributes.Add("data-toggle", "modal"); hypDel.Text = "<h4><i class='fa fa-trash-o'></i></h4>"; hypDel.NavigateUrl = urlDel; hypDel.ToolTip = "Delete"; cellDel.Controls.Add(hypDel); cellDel.CssClass = "text-center"; tRowBody.Cells.Add(cellDel); tblBank.Rows.Add(tRowBody); } } //end !Page.IsPostBack /*=============================*/ } else { HttpContext.Current.Session["response"] = "ตรวจสอบไม่พบสิทธิ์การเข้าใช้งาน"; HttpContext.Current.Response.Redirect("err_response.aspx"); } } }