=====* unimarc *=====
기능 작업 완료 테스트 작업 진행중 홈 탭 완료 목록집계 진행중 (인쇄)
This commit is contained in:
		| @@ -16,12 +16,10 @@ namespace WindowsFormsApp1.Home | ||||
|     { | ||||
|         public string User_Name { get; internal set; } | ||||
|         bool overlap = false; | ||||
|         string[] tempData; | ||||
|         Helper_DB _DB = new Helper_DB(); | ||||
|         Main main; | ||||
|         string comp_name = string.Empty; | ||||
|         string Table_User = "User_Data"; | ||||
|         int gridIndex; | ||||
|  | ||||
|         public Home_User_manage(Main _main) | ||||
|         { | ||||
| @@ -34,7 +32,6 @@ namespace WindowsFormsApp1.Home | ||||
|             _DB.DBcon(); | ||||
|             tb_Affil.Enabled = false; | ||||
|             btn_lookup_Click(null, null); | ||||
|             init_check(); | ||||
|         } | ||||
|         /// <summary> | ||||
|         /// DB에 저장된 사용자 데이터를 dataGridView1로 입력하는 함수. | ||||
| @@ -44,23 +41,71 @@ namespace WindowsFormsApp1.Home | ||||
|         private void btn_lookup_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             dataGridView1.Rows.Clear(); | ||||
|             string Area = "`name`, `position`, `Phone`, `ID`, `PW`, `right`"; | ||||
|             string Area = "`name`, `position`, `Phone`, `ID`, `PW`"; | ||||
|             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++) | ||||
|             { | ||||
|                 if (a % 6 == 0) { grid[0] = data[a]; } | ||||
|                 if (a % 6 == 1) { grid[1] = data[a]; } | ||||
|                 if (a % 6 == 2) { grid[2] = data[a]; } | ||||
|                 if (a % 6 == 3) { grid[3] = data[a]; } | ||||
|                 if (a % 6 == 4) { grid[4] = data[a]; } | ||||
|                 if (a % 6 == 5) { grid[5] = data[a]; | ||||
|                 if (a % 5 == 0) { grid[0] = data[a]; } | ||||
|                 if (a % 5 == 1) { grid[1] = data[a]; } | ||||
|                 if (a % 5 == 2) { grid[2] = data[a]; } | ||||
|                 if (a % 5 == 3) { grid[3] = data[a]; } | ||||
|                 if (a % 5 == 4) { grid[4] = data[a]; | ||||
|                     dataGridView1.Rows.Add(grid); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void chk_Div_ListInput_Click(object sender, EventArgs e) | ||||
|         { | ||||
|              | ||||
|         } | ||||
|  | ||||
|         private void chk_Enabled(object sender, EventArgs e) | ||||
|         { | ||||
|             CheckBox Target = sender as CheckBox; | ||||
|  | ||||
|             bool IsCheck = Target.Checked; | ||||
|  | ||||
|             CheckBox[] Enabled = { chk_Div, chk_Acc, chk_Marc, chk_Manage }; | ||||
|  | ||||
|             CheckBox[] Div = { | ||||
|                 chk_Div_ListInput, chk_Div_ListLookup, chk_Div_ListTotal, chk_Div_OrderInput, chk_Div_Inven, | ||||
|                 chk_Div_Stock, chk_Div_Return  | ||||
|             }; | ||||
|             CheckBox[] Acc = {  | ||||
|                 chk_Acc_SendMoneyList, chk_Acc_SendMoneyInput, chk_Acc_Buy, chk_Acc_Sales, chk_Acc_PartTime | ||||
|             }; | ||||
|             CheckBox[] Marc = { | ||||
|                 chk_Marc_Setup, chk_Marc_Work, chk_Marc_Input, chk_Marc_CopyCheck, chk_Marc_Option, | ||||
|                 chk_Marc_DLS, chk_Marc_ETC | ||||
|             }; | ||||
|             CheckBox[] Manage = { | ||||
|                 chk_Manage_User, chk_Manage_Client, chk_Manage_Purchase, chk_Manage_Book | ||||
|             }; | ||||
|  | ||||
|             for(int a= 0; a < Enabled.Length; a++) | ||||
|             { | ||||
|                 if (Target == Enabled[a]) | ||||
|                 { | ||||
|                     if (a % 4 == 0) { Enable_Sub(Div, IsCheck); } | ||||
|                     if (a % 4 == 1) { Enable_Sub(Acc, IsCheck); } | ||||
|                     if (a % 4 == 2) { Enable_Sub(Marc, IsCheck); } | ||||
|                     if (a % 4 == 3) { Enable_Sub(Manage, IsCheck); } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void Enable_Sub(CheckBox[] Target, bool IsCheck) | ||||
|         { | ||||
|             for (int a = 0; a < Target.Length; a++) | ||||
|             { | ||||
|                 Target[a].Checked = IsCheck; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         /// <summary> | ||||
|         /// 권한 설정 0일경우 체크없음, 1일경우 활성화만, 2일경우 활성화와 수정체크 | ||||
|         /// </summary> | ||||
| @@ -68,26 +113,59 @@ namespace WindowsFormsApp1.Home | ||||
|         /// <param name="e"></param> | ||||
|         private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) | ||||
|         { | ||||
|             if(e == null) { gridIndex = 0; } | ||||
|             else { gridIndex = e.RowIndex; } | ||||
|             string value = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString(); | ||||
|             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(); | ||||
|             int row = e.RowIndex; | ||||
|  | ||||
|             if (row < 0) return; | ||||
|  | ||||
|             tb_ID.Text = dataGridView1.Rows[row].Cells["ID"].Value.ToString(); | ||||
|             tb_PW.Text = dataGridView1.Rows[row].Cells["PW"].Value.ToString(); | ||||
|             tb_Name.Text = dataGridView1.Rows[row].Cells["Per_Name"].Value.ToString(); | ||||
|             tb_Affil.Text = comp_name; | ||||
|             tb_position.Text = dataGridView1.Rows[e.RowIndex].Cells["Rank"].Value.ToString(); | ||||
|             tb_Phone.Text = dataGridView1.Rows[e.RowIndex].Cells["Phone"].Value.ToString(); | ||||
|             string[] real = dataGridView1.Rows[e.RowIndex].Cells["right"].Value.ToString().Split(','); | ||||
|             right_chk(real); | ||||
|             init_check(); | ||||
|             tb_position.Text = dataGridView1.Rows[row].Cells["Rank"].Value.ToString(); | ||||
|             tb_Phone.Text = dataGridView1.Rows[row].Cells["Phone"].Value.ToString(); | ||||
|  | ||||
|             User_Access_Set(); | ||||
|         } | ||||
|         private void check1_1_Click(object sender, EventArgs e) | ||||
|         #region CellClick_Sub | ||||
|         private void User_Access_Set() | ||||
|         { | ||||
|             init_check(); | ||||
|             CheckBox[] chkBox = { | ||||
|                 chk_Div_ListInput, chk_Div_ListLookup, chk_Div_ListTotal, chk_Div_OrderInput, chk_Div_Inven, | ||||
|                 chk_Div_Stock, chk_Div_Return, | ||||
|  | ||||
|                 chk_Acc_SendMoneyList, chk_Acc_SendMoneyInput, chk_Acc_Buy, chk_Acc_Sales, chk_Acc_PartTime, | ||||
|  | ||||
|                 chk_Marc_Setup, chk_Marc_Work, chk_Marc_Input, chk_Marc_CopyCheck, chk_Marc_Option, | ||||
|                 chk_Marc_DLS, chk_Marc_ETC, | ||||
|  | ||||
|                 chk_Manage_User, chk_Manage_Client, chk_Manage_Purchase, chk_Manage_Book | ||||
|             }; | ||||
|  | ||||
|  | ||||
|             string Area = | ||||
|                 "`Div_ListInput`, `Div_ListLookup`, `Div_ListTotal`, `Div_OrderInput`, `Div_Inven`," + | ||||
|                 "`Div_Stock`, `Div_Return`," + | ||||
|  | ||||
|                 "`Acc_SendMoneyList`, `Acc_SendMoneyInput`, `Acc_Buy`, `Acc_Sales`, `Acc_PartTime`," + | ||||
|  | ||||
|                 "`Marc_Setup`, `Marc_Work`, `Marc_Input`, `Marc_CopyCheck`, `Marc_Option`," + | ||||
|                 "`Marc_DLS`, `Marc_ETC`," + | ||||
|  | ||||
|                 "`Manage_User`, `Manage_Client`, `Manage_Purchase`, `Manage_Book`"; | ||||
|             string cmd = _DB.DB_Select_Search(Area, "User_Access", "id", tb_ID.Text); | ||||
|             string res = _DB.DB_Send_CMD_Search(cmd); | ||||
|             string[] IsCheck = res.Split('|'); | ||||
|  | ||||
|             for (int a = 0; a < chkBox.Length; a++) | ||||
|             { | ||||
|                 if (IsCheck[a] == "1") | ||||
|                     chkBox[a].Checked = true; | ||||
|                 else | ||||
|                     chkBox[a].Checked = false; | ||||
|             } | ||||
|         } | ||||
|         #endregion | ||||
|  | ||||
|         private void btn_IDOverlap_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             string cmd = _DB.DB_Search(Table_User, "id", tb_ID.Text); | ||||
| @@ -95,384 +173,101 @@ namespace WindowsFormsApp1.Home | ||||
|             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) | ||||
|         { | ||||
|             bool yesorno = false; | ||||
|             if (((CheckBox)sender).Checked == true) { yesorno = true; } | ||||
|             else if (((CheckBox)sender).Checked == false) { yesorno = false; } | ||||
|             ALL_Check(sender, yesorno); | ||||
|         } | ||||
|         private void btn_Save_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             string right = Return_right(); | ||||
|             btn_lookup_Click(null, null); | ||||
|             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) | ||||
|         { | ||||
|             if (tb_ID.Text == "" || tb_PW.Text == "" || tb_Name.Text == "") | ||||
|             { | ||||
|             if (tb_ID.Text == "" || tb_PW.Text == "" || tb_Name.Text == "") { | ||||
|                 MessageBox.Show("성명 / 아이디 / 비밀번호 를 채워주세요."); | ||||
|                 return; | ||||
|             } | ||||
|             else if (overlap == true) | ||||
|  | ||||
|             bool IsUpdate = true; | ||||
|             string cmd = _DB.DB_Search(Table_User, "id", tb_ID.Text); | ||||
|             string db_res = _DB.DB_Send_CMD_Search(cmd); | ||||
|             if (db_res == "") IsUpdate = false; | ||||
|  | ||||
|             CheckBox[] chkBox = { | ||||
|                 chk_Div_ListInput, chk_Div_ListLookup, chk_Div_ListTotal, chk_Div_OrderInput, chk_Div_Inven, | ||||
|                 chk_Div_Stock, chk_Div_Return, | ||||
|  | ||||
|                 chk_Acc_SendMoneyList, chk_Acc_SendMoneyInput, chk_Acc_Buy, chk_Acc_Sales, chk_Acc_PartTime, | ||||
|  | ||||
|                 chk_Marc_Setup, chk_Marc_Work, chk_Marc_Input, chk_Marc_CopyCheck, chk_Marc_Option, | ||||
|                 chk_Marc_DLS, chk_Marc_ETC, | ||||
|  | ||||
|                 chk_Manage_User, chk_Manage_Client, chk_Manage_Purchase, chk_Manage_Book | ||||
|             }; | ||||
|  | ||||
|             string[] Update_Col = {  | ||||
|                 "id", "Div_ListInput", "Div_ListLookup", "Div_ListTotal", "Div_OrderInput", "Div_Inven", | ||||
|                 "Div_Stock", "Div_Return", | ||||
|  | ||||
|                 "Acc_SendMoneyList", "Acc_SendMoneyInput", "Acc_Buy", "Acc_Sales", "Acc_PartTime", | ||||
|  | ||||
|                 "Marc_Setup", "Marc_Work", "Marc_Input", "Marc_CopyCheck", "Marc_Option", | ||||
|                 "Marc_DLS", "Marc_ETC", | ||||
|  | ||||
|                 "Manage_User", "Manage_Client", "Manage_Purchase", "Manage_Book" | ||||
|             }; | ||||
|  | ||||
|             List<string> tmp_Update_data = new List<string>(); | ||||
|             tmp_Update_data.Add(tb_ID.Text); | ||||
|             for (int a = 0; a < chkBox.Length; a++) | ||||
|             { | ||||
|                 string right = Return_right(); | ||||
|                 string create_DB = "INSERT INTO User_Data" + | ||||
|                     "(`ID`, `PW`, `name`, `right`, `affil`, `position`, `Phone`, `grade`)" + | ||||
|                     "values('" + tb_ID.Text + "', '" + tb_PW.Text + "', '" + tb_Name.Text + "', '" + right + "',"; | ||||
|                 if (_DB.chk_comp(tb_Affil.Text) == true) { | ||||
|                     MessageBox.Show("DB에 등록되지 않은 업체입니다.\n관리자에게 연락바랍니다.", "Error"); | ||||
|                     return; | ||||
|                 } | ||||
|                 if (tb_Affil.Text == "") { create_DB += "null,"; } | ||||
|                 else { create_DB += "'" + tb_Affil.Text + "',"; } | ||||
|                 if (tb_position.Text == "") { create_DB += "null,"; } | ||||
|                 else { create_DB += "'" + tb_position.Text + "',"; } | ||||
|                 if (tb_Phone.Text == "") { create_DB += "null,"; } | ||||
|                 else { create_DB += "'" + tb_Phone.Text + "',"; } | ||||
|                 _DB.self_Made_Cmd(create_DB); | ||||
|                 overlap = false; | ||||
|                 btn_lookup_Click(null, null); | ||||
|                 bool IsCheck = chkBox[a].Checked; | ||||
|                 string tmp_data = "0"; | ||||
|                 if (IsCheck) | ||||
|                     tmp_data = "1"; | ||||
|  | ||||
|                 tmp_Update_data.Add(tmp_data); | ||||
|             } | ||||
|             else { MessageBox.Show("아이디 중복확인을 해주세요"); } | ||||
|  | ||||
|             string[] Update_Data = tmp_Update_data.ToArray(); | ||||
|  | ||||
|             if (!IsUpdate) | ||||
|             { | ||||
|                 string[] Insert_Col = { "ID", "PW", "name", "affil", "position", "Phone" }; | ||||
|                 string[] Insert_Data = { tb_ID.Text, tb_PW.Text, tb_Name.Text, tb_Affil.Text, tb_position.Text, tb_Phone.Text }; | ||||
|  | ||||
|                 cmd = _DB.DB_INSERT("User_Data", Insert_Col, Insert_Data); | ||||
|                 _DB.DB_Send_CMD_reVoid(cmd); | ||||
|                 cmd = _DB.DB_INSERT("User_Access", Update_Col, Update_Data); | ||||
|                 _DB.DB_Send_CMD_reVoid(cmd); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 string[] Search_Col = { "ID" }; | ||||
|                 string[] Search_Data = { tb_ID.Text }; | ||||
|                 string[] Update1_Col = { "ID", "PW", "name", "affil", "position", "Phone" }; | ||||
|                 string[] Update1_Data = { tb_ID.Text, tb_PW.Text, tb_Name.Text, tb_Affil.Text, tb_position.Text, tb_Phone.Text }; | ||||
|  | ||||
|                 cmd = _DB.More_Update("User_Data", Update1_Col, Update1_Data, Search_Col, Search_Data); | ||||
|                 _DB.DB_Send_CMD_reVoid(cmd); | ||||
|                 cmd = _DB.More_Update("User_Access", Update_Col, Update_Data, Search_Col, Search_Data); | ||||
|                 _DB.DB_Send_CMD_reVoid(cmd); | ||||
|             } | ||||
|  | ||||
|             MessageBox.Show("저장되었습니다!"); | ||||
|             btn_lookup_Click(null, null); | ||||
|         } | ||||
|  | ||||
|         private void btn_Empty_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             tb_ID.Text = ""; | ||||
|             tb_PW.Text = ""; | ||||
|             tb_Name.Text = ""; | ||||
|             tb_Affil.Text = comp_name; | ||||
|             tb_position.Text = ""; | ||||
|             tb_Phone.Text = ""; | ||||
|         } | ||||
|  | ||||
|         private void btn_Del_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             string D_cmd = _DB.DB_Delete(Table_User, "id", tempData[0], "PW", tempData[1]); | ||||
|             int row = dataGridView1.CurrentRow.Index; | ||||
|             string D_cmd = _DB.DB_Delete(Table_User, "ID", tb_ID.Text, "PW", tb_PW.Text); | ||||
|             _DB.DB_Send_CMD_reVoid(D_cmd); | ||||
|             dataGridView1.Rows.Remove(dataGridView1.Rows[gridIndex]); | ||||
|             dataGridView1.Rows.Remove(dataGridView1.Rows[row]); | ||||
|         } | ||||
|  | ||||
|         #region 체크박스 관련 | ||||
|         /// <summary> | ||||
|         /// 체크박스로 권한(right)값 구하기 | ||||
|         /// </summary> | ||||
|         /// <returns></returns> | ||||
|         private string Return_right() | ||||
|         { | ||||
|             string right = ""; | ||||
|             { | ||||
|                 if (check1_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check1_1.Checked == true && check1_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check1_1.Checked == true && check1_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check2_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check2_1.Checked == true && check2_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check2_1.Checked == true && check2_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check3_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check3_1.Checked == true && check3_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check3_1.Checked == true && check3_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check4_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check4_1.Checked == true && check4_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check4_1.Checked == true && check4_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check5_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check5_1.Checked == true && check5_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check5_1.Checked == true && check5_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check6_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check6_1.Checked == true && check6_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check6_1.Checked == true && check6_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check7_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check7_1.Checked == true && check7_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check7_1.Checked == true && check7_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check8_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check8_1.Checked == true && check8_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check8_1.Checked == true && check8_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check9_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check9_1.Checked == true && check9_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check9_1.Checked == true && check9_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check10_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check10_1.Checked == true && check10_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check10_1.Checked == true && check10_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check11_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check11_1.Checked == true && check11_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check11_1.Checked == true && check11_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check12_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check12_1.Checked == true && check12_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check12_1.Checked == true && check12_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check13_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check13_1.Checked == true && check13_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check13_1.Checked == true && check13_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check14_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check14_1.Checked == true && check14_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check14_1.Checked == true && check14_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check15_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check15_1.Checked == true && check15_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check15_1.Checked == true && check15_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check16_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check16_1.Checked == true && check16_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check16_1.Checked == true && check16_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check17_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check17_1.Checked == true && check17_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check17_1.Checked == true && check17_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check18_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check18_1.Checked == true && check18_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check18_1.Checked == true && check18_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check19_1.Checked == false) { right += "0,"; } | ||||
|                 else if (check19_1.Checked == true && check19_2.Checked == false) { right += "1,"; } | ||||
|                 else if (check19_1.Checked == true && check19_2.Checked == true) { right += "2,"; } | ||||
|  | ||||
|                 if (check20_1.Checked == false) { right += "0"; } | ||||
|                 else if (check20_1.Checked == true && check20_2.Checked == false) { right += "1"; } | ||||
|                 else if (check20_1.Checked == true && check20_2.Checked == true) { right += "2"; } | ||||
|             }       // 체크박스로 권한값구하기 | ||||
|             return right; | ||||
|         } | ||||
|         /// <summary> | ||||
|         /// 권한 나눈거 적용하는 함수 | ||||
|         /// </summary> | ||||
|         /// <param name="real"></param> | ||||
|         private void right_chk(string[] real) | ||||
|         { | ||||
|             if (real[0] == "0") { check1_1.Checked = false; check1_2.Checked = false; } | ||||
|             else if (real[0] == "1") { check1_1.Checked = true; check1_2.Checked = false; } | ||||
|             else if (real[0] == "2") { check1_1.Checked = true; check1_2.Checked = true; } | ||||
|  | ||||
|             if (real[1] == "0") { check2_1.Checked = false; check2_2.Checked = false; } | ||||
|             else if (real[1] == "1") { check2_1.Checked = true; check2_2.Checked = false; } | ||||
|             else if (real[1] == "2") { check2_1.Checked = true; check2_2.Checked = true; } | ||||
|  | ||||
|             if (real[2] == "0") { check3_1.Checked = false; check3_2.Checked = false; } | ||||
|             else if (real[2] == "1") { check3_1.Checked = true; check3_2.Checked = false; } | ||||
|             else if (real[2] == "2") { check3_1.Checked = true; check3_2.Checked = true; } | ||||
|  | ||||
|             if (real[3] == "0") { check4_1.Checked = false; check4_2.Checked = false; } | ||||
|             else if (real[3] == "1") { check4_1.Checked = true; check4_2.Checked = false; } | ||||
|             else if (real[3] == "2") { check4_1.Checked = true; check4_2.Checked = true; } | ||||
|  | ||||
|             if (real[4] == "0") { check5_1.Checked = false; check5_2.Checked = false; } | ||||
|             else if (real[4] == "1") { check5_1.Checked = true; check5_2.Checked = false; } | ||||
|             else if (real[4] == "2") { check5_1.Checked = true; check5_2.Checked = true; } | ||||
|  | ||||
|             if (real[5] == "0") { check6_1.Checked = false; check6_2.Checked = false; } | ||||
|             else if (real[5] == "1") { check6_1.Checked = true; check6_2.Checked = false; } | ||||
|             else if (real[5] == "2") { check6_1.Checked = true; check6_2.Checked = true; } | ||||
|  | ||||
|             if (real[6] == "0") { check7_1.Checked = false; check7_2.Checked = false; } | ||||
|             else if (real[6] == "1") { check7_1.Checked = true; check7_2.Checked = false; } | ||||
|             else if (real[6] == "2") { check7_1.Checked = true; check7_2.Checked = true; } | ||||
|  | ||||
|             if (real[7] == "0") { check8_1.Checked = false; check8_2.Checked = false; } | ||||
|             else if (real[7] == "1") { check8_1.Checked = true; check8_2.Checked = false; } | ||||
|             else if (real[7] == "2") { check8_1.Checked = true; check8_2.Checked = true; } | ||||
|  | ||||
|             if (real[8] == "0") { check9_1.Checked = false; check9_2.Checked = false; } | ||||
|             else if (real[8] == "1") { check9_1.Checked = true; check9_2.Checked = false; } | ||||
|             else if (real[8] == "2") { check9_1.Checked = true; check9_2.Checked = true; } | ||||
|  | ||||
|             if (real[9] == "0") { check10_1.Checked = false; check10_2.Checked = false; } | ||||
|             else if (real[9] == "1") { check10_1.Checked = true; check10_2.Checked = false; } | ||||
|             else if (real[9] == "2") { check10_1.Checked = true; check10_2.Checked = true; } | ||||
|  | ||||
|             if (real[10] == "0") { check11_1.Checked = false; check11_2.Checked = false; } | ||||
|             else if (real[10] == "1") { check11_1.Checked = true; check11_2.Checked = false; } | ||||
|             else if (real[10] == "2") { check11_1.Checked = true; check11_2.Checked = true; } | ||||
|  | ||||
|             if (real[11] == "0") { check12_1.Checked = false; check12_2.Checked = false; } | ||||
|             else if (real[11] == "1") { check12_1.Checked = true; check12_2.Checked = false; } | ||||
|             else if (real[11] == "2") { check12_1.Checked = true; check12_2.Checked = true; } | ||||
|  | ||||
|             if (real[12] == "0") { check13_1.Checked = false; check13_2.Checked = false; } | ||||
|             else if (real[12] == "1") { check13_1.Checked = true; check13_2.Checked = false; } | ||||
|             else if (real[12] == "2") { check13_1.Checked = true; check13_2.Checked = true; } | ||||
|  | ||||
|             if (real[13] == "0") { check14_1.Checked = false; check14_2.Checked = false; } | ||||
|             else if (real[13] == "1") { check14_1.Checked = true; check14_2.Checked = false; } | ||||
|             else if (real[13] == "2") { check14_1.Checked = true; check14_2.Checked = true; } | ||||
|  | ||||
|             if (real[14] == "0") { check15_1.Checked = false; check15_2.Checked = false; } | ||||
|             else if (real[14] == "1") { check15_1.Checked = true; check15_2.Checked = false; } | ||||
|             else if (real[14] == "2") { check15_1.Checked = true; check15_2.Checked = true; } | ||||
|  | ||||
|             if (real[15] == "0") { check16_1.Checked = false; check16_2.Checked = false; } | ||||
|             else if (real[15] == "1") { check16_1.Checked = true; check16_2.Checked = false; } | ||||
|             else if (real[15] == "2") { check16_1.Checked = true; check16_2.Checked = true; } | ||||
|  | ||||
|             if (real[16] == "0") { check17_1.Checked = false; check17_2.Checked = false; } | ||||
|             else if (real[16] == "1") { check17_1.Checked = true; check17_2.Checked = false; } | ||||
|             else if (real[16] == "2") { check17_1.Checked = true; check17_2.Checked = true; } | ||||
|  | ||||
|             if (real[17] == "0") { check18_1.Checked = false; check18_2.Checked = false; } | ||||
|             else if (real[17] == "1") { check18_1.Checked = true; check18_2.Checked = false; } | ||||
|             else if (real[17] == "2") { check18_1.Checked = true; check18_2.Checked = true; } | ||||
|  | ||||
|             if (real[18] == "0") { check19_1.Checked = false; check19_2.Checked = false; } | ||||
|             else if (real[18] == "1") { check19_1.Checked = true; check19_2.Checked = false; } | ||||
|             else if (real[18] == "2") { check19_1.Checked = true; check19_2.Checked = true; } | ||||
|  | ||||
|             if (real[19] == "0") { check20_1.Checked = false; check20_2.Checked = false; } | ||||
|             else if (real[19] == "1") { check20_1.Checked = true; check20_2.Checked = false; } | ||||
|             else if (real[19] == "2") { check20_1.Checked = true; check20_2.Checked = true; } | ||||
|         } | ||||
|         /// <summary> | ||||
|         /// 체크박스 초기화 | ||||
|         /// </summary> | ||||
|         private void init_check() | ||||
|         { | ||||
|             if (check1_1.Checked == false) { check1_2.Enabled = false; } | ||||
|             else if (check1_1.Checked == true) { check1_2.Enabled = true; } | ||||
|             if (check2_1.Checked == false) { check2_2.Enabled = false; } | ||||
|             else if (check2_1.Checked == true) { check2_2.Enabled = true; } | ||||
|             if (check3_1.Checked == false) { check3_2.Enabled = false; } | ||||
|             else if (check3_1.Checked == true) { check3_2.Enabled = true; } | ||||
|             if (check4_1.Checked == false) { check4_2.Enabled = false; } | ||||
|             else if (check4_1.Checked == true) { check4_2.Enabled = true; } | ||||
|             if (check5_1.Checked == false) { check5_2.Enabled = false; } | ||||
|             else if (check5_1.Checked == true) { check5_2.Enabled = true; } | ||||
|             if (check6_1.Checked == false) { check6_2.Enabled = false; } | ||||
|             else if (check6_1.Checked == true) { check6_2.Enabled = true; } | ||||
|             if (check7_1.Checked == false) { check7_2.Enabled = false; } | ||||
|             else if (check7_1.Checked == true) { check7_2.Enabled = true; } | ||||
|             if (check8_1.Checked == false) { check8_2.Enabled = false; } | ||||
|             else if (check8_1.Checked == true) { check8_2.Enabled = true; } | ||||
|             if (check9_1.Checked == false) { check9_2.Enabled = false; } | ||||
|             else if (check9_1.Checked == true) { check9_2.Enabled = true; } | ||||
|             if (check10_1.Checked == false) { check10_2.Enabled = false; } | ||||
|             else if (check10_1.Checked == true) { check10_2.Enabled = true; } | ||||
|             if (check11_1.Checked == false) { check11_2.Enabled = false; } | ||||
|             else if (check11_1.Checked == true) { check11_2.Enabled = true; } | ||||
|             if (check12_1.Checked == false) { check12_2.Enabled = false; } | ||||
|             else if (check12_1.Checked == true) { check12_2.Enabled = true; } | ||||
|             if (check13_1.Checked == false) { check13_2.Enabled = false; } | ||||
|             else if (check13_1.Checked == true) { check13_2.Enabled = true; } | ||||
|             if (check14_1.Checked == false) { check14_2.Enabled = false; } | ||||
|             else if (check14_1.Checked == true) { check14_2.Enabled = true; } | ||||
|             if (check15_1.Checked == false) { check15_2.Enabled = false; } | ||||
|             else if (check15_1.Checked == true) { check15_2.Enabled = true; } | ||||
|             if (check16_1.Checked == false) { check16_2.Enabled = false; } | ||||
|             else if (check16_1.Checked == true) { check16_2.Enabled = true; } | ||||
|             if (check17_1.Checked == false) { check17_2.Enabled = false; } | ||||
|             else if (check17_1.Checked == true) { check17_2.Enabled = true; } | ||||
|             if (check18_1.Checked == false) { check18_2.Enabled = false; } | ||||
|             else if (check18_1.Checked == true) { check18_2.Enabled = true; } | ||||
|             if (check19_1.Checked == false) { check19_2.Enabled = false; } | ||||
|             else if (check19_1.Checked == true) { check19_2.Enabled = true; } | ||||
|             if (check20_1.Checked == false) { check20_2.Enabled = false; } | ||||
|             else if (check20_1.Checked == true) { check20_2.Enabled = true; } | ||||
|         } | ||||
|         /// <summary> | ||||
|         /// 일괄체크 | ||||
|         /// </summary> | ||||
|         /// <param name="sender">이벤트 sender 그대로 가져와야함</param> | ||||
|         /// <param name="chk">true or false</param> | ||||
|         private void ALL_Check(object sender, bool chk) | ||||
|         { | ||||
|             string target = ((CheckBox)sender).Name; | ||||
|             {  | ||||
|                 if (target == "ALL_check1" && chk == true) | ||||
|                 { | ||||
|                     check1_1.Checked = true; | ||||
|                     check2_1.Checked = true; | ||||
|                     check3_1.Checked = true; | ||||
|                     check4_1.Checked = true; | ||||
|                     check5_1.Checked = true; | ||||
|                     check6_1.Checked = true; | ||||
|                     check7_1.Checked = true; | ||||
|                     check8_1.Checked = true; | ||||
|                     check9_1.Checked = true; | ||||
|                     check10_1.Checked = true; | ||||
|                     check11_1.Checked = true; | ||||
|                     check12_1.Checked = true; | ||||
|                     check13_1.Checked = true; | ||||
|                     check14_1.Checked = true; | ||||
|                     check15_1.Checked = true; | ||||
|                     check16_1.Checked = true; | ||||
|                     check17_1.Checked = true; | ||||
|                     check18_1.Checked = true; | ||||
|                     check19_1.Checked = true; | ||||
|                     check20_1.Checked = true; | ||||
|                 } | ||||
|                 else if (target == "ALL_check1" && chk == false) | ||||
|                 { | ||||
|                     check1_1.Checked = false; | ||||
|                     check2_1.Checked = false; | ||||
|                     check3_1.Checked = false; | ||||
|                     check4_1.Checked = false; | ||||
|                     check5_1.Checked = false; | ||||
|                     check6_1.Checked = false; | ||||
|                     check7_1.Checked = false; | ||||
|                     check8_1.Checked = false; | ||||
|                     check9_1.Checked = false; | ||||
|                     check10_1.Checked = false; | ||||
|                     check11_1.Checked = false; | ||||
|                     check12_1.Checked = false; | ||||
|                     check13_1.Checked = false; | ||||
|                     check14_1.Checked = false; | ||||
|                     check15_1.Checked = false; | ||||
|                     check16_1.Checked = false; | ||||
|                     check17_1.Checked = false; | ||||
|                     check18_1.Checked = false; | ||||
|                     check19_1.Checked = false; | ||||
|                     check20_1.Checked = false; | ||||
|                 } | ||||
|                 else if (target == "ALL_check2" && chk == true) | ||||
|                 { | ||||
|                     check1_2.Checked = true; | ||||
|                     check2_2.Checked = true; | ||||
|                     check3_2.Checked = true; | ||||
|                     check4_2.Checked = true; | ||||
|                     check5_2.Checked = true; | ||||
|                     check6_2.Checked = true; | ||||
|                     check7_2.Checked = true; | ||||
|                     check8_2.Checked = true; | ||||
|                     check9_2.Checked = true; | ||||
|                     check10_2.Checked = true; | ||||
|                     check11_2.Checked = true; | ||||
|                     check12_2.Checked = true; | ||||
|                     check13_2.Checked = true; | ||||
|                     check14_2.Checked = true; | ||||
|                     check15_2.Checked = true; | ||||
|                     check16_2.Checked = true; | ||||
|                     check17_2.Checked = true; | ||||
|                     check18_2.Checked = true; | ||||
|                     check19_2.Checked = true; | ||||
|                     check20_2.Checked = true; | ||||
|                 } | ||||
|                 else if (target == "ALL_check2" && chk == false) | ||||
|             { | ||||
|                 check1_2.Checked = false; | ||||
|                 check2_2.Checked = false; | ||||
|                 check3_2.Checked = false; | ||||
|                 check4_2.Checked = false; | ||||
|                 check5_2.Checked = false; | ||||
|                 check6_2.Checked = false; | ||||
|                 check7_2.Checked = false; | ||||
|                 check8_2.Checked = false; | ||||
|                 check9_2.Checked = false; | ||||
|                 check10_2.Checked = false; | ||||
|                 check11_2.Checked = false; | ||||
|                 check12_2.Checked = false; | ||||
|                 check13_2.Checked = false; | ||||
|                 check14_2.Checked = false; | ||||
|                 check15_2.Checked = false; | ||||
|                 check16_2.Checked = false; | ||||
|                 check17_2.Checked = false; | ||||
|                 check18_2.Checked = false; | ||||
|                 check19_2.Checked = false; | ||||
|                 check20_2.Checked = false; | ||||
|             } | ||||
|             } | ||||
|             init_check(); | ||||
|         } | ||||
|         #endregion | ||||
|  | ||||
|         private void btn_close_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             this.Close(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 SeungHo Yang
					SeungHo Yang