public void search() { string rNumString = ""; if (radioDepartment.Checked) { rNumString = req.select("BMS012", qm.getQuery("Bm_Department_R", "", nameTextBox.Text), "BMS"); } else if (radioDivision.Checked) { rNumString = req.select("BMS012", qm.getQuery("Bm_Division_R", "", nameTextBox.Text), "BMS"); } else if (radioTitle.Checked) { rNumString = req.select("BMS012", qm.getQuery("Bm_Title_R", "", nameTextBox.Text), "BMS"); } if (rNumString != "0") { MessageBox.Show("서버와 통신중에 장애가 발생하였습니다."); return; } else { int cnt = ReturnDT.dt.Columns.Count; for (int i = 2; i < cnt; i++) { ReturnDT.dt.Columns.RemoveAt(2); } dataGridView1.DataSource = ReturnDT.dt; } }
public void getProgramList() { string rCheck = req.select("BMS007", qm.getQuery("Sys_005_S"), "BMS"); if (rCheck.Equals("0")) { dt = ReturnDT.dt; DataTable User_Info = new DataTable(); } rowNum = dt.Rows.Count; cNum = dt.Columns.Count; makeCell(this.ProgramGridView, rowNum, cNum); if (rowNum > 0) { for (int i = 0; i < rowNum; i++) { // AlarmActionRowUnit ua = (AlarmActionRowUnit)AdminDataClass.al[i]; this.ProgramGridView.Rows[i].Cells[0].Value = "" + dt.Rows[i][0]; this.ProgramGridView.Rows[i].Cells[1].Value = "" + dt.Rows[i][1]; } } }
public void showData() { Cursor.Current = Cursors.WaitCursor; UserGridView.Rows.Clear(); allDisEnable(); string rCheck = req.select("BMS004", qm.getQuery("Sys_002_S", txt_SearchUserId.Text, txt_SearchUserName.Text), "BMS"); if (rCheck.Equals("0")) { dt = ReturnDT.dt; DataTable User_Info = new DataTable(); } rowNum = dt.Rows.Count; cNum = dt.Columns.Count; makeCell(this.UserGridView, rowNum, cNum); if (rowNum > 0) { for (int i = 0; i < rowNum; i++) { // AlarmActionRowUnit ua = (AlarmActionRowUnit)AdminDataClass.al[i]; this.UserGridView.Rows[i].Cells[0].Value = "" + dt.Rows[i][0]; this.UserGridView.Rows[i].Cells[1].Value = "" + dt.Rows[i][1]; this.UserGridView.Rows[i].Cells[2].Value = "" + dt.Rows[i][2]; } } Cursor.Current = Cursors.Default; }
private void button1_Click(object sender, EventArgs e) { query = "update BADGE set ACS_1 = 1 where bid ='" + getData["bid"] + "'"; string rCheck = req.update("BMS011", query, "BMI"); if (rCheck.Equals("0")) { MessageBox.Show("BM시스템 수정입력 완료.."); query = makeQuery("1"); rCheck = req.update("BMS011", query, "BMI"); if (rCheck.Equals("0")) { rCheck = req.update("BMS011", qm.getQuery("PLANT_REG_LOG", "1", "카드번호 : " + addZero(cardNum.Text) + " 1발전소 "), "BMI"); if (!rCheck.Equals("0")) { MessageBox.Show("로그 저장 실패.."); } MessageBox.Show("1발전소 등록요청 완료..!"); reg001.plant1RegCheckBox.Checked = true; reg001.acs1EndDateButton.Enabled = true; reg001.acs1EndDateTime.Enabled = true; } else { MessageBox.Show("1발전소 등록요청 실패.."); } } else { MessageBox.Show("1발전소 등록이 실패하였습니다 서버와 통신상태를 확인하세요"); } }
void comboSetPlant_SelectedIndexChanged(object sender, EventArgs e) { pNum = comboSetPlant.SelectedIndex + 1; label2.Text = pNum + "발전소 " + type; string serverType = ""; if (pNum == 1) { serverType = "" + Bm_Main.serverInfo.Rows[0]["SERVER_TYPE"]; } else if (pNum == 2) { serverType = "" + Bm_Main.serverInfo.Rows[1]["SERVER_TYPE"]; } else if (pNum == 3) { serverType = "" + Bm_Main.serverInfo.Rows[2]["SERVER_TYPE"]; } else if (pNum == 4) { serverType = "" + Bm_Main.serverInfo.Rows[2]["SERVER_TYPE"]; } if (type.Equals("부서")) { comboResult.Items.Clear(); if (serverType.Equals("3")) { string rCheck = req.select("BMS003", qm.getQuery("OG_Division_R"), "ACS" + pNum + "S"); dt = ReturnDT.dt; for (int i = 0; i < dt.Rows.Count; i++) { comboResult.Items.Add(dt.Rows[i]["NAME"]); } } else { string rCheck = req.select("BMS003", qm.getQuery("PP_Department_R"), "ACS" + pNum + "S"); dt = ReturnDT.dt; for (int i = 0; i < dt.Rows.Count; i++) { comboResult.Items.Add(dt.Rows[i]["description"].ToString().Trim()); } } } comboResult.SelectedIndex = 0; }
public void showData() { Cursor.Current = Cursors.WaitCursor; ClientGridView.Rows.Clear(); updateFlag = false; string rCheck = req.select("BMS006", qm.getQuery("Sys_004_S", txtIP.Text), "BMS"); if (rCheck.Equals("0")) { dt = ReturnDT.dt; DataTable User_Info = new DataTable(); } rowNum = dt.Rows.Count; cNum = dt.Columns.Count; makeCell(this.ClientGridView, rowNum, cNum); if (rowNum > 0) { for (int i = 0; i < rowNum; i++) { // AlarmActionRowUnit ua = (AlarmActionRowUnit)AdminDataClass.al[i]; this.ClientGridView.Rows[i].Cells[0].Value = "" + dt.Rows[i][0]; this.ClientGridView.Rows[i].Cells[1].Value = "" + dt.Rows[i][1]; } } Cursor.Current = Cursors.Default; updateFlag = true; }
public void showData() { updateFlag = false; string rCheck = req.select("BMS003", qm.getQuery("Sys_001_S"), "BMS"); if (rCheck.Equals("0")) { dt = ReturnDT.dt; } rowNum = dt.Rows.Count; cNum = dt.Columns.Count; makeCell(this.dataGridView1, rowNum, cNum); if (rowNum > 0) { for (int i = 0; i < rowNum; i++) { // AlarmActionRowUnit ua = (AlarmActionRowUnit)AdminDataClass.al[i]; //dgvCb = (DataGridViewComboBoxCell)dataGridView1.Rows[i].Cells[2]; //dgvCb.ErrorText = ""; this.dataGridView1.Rows[i].Cells[0].Value = "" + dt.Rows[i][0]; this.dataGridView1.Rows[i].Cells[1].Value = "" + dt.Rows[i][1]; this.dataGridView1.Rows[i].Cells[2].Value = "" + dt.Rows[i][2]; this.dataGridView1.Rows[i].Cells[3].Value = "" + dt.Rows[i][3]; this.dataGridView1.Rows[i].Cells[4].Value = "" + dt.Rows[i][4]; this.dataGridView1.Rows[i].Cells[5].Value = "" + dt.Rows[i][5]; this.dataGridView1.Rows[i].Cells[6].Value = "" + dt.Rows[i][6]; this.dataGridView1.Rows[i].Cells[7].Value = "" + dt.Rows[i][7]; this.dataGridView1.Rows[i].Cells[8].Value = "" + dt.Rows[i][8]; this.dataGridView1.Rows[i].Cells[9].Value = "" + dt.Rows[i][9]; this.dataGridView1.Rows[i].Cells[10].Value = "" + dt.Rows[i][10]; this.dataGridView1.Rows[i].Cells[11].Value = "" + dt.Rows[i][11]; this.dataGridView1.Rows[i].Cells[12].Value = "" + dt.Rows[i][12]; } } updateFlag = true; }
public void updatePassword() { string rCheck = req.update("BMS009", qm.getQuery("Sys_007_U", Bm_Login.login_Id, Bm_Main.setPw(txtNewPassword.Text)), "BMI"); if (rCheck.Equals("0")) { MessageBox.Show("패스워드가 정상적으로 변경되었습니다"); rCheck = req.update("BMS009", qm.getQuery("SYS007_LOG_M", "1"), "BMI"); if (!rCheck.Equals("0")) { MessageBox.Show("로그 저장 실패.."); } } else { MessageBox.Show("패스워드 변경 실패"); } }
private void button1_Click(object sender, EventArgs e) { if (checkNum(textBox1.Text)) { if (!("" + Bm_Main.serverInfo.Rows[0]["SERVER_TYPE"]).Equals("3")) { ppInsertPin(textBox1.Text, cardName, "ACS1"); string Check = req.update("BMS0011", qm.getQuery("REG001_LOG_PIN", "1", "카드번호 : " + addZero(bid) + " 1발전소 비밀번호 -> " + textBox1.Text), "BMI"); if (!Check.Equals("0")) { MessageBox.Show("로그 저장 실패.."); } } else if (("" + Bm_Main.serverInfo.Rows[0]["SERVER_TYPE"]).Equals("3")) { string query = "insert into PROCESS_REQUEST values(" + "'-10' , '-10' , '1800-01-01' , -10 , '-10' , -10 , -10 , -10 , '-10' , '-10' , '-10' ,'-10' ," + textBox1.Text + ", -10 , -10 ,-10 ,-10 ,-10 , -10 , -10 , -10 ,'1800-01-01','1800-01-01' , -10 , -10,-10 ,-10 ,-10 ,-10 , -10 , -10 ,-10 , -10 ,-10 ,-10 ,-10 ,0,100,100,100,100,100,100,100,100,'U','" + addZero(bid) + "',-10)"; Log.WriteLogTmp("Bm_PinInput Query : " + query); string rCheck = req.update("BMS011", query, "BMI"); if (rCheck.Equals("0")) { MessageBox.Show("비밀번호 입력 성공.."); string Check = req.update("BMS0011", qm.getQuery("REG001_LOG_PIN", "1", "카드번호 : " + addZero(bid) + " 1발전소 비밀번호 -> " + textBox1.Text), "BMI"); if (!Check.Equals("0")) { MessageBox.Show("로그 저장 실패.."); } } else { MessageBox.Show("비밀번호 입력이 실패하였습니다. 등록되어있는 비밀번호인지 확인해주세요."); } } } }
private void login() { string query = qm.getQuery("SYSTEM", txt_Id.Text); string request = connectS(query, "BMS"); if (request == "0") { DataTable dt = ReturnDT.dt; //DataTable dt = DBHandling.selectDB("M^0", query); if (dt.Rows.Count == 0) { MessageBox.Show("등록되지 않은 사용자입니다. 다시한번 확인해주세요", "경고", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { login_Name = dt.Rows[0]["User_Name"].ToString(); login_Id = dt.Rows[0]["ID"].ToString(); login_Auth = dt.Rows[0]["Program_List"].ToString(); string endPw = dt.Rows[0]["User_Password"].ToString(); byte[] pw = Convert.FromBase64String(endPw); byte[] decpw = AESClass.AESClass.AESDEC(pw); string strPassword = Encoding.UTF8.GetString(decpw); string[] password = strPassword.Split('\0'); if (txt_Pw.Text.Trim() != password[0]) { MessageBox.Show("입력하신 아이디 혹은 비밀번호가 일치하지 않습니다. 다시한번 확인해주세요", "경고", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } login_Pw = password[0]; // 체크박스 체크여부 확인, ID 저장 if (CheckSaveId.CheckState == CheckState.Checked) { HubIniFile.SetIniValue("LOGIN", "ID", txt_Id.Text, set_Path); } else if (CheckSaveId.CheckState == CheckState.Unchecked) { HubIniFile.SetIniValue("LOGIN", "ID", "", set_Path); } updateUserConn(); login_flag = true; try { Application.OpenForms["bm_Login"].Close(); query = "select IP_ADDRESS from CLIENT_CONFIG where IP_ADDRESS ='" + getIp() + "'"; request = connectS(query, "BMS"); if (request.Equals("0")) { dt = ReturnDT.dt; if (!login_Id.Equals("admin")) { if (dt.Rows.Count == 0) { MessageBox.Show("등록되지않은 IP입니다. 프로그램을 종료합니다."); request = req.update("BMS001", qm.getQuery("LOGIN_LOG", "0"), "BMI"); Application.Exit(); } } request = req.update("BMS001", qm.getQuery("LOGIN_LOG", "1"), "BMI"); } else { MessageBox.Show("Client 정보를 입력하는데 실패하였습니다. 프로그램을 종료합니다."); request = req.update("BMS001", qm.getQuery("LOGIN_LOG", "0"), "BMI"); Application.Exit(); } } catch (Exception e) { Application.Exit(); } } } else { MessageBox.Show("서버와 통신이 정상적이지 않습니다. 관리자에게 문의해주세요."); } }
public void getAccessLvl() { string rCheck = req.select("BMS003", qm.getQuery("Bm_ACS1AccessLvl_R", "1", ""), "BMS"); if (rCheck.Equals("0")) { ACS1AccessLvl = ReturnDT.dt; } else { MessageBox.Show("서버와의 통신중에 정보를 읽어오는데 실패하였습니다."); } rCheck = req.select("BMS003", qm.getQuery("Bm_ACS2AccessLvl_R", "2", ""), "BMS"); if (rCheck.Equals("0")) { ACS2AccessLvl = ReturnDT.dt; } else { MessageBox.Show("서버와의 통신중에 정보를 읽어오는데 실패하였습니다."); } rCheck = req.select("BMS003", qm.getQuery("Bm_ACS3AccessLvl_R", "3", ""), "BMS"); if (rCheck.Equals("0")) { ACS3AccessLvl = ReturnDT.dt; } else { MessageBox.Show("서버와의 통신중에 정보를 읽어오는데 실패하였습니다."); } rCheck = req.select("BMS003", qm.getQuery("Bm_ACS4AccessLvl_R", "4", ""), "BMS"); if (rCheck.Equals("0")) { ACS4AccessLvl = ReturnDT.dt; } else { MessageBox.Show("서버와의 통신중에 정보를 읽어오는데 실패하였습니다."); } }
public void showData() { string rCheck = ""; if (acsTypeInfoCombobox.Text.Equals("카드정보")) { rCheck = req.select("BMS003", qm.getQuery("Bm_CardCount_R"), "BMS"); } else if (acsTypeInfoCombobox.Text.Equals("권한정보")) { rCheck = req.select("BMS003", qm.getQuery("Bm_Auth_R"), "BMS"); } if (rCheck.Equals("0")) { dt = ReturnDT.dt; DataTable User_Info = new DataTable(); } rowNum = dt.Rows.Count; cNum = dt.Columns.Count; makeCell(this.bmGridView, rowNum, cNum); if (rowNum > 0) { for (int i = 0; i < rowNum; i++) { // AlarmActionRowUnit ua = (AlarmActionRowUnit)AdminDataClass.al[i]; this.bmGridView.Rows[i].Cells[0].Value = "" + dt.Rows[i]["SERVER_NAME"]; this.bmGridView.Rows[i].Cells[1].Value = "" + dt.Rows[i]["SERVER_TYPE"]; } } string pNum = ""; string pType = ""; for (int i = 0; i < Bm_Main.serverInfo.Rows.Count; i++) { if (plantSearchComboBox.Text.Equals(Bm_Main.serverInfo.Rows[i]["SERVER_NAME"])) { pNum = "" + Bm_Main.serverInfo.Rows[i]["SERVER_NUM"]; pType = "" + Bm_Main.serverInfo.Rows[i]["SERVER_TYPE"]; } } if (pType.Equals("1") || pType.Equals("2")) { if (acsTypeInfoCombobox.SelectedIndex == 0) { rCheck = req.select("BMS003", qm.getQuery("PP_CardCount_R"), "ACS" + pNum + "S"); } else if (acsTypeInfoCombobox.SelectedIndex == 1) { rCheck = req.select("BMS003", qm.getQuery("PP_Auth_R"), "ACS" + pNum + "S"); } } else if (pType.Equals("3")) { if (acsTypeInfoCombobox.SelectedIndex == 0) { rCheck = req.select("BMS003", qm.getQuery("OG_CardCount_R"), "ACS" + pNum + "S"); } else if (acsTypeInfoCombobox.SelectedIndex == 1) { rCheck = req.select("BMS003", qm.getQuery("OG_Auth_R"), "ACS" + pNum + "S"); } } if (rCheck.Equals("0")) { dt = ReturnDT.dt; // Log.WriteLog(" DT = > " + "" + dt.Rows[0][0]); } rowNum = dt.Rows.Count; cNum = dt.Columns.Count; makeCell(this.acsGridView, rowNum, cNum); if (rowNum > 0) { for (int i = 0; i < rowNum; i++) { // AlarmActionRowUnit ua = (AlarmActionRowUnit)AdminDataClass.al[i]; this.acsGridView.Rows[i].Cells[0].Value = "" + dt.Rows[i][0]; this.acsGridView.Rows[i].Cells[1].Value = "" + dt.Rows[i][1]; } } }
// JSJ 0804 GR public void insertDB(int _fpServerNum) { Log.WriteLog("[FPRegisterForm.cs] insertDB () START =================================================="); int nIndex = 1; string ip = ""; if (nFingerIndex == 6) { nIndex = 1; } else if (nFingerIndex == 7) { nIndex = 2; } else if (nFingerIndex == 8) { nIndex = 3; } else if (nFingerIndex == 9) { nIndex = 4; } conn.ConnectionString = dbConString[_fpServerNum]; resultFlag = false; closeConnection(); resultFlag = openConnection(); if (!resultFlag) { MessageBox.Show("[FPRegisterForm.cs] 지문서버 DB Conneciton 실패 : " + conn.ConnectionString); return; } try { cmd = new SqlCommand("GuardTemplate", conn); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sCardNo", Convert.ToInt64(bid) + ""); Log.WriteLog("\t (1) sCardNo : " + Convert.ToInt64(bid)); SqlParameter nFingerIndexTmp = new SqlParameter("@nFingerIndexTmp", SqlDbType.Int); cmd.Parameters.Add(nFingerIndexTmp); nFingerIndexTmp.Direction = ParameterDirection.Input; nFingerIndexTmp.Value = nFingerIndex; Log.WriteLog("\t (2) nFingerIndex : " + nFingerIndex); SqlParameter nIndexTmp = new SqlParameter("@nIndexTmp", SqlDbType.Int); cmd.Parameters.Add(nIndexTmp); nIndexTmp.Direction = ParameterDirection.Input; nIndexTmp.Value = nIndex; Log.WriteLog("\t (3) nIndex : " + nIndex); SqlParameter templateTmp = new SqlParameter("@templateTmp", SqlDbType.Binary); cmd.Parameters.Add(templateTmp); templateTmp.Direction = ParameterDirection.Input; templateTmp.Value = Gloval.template; SqlParameter templateTmp2 = new SqlParameter("@templateTmp2", SqlDbType.Binary); cmd.Parameters.Add(templateTmp2); templateTmp2.Direction = ParameterDirection.Input; templateTmp2.Value = Gloval.template2; cmd.ExecuteNonQuery(); Log.WriteLog("..............................(3) ........................."); string Check = req.update("BMS0011", qm.getQuery("FP_REG_LOG", bidTextBox.Text), "BMI"); if (!Check.Equals("0")) { MessageBox.Show("로그 저장 실패.."); } } catch (SqlException se) { Log.WriteLog("[FPRegisterForm] insertDB (" + _fpServerNum + ") Exception : " + se.Message + ")"); MessageBox.Show("" + (_fpServerNum + 1) + "발전소 지문등록이 실패했습니다"); } finally { closeConnection(); } }
public void rereg() { Cursor = Cursors.WaitCursor; oldBid = reg.cardNum.Text; newBid = addZero(cardNum.Text); Boolean flag = reg.checkDuplicate(newBid); string[] right = reg.getCurRight(); for (int i = 0; i < right.Length; i++) { if (right[i].Equals("")) { right[i] = "-100"; } } int plantReg1 = 0; int plantReg2 = 0; int plantReg3 = 0; int plantReg4 = 0; int FPReg = 0; int VMReg = 0; if (reg.plant1RegCheckBox.Checked) { plantReg1 = 1; } if (reg.plant2RegCheckBox.Checked) { plantReg2 = 1; } if (reg.plant3RegCheckBox.Checked) { plantReg3 = 1; } if (reg.plant4RegCheckBox.Checked) { plantReg4 = 1; } if (reg.fpCheck.Checked) { FPReg = 1; } if (reg.vmCheck.Checked) { VMReg = 1; } if (!flag) { string sendDate = oldBid + "&" + newBid + "&" + right[0] + "&" + right[1] + "&" + right[2] + "&" + right[3] + "&" + plantReg1 + "&" + plantReg2 + "&" + plantReg3 + "&" + plantReg4 + "&" + FPReg + "&" + VMReg + "&" + endDateTime.Text; string rNumString = req.update("BMS011", sendDate, "BMRE"); if (!rNumString.Equals("0")) { MessageBox.Show("[Reg.cs] BmReReg () 재등록중에 오류가 발생하였습니다."); Cursor = Cursors.Default; return; } else { rNumString = req.update("BMS011", qm.getQuery("RE_REG_LOG", oldBid + " => " + newBid), "BMI"); MessageBox.Show("[Reg.cs] BmReReg () 재등록 완료...!"); reg.showCardList(25); Cursor = Cursors.Default; this.Close(); } } }
public void showData() { string rCheck = ""; if (searchInfoCombobox.Text.Equals("소속")) { rCheck = req.select("BMS003", qm.getQuery("Bm_Department_R", "", ""), "BMS"); } else if (searchInfoCombobox.Text.Equals("부서")) { rCheck = req.select("BMS003", qm.getQuery("Bm_Division_R", "", ""), "BMS"); } else if (searchInfoCombobox.Text.Equals("직급")) { rCheck = req.select("BMS003", qm.getQuery("Bm_Title_R", "", ""), "BMS"); } else if (searchInfoCombobox.Text.Equals("카드유형")) { rCheck = req.select("BMS003", qm.getQuery("Bm_Card_Type_R", "", ""), "BMS"); } else if (searchInfoCombobox.Text.Equals("카드상태")) { rCheck = req.select("BMS003", qm.getQuery("Bm_Card_Stat_R", "", ""), "BMS"); } if (rCheck.Equals("0")) { dt = ReturnDT.dt; DataTable User_Info = new DataTable(); } rowNum = dt.Rows.Count; cNum = dt.Columns.Count; makeCell(this.bmGridView, rowNum, cNum); if (rowNum > 0) { for (int i = 0; i < rowNum; i++) { // AlarmActionRowUnit ua = (AlarmActionRowUnit)AdminDataClass.al[i]; this.bmGridView.Rows[i].Cells[0].Value = "" + dt.Rows[i][0]; this.bmGridView.Rows[i].Cells[1].Value = "" + dt.Rows[i][1]; } } string pNum = ""; string pType = ""; for (int i = 0; i < Bm_Main.serverInfo.Rows.Count; i++) { if (plantSearchComboBox.Text.Equals(Bm_Main.serverInfo.Rows[i]["SERVER_NAME"])) { pNum = "" + Bm_Main.serverInfo.Rows[i]["SERVER_NUM"]; pType = "" + Bm_Main.serverInfo.Rows[i]["SERVER_TYPE"]; } } if (pType.Equals("1") || pType.Equals("2")) { if (searchInfoCombobox.Text.Equals("소속")) { rCheck = req.select("BMS003", qm.getQuery("PP_Department_R"), "ACS" + pNum + "S"); } else if (searchInfoCombobox.Text.Equals("부서")) { MessageBox.Show("해당 ACS에서는 해당 컬럼이 존재하지 않습니다."); return; } else if (searchInfoCombobox.Text.Equals("직급")) { MessageBox.Show("해당 ACS에서는 해당 컬럼이 존재하지 않습니다."); return; } else if (searchInfoCombobox.Text.Equals("카드유형")) { rCheck = req.select("BMS003", qm.getQuery("PP_Card_Type_R"), "ACS" + pNum + "S"); } else if (searchInfoCombobox.Text.Equals("카드상태")) { rCheck = req.select("BMS003", qm.getQuery("PP_Card_Stat_R"), "ACS" + pNum + "S"); } } else if (pType.Equals("3")) { if (searchInfoCombobox.Text.Equals("소속")) { rCheck = req.select("BMS003", qm.getQuery("OG_Department_R"), "ACS" + pNum + "S"); } else if (searchInfoCombobox.Text.Equals("부서")) { rCheck = req.select("BMS003", qm.getQuery("OG_Division_R"), "ACS" + pNum + "S"); } else if (searchInfoCombobox.Text.Equals("직급")) { rCheck = req.select("BMS003", qm.getQuery("OG_Title_R"), "ACS" + pNum + "S"); } else if (searchInfoCombobox.Text.Equals("카드유형")) { rCheck = req.select("BMS003", qm.getQuery("OG_Card_Type_R"), "ACS" + pNum + "S"); } else if (searchInfoCombobox.Text.Equals("카드상태")) { rCheck = req.select("BMS003", qm.getQuery("OG_Card_Stat_R"), "ACS" + pNum + "S"); } } if (rCheck.Equals("0")) { dt = ReturnDT.dt; // Log.WriteLog(" DT = > " + "" + dt.Rows[0][0]); } rowNum = dt.Rows.Count; cNum = dt.Columns.Count; makeCell(this.acsGridView, rowNum, cNum); if (rowNum > 0) { for (int i = 0; i < rowNum; i++) { // AlarmActionRowUnit ua = (AlarmActionRowUnit)AdminDataClass.al[i]; this.acsGridView.Rows[i].Cells[0].Value = "" + dt.Rows[i][0]; this.acsGridView.Rows[i].Cells[1].Value = "" + dt.Rows[i][1]; } } }
public void showData() { Cursor.Current = Cursors.WaitCursor; labelBefore.Visible = false; labelNext.Visible = false; resultDt = null; dt = null; int type = 0; if (comboBox1.Text.Equals("시스템")) { type = 1; } else if (comboBox1.Text.Equals("등록")) { type = 2; } // ReportGridView.Rows.Clear(); string startDate = startDateTime.Value.ToShortDateString(); string endDate = endDateTime.Value.ToShortDateString(); startDate += " " + startTimePicker.Value.ToString("HH:mm:ss"); endDate += " " + endTimePicker.Value.ToString("HH:mm:ss"); Dictionary <string, string> sendData = new Dictionary <string, string>(); sendData.Add("startDate", startDate); sendData.Add("endDate", endDate); sendData.Add("lastSEQ", "" + lastSEQ); sendData.Add("txtID", txtID.Text); sendData.Add("txtRemark", txtRemark.Text); sendData.Add("type", "" + type); string rCheck = req.select("BMS019", qm.getQuery("Rpt_005_Count", sendData), "BMS"); if (rCheck.Equals("0")) { dt = ReturnDT.dt; if (checkResult() == 1) { return; } MessageBox.Show("총 " + Convert.ToInt32(dt.Rows[0][0]) + "건이 검색되었습니다"); totalPage = (int)(Convert.ToInt32(dt.Rows[0][0]) / perPage); totalPage = (Convert.ToInt32(dt.Rows[0][0]) % perPage == 0) ? totalPage : totalPage += 1; resultDt = new DataTable[totalPage]; } else { MessageBox.Show("요청중에 네트워크 장애가 발생하였습니다. 다시 시도해주세요."); } for (int i = 0; i < totalPage; i++) { rCheck = req.select("BMS019", qm.getQuery("Rpt_005_S", sendData), "BMS"); resultDt[i] = ReturnDT.dt; if (i != (totalPage - 1)) { lastSEQ = Convert.ToInt32(resultDt[i].Rows[perPage - 1][0]); } sendData["lastSEQ"] = "" + lastSEQ; } rowNum = resultDt[0].Rows.Count; cNum = resultDt[0].Columns.Count; currentPage = 0; labelBefore.Visible = false; labelNext.Visible = true; // setGridview(ReportGridView, resultDt[currentPage].Rows.Count, resultDt[currentPage].Columns.Count, resultDt[currentPage]); ReportGridView.DataSource = resultDt[currentPage]; labelPage.Visible = true; labelPage.Text = (currentPage + 1) + " / " + totalPage; if (currentPage == totalPage - 1) { labelNext.Visible = false; } txtRemark.Text = ""; txtID.Text = ""; Cursor.Current = Cursors.Default; }