DB 구조 변경
쿼리를 먼저 만들어 DB로 보내게 됨. 함수 분할함.
This commit is contained in:
		| @@ -45,8 +45,9 @@ namespace WindowsFormsApp1.Home | ||||
|         { | ||||
|             dataGridView1.Rows.Clear(); | ||||
|             string Area = "`name`, `position`, `Phone`, `ID`, `PW`, `right`"; | ||||
|             string tmpstr = _DB.DB_Select_Search(Area, "User_Data", "affil", comp_name); | ||||
|             string[] data = tmpstr.Split('|'); | ||||
|             string cmd = _DB.DB_Select_Search(Area, "User_Data", "affil", comp_name); | ||||
|             string db_res = _DB.DB_Send_CMD_Search(cmd); | ||||
|             string[] data = db_res.Split('|'); | ||||
|             string[] grid = { "", "", "", "", "", "" }; | ||||
|             for (int a = 0; a < data.Length; a++) | ||||
|             { | ||||
| @@ -70,8 +71,9 @@ namespace WindowsFormsApp1.Home | ||||
|             if(e == null) { gridIndex = 0; } | ||||
|             else { gridIndex = e.RowIndex; } | ||||
|             string value = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); | ||||
|             string tmpstr = _DB.DB_Search(Table_User, "id", value); | ||||
|             tempData = tmpstr.Split('|'); | ||||
|             string cmd = _DB.DB_Search(Table_User, "id", value); | ||||
|             string db_res = _DB.DB_Send_CMD_Search(cmd); | ||||
|             tempData = db_res.Split('|'); | ||||
|             tb_ID.Text = dataGridView1.Rows[e.RowIndex].Cells["ID"].Value.ToString(); | ||||
|             tb_PW.Text = dataGridView1.Rows[e.RowIndex].Cells["PW"].Value.ToString(); | ||||
|             tb_Name.Text = dataGridView1.Rows[e.RowIndex].Cells["Per_Name"].Value.ToString(); | ||||
| @@ -88,8 +90,9 @@ namespace WindowsFormsApp1.Home | ||||
|         } | ||||
|         private void btn_IDOverlap_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             string check = _DB.DB_Search(Table_User, "id", tb_ID.Text); | ||||
|             if (check == "") { MessageBox.Show("사용가능한 아이디입니다. [" + tb_ID.Text + "]"); overlap = true; } | ||||
|             string cmd = _DB.DB_Search(Table_User, "id", tb_ID.Text); | ||||
|             string db_res = _DB.DB_Send_CMD_Search(cmd); | ||||
|             if (db_res == "") { MessageBox.Show("사용가능한 아이디입니다. [" + tb_ID.Text + "]"); overlap = true; } | ||||
|             else { MessageBox.Show("중복된 아이디입니다. [" + tb_ID.Text + "]"); overlap = false; } | ||||
|         } | ||||
|         private void All_Check(object sender, EventArgs e) | ||||
| @@ -103,7 +106,8 @@ namespace WindowsFormsApp1.Home | ||||
|         { | ||||
|             string right = Return_right(); | ||||
|             btn_lookup_Click(null, null); | ||||
|             _DB.DB_Update(Table_User, "right", right, "ID", tempData[1]);   //(Table_User, "right", right, tempData[1]); | ||||
|             string U_cmd = _DB.DB_Update(Table_User, "right", right, "ID", tempData[1]);   //(Table_User, "right", right, tempData[1]); | ||||
|             _DB.DB_Send_CMD_reVoid(U_cmd); | ||||
|         } | ||||
|         private void btn_Add_Click(object sender, EventArgs e) | ||||
|         { | ||||
| @@ -135,7 +139,8 @@ namespace WindowsFormsApp1.Home | ||||
|         } | ||||
|         private void btn_Del_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             _DB.DB_Delete(Table_User, "id", tempData[0], "PW", tempData[1]); | ||||
|             string D_cmd = _DB.DB_Delete(Table_User, "id", tempData[0], "PW", tempData[1]); | ||||
|             _DB.DB_Send_CMD_reVoid(D_cmd); | ||||
|             dataGridView1.Rows.Remove(dataGridView1.Rows[gridIndex]); | ||||
|         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 SeungHo Yang
					SeungHo Yang