/// <summary> /// <para>기능 : 매장 업데이터</para> /// <para>진입 : 메시지 박스 yes클릭</para> /// <para>분기 : 1. 버튼 텍스트 == "변경"</para> /// <para> 2. queryResult >0</para> /// <para>로직 : 1. if 버튼 텍스트 == "변경"</para> /// <para> 2. readonlyTextBoxAndDatetimePicker</para> /// <para> 3. buttonEnableToggle</para> /// <para> 4. 버튼 텍스트 "적용"으로 변경</para> /// <para> 5. return</para> /// <para> 6. 매장 코드를 기준으로 queryRead & crud.Read를 통해 st_table 객체 생성</para> /// <para> 7. st_table객체에 변경된 값 할당</para> /// <para> 8. 매장 코드를 기준 queryUpdate & crud.Update 를 진행</para> /// <para> 9. if queryResult >0</para> /// <para> 10. buttonEnableToggle</para> /// <para> 11. readonlyTextBoxAndDatetimePicker</para> /// <para> 12. 성공 메시지박스</para> /// <para> 13. readStoreTablePattern</para> /// <para> 14. 버튼 텍스트 "변경"으로 변경</para> /// <para> 15. 메시지 박스 "실패"</para> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void buttonUpdate_Click(object sender, EventArgs e) { if (MessageBox.Show("변경하시겟습니까?", "변경", MessageBoxButtons.YesNo) == DialogResult.Yes && st_code != null) { if (buttonUpdate.Text == "변경") { // 검색시 항목 변경 가능 처리 readonlyTextBoxAndDatetimePicker(false); buttonEnableToggle(true, buttonForCreateAndUpdateArray); buttonUpdate.Text = "적용"; return; } string queryUpdate = sqlQuery.Update_Set_("st_table", new St_table(), "St_code"); string queryRead = sqlQuery.SelectAllFrom_Where_("st_table", new string[] { "st_code" }, new string[] { st_code }); St_table storeRead = crud.Read_MySql(queryRead, new St_table()); St_table store = new St_table { St_code = storeRead.St_code, St_date = storeRead.St_date, St_name = textBoxStroeName.Text, St_manager = textBoxAdminName.Text, St_zip = textBoxAddressZip.Text, St_addr1 = textBoxAddress.Text, St_addr2 = textBoxAddress2.Text, St_info1 = textBoxContractInformation.Text, St_info2 = textBoxBasicInformation.Text, St_contractdate = dateTimePickerContractDate.Value, St_contractdate2 = dateTimePickerContractDate2.Value, St_ele_date = dateTimePickerElectricityExpense.Value, St_maint_date = dateTimePickerManagementExpense.Value, St_sudo_date = dateTimePickerWaterExpense.Value }; int result = crud.Update_MySql(queryUpdate, store); if (result > 0) { buttonEnableToggle(false, buttonForCreateAndUpdateArray); readonlyTextBoxAndDatetimePicker(true); MessageBox.Show("성공"); readStoreTablePattern(); buttonUpdate.Text = "변경"; return; } MessageBox.Show("실패"); } }
//추가 처리 필요 private void buttonAddStore_Click(object sender, EventArgs e) { if (MessageBox.Show("등록하시겟습니까?", "등록", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (buttonAddStore.Text == "등록") { buttonEnableToggle(true, buttonForCreateAndUpdateArray); dataGridViewEmployee.DataSource = null; dataGridViewExpense.DataSource = null; readonlyTextBoxAndDatetimePicker(false); clearDatetimePickerAndTextBox(); buttonAddStore.Text = "적용"; return; } if (buttonAddStore.Text == "적용") { string queryReadMaxStcode = sqlQuery.selectAllFrom_Where_Select_MINMAX_From_("st_table", "max", "st_code"); St_table store = crud.Read_MySql(queryReadMaxStcode, new St_table()); store.St_code = (Convert.ToInt32(store.St_code) + 1).ToString(); store.St_name = textBoxStroeName.Text; store.St_manager = textBoxAdminName.Text; store.St_zip = textBoxAddressZip.Text; store.St_addr1 = textBoxAddress.Text; store.St_addr2 = textBoxAddress2.Text; store.St_info1 = textBoxContractInformation.Text; store.St_info2 = textBoxBasicInformation.Text; store.St_contractdate = dateTimePickerContractDate.Value; store.St_contractdate2 = dateTimePickerContractDate2.Value; store.St_ele_date = dateTimePickerElectricityExpense.Value; store.St_maint_date = dateTimePickerManagementExpense.Value; store.St_sudo_date = dateTimePickerWaterExpense.Value; store.St_date = DateTime.Now; string queryCreate = sqlQuery.InsertInto__Values_(store); int result = crud.Create_MySql(queryCreate, store); if (result > 0) { buttonEnableToggle(false, buttonForCreateAndUpdateArray); MessageBox.Show("성공"); readStoreTablePattern(); buttonAddStore.Text = "등록"; readonlyTextBoxAndDatetimePicker(true); clearDatetimePickerAndTextBox(); return; } MessageBox.Show("실패"); clearDatetimePickerAndTextBox(); } } }
/// <summary> /// <para>종류 : 버튼클릭 이벤트</para> /// <para>기능 : 매장 삭제</para> /// <para>진입 : 1. 삭제 체크된 매장List.Count() > 0</para> /// <para>분기 : 1. 메시지 박스 Yes클릭</para> /// <para> 2. queryResult > 0</para> /// <para>로직 : 1. 체크된 매장수 0보다 클 경우 진입</para> /// <para> 2. 메시지 박스에 삭제 체크된 매장이름을 띄우며 재확인 요청</para> /// <para> 3. 승인 시 매장List를 돌며 반복 삭제 진행</para> /// <para> 4. 해당 매장 이름을 이용하여 queryRead와 queryDelete를 만들고 Crud.Read를 통해 조회, 그결과를 바탕으로 Crud.Delete를 진행</para> /// <para> 5. Crud.Delete반환 결과에 따라 성공시 매장이름 기록, 실패시 이전에 성공한 매장이름을 보여주며 실패 메시지박스 출력. 그 후 readStoreTablePattern메서드를 활용하여 테이블 새로고침 후 return</para> /// <para> 6. 실패가 없을시 삭제에 성공한 모든 매장이름을 메시지 박스로 출력</para> /// <para> 7. readStoreTablePattern메서드를 활용하여 테이블 새로고침</para> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void buttonDeleteStore_Click(object sender, EventArgs e) { //체크 박스 추가 //체크 된 사용자 이름 list에 담기 //list를 돌면서 패턴 실행 //패턴 //list[i]를 통해 st_code를 얻음 //query를 생성하고 crud,delete를 통해 삭제처리 //결과에 따라 성공/실패 분기 // string checkedNames = ""; if (setCheckedStoreName.Count > 0) { //삭제 체크된 이름들 출력 foreach (var v in setCheckedStoreName) { checkedNames += v + " "; } if (MessageBox.Show(checkedNames + "선택", "주의", MessageBoxButtons.YesNo) == DialogResult.Yes) { string resultName = ""; foreach (var v in setCheckedStoreName) { string queryRead = sqlQuery.SelectAllFrom_Where_("st_table", new string[] { "st_name" }, new string[] { v }); St_table store = crud.Read_MySql(queryRead, new St_table()); string queryDelete = sqlQuery.deleteFrom_Where_("st_table", "st_code"); int queryResult = crud.Delete_MySql(queryDelete, store); if (queryResult > 0) { resultName += v + " "; continue; } MessageBox.Show($"({ resultName})삭제 성공, ({v})삭제 실패"); //매장목록 새로고침 readStoreTablePattern(); return; } MessageBox.Show(resultName + "삭제 성공"); //매장목록 새로고침 readStoreTablePattern(); } } }
/// <summary> /// <para>기능 : 실적관리 페이지로 이동</para> /// <para>진입 : </para> /// <para>분기 : </para> /// <para>로직 : 1. 매장 코드를 바탕으로 queryRead&Crud.Read 로 st_table 객체 얻음</para> /// <para> 2. st_table.st_name을 상단 중앙 라벨에 할당하고 보이도록 설정</para> /// <para> 3. 실적패널 보이고 다른패널 안보이게</para> /// <para> 4. buttonColorChange</para> /// <para> 5. 유저컨트롤2(실적관리) 실적관리 콘트롤에 더함</para> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void buttonResultManegeTemp_Click(object sender, EventArgs e) { string queryReadSt_table = sqlQuery.SelectAllFrom_Where_("st_table", new string[] { "st_code" }, new string[] { employee.st_code }); St_table st_table = crud.Read_MySql(queryReadSt_table, new St_table()); //매장명 세팅 및 보이기 labelStroeNameVisibleAfterClickResult.Text = st_table.St_name; labelStroeNameVisibleAfterClickResult.Visible = true; panelResultManage.Visible = true; panelResultManage.BringToFront(); panelEmployeeManage.Visible = false; buttonColorChange(sender); UserControl2 userControl2 = new UserControl2(employee, sqlQuery, crud, tempFuncForWinform); userControl2.Dock = DockStyle.Fill; panelResultManage.Controls.Clear(); panelResultManage.Controls.Add(userControl2); }
private void dataGridViewStore_CellClick(object sender, DataGridViewCellEventArgs e) { resetToDefault(); if (e.RowIndex >= 0 && e.ColumnIndex >= 1) { // 검색시 항목 변경 불가 처리 readonlyTextBoxAndDatetimePicker(true); buttonEnableToggle(false, buttonForCreateAndUpdateArray); // 셀 클릭시 해당 row의 매장명 저장 string selectedStoreName = ((sender as DataGridView).Rows[e.RowIndex].Cells["매장명"].Value.ToString()); // 해당 매장명 row 클릭시 해당 매장명을 통해 데이터 조회 후 오른쪽에 데이터를 뿌림 string queryReadStoreSelected = sqlQuery.SelectAllFrom_Where_("st_table", new string[] { "st_name" }, new string[] { selectedStoreName }); St_table store = crud.Read_MySql(queryReadStoreSelected, new St_table()); st_code = store.St_code; textBoxStroeName.Text = store.St_name; textBoxAdminName.Text = store.St_manager; textBoxAddressZip.Text = store.St_zip; textBoxAddress.Text = store.St_addr1; textBoxAddress2.Text = store.St_addr2; textBoxContractInformation.Text = store.St_info1; textBoxBasicInformation.Text = store.St_info2; dateTimePickerContractDate.Value = store.St_contractdate; dateTimePickerContractDate2.Value = store.St_contractdate2; dateTimePickerManagementExpense.Value = store.St_maint_date; dateTimePickerElectricityExpense.Value = store.St_ele_date; dateTimePickerWaterExpense.Value = store.St_sudo_date; // Panel_Main_Third datatable할당 string columnResult = "MONTH(st_exp_date) AS MONTH, SUM(ST_EXP_BASIC) AS ST_EXP_BASIC, SUM(ST_EXP_COUPON) AS ST_EXP_COUPON, SUM(ST_EXP_AD) AS ST_EXP_AD, SUM(ST_EXP_ACCE) AS ST_EXP_ACCE, SUM(ST_EXP_QUICK) AS ST_EXP_QUICK, SUM(ST_EXP_CONS) AS ST_EXP_CONS, SUM(ST_EXP_ARTI) AS ST_EXP_ARTI"; string queryTemp = sqlQuery.select_Sum__From_Where_GroupBy_(columnResult, "st_expense", "st_code", st_code, "Month(st_exp_date)"); //string queryReadExpense = sqlQuery.select_From_Where("st_expense", new string[] { "st_exp_basic", "st_exp_coupon", "st_exp_ad", "st_exp_acce", "st_exp_quick", "st_exp_cons", "st_exp_arti" }, "st_code", new string[] { store.St_code }); DataSet dataSetExpense = crud.ReadToGrid_MySql(queryTemp); dataSetExpense.Tables[0].Columns["MONTH"].ColumnName = "월"; dataSetExpense.Tables[0].Columns["st_exp_basic"].ColumnName = "일반"; dataSetExpense.Tables[0].Columns["st_exp_coupon"].ColumnName = "쿠폰"; dataSetExpense.Tables[0].Columns["st_exp_ad"].ColumnName = "광고비"; dataSetExpense.Tables[0].Columns["st_exp_acce"].ColumnName = "액세사리"; dataSetExpense.Tables[0].Columns["st_exp_quick"].ColumnName = "퀵"; dataSetExpense.Tables[0].Columns["st_exp_cons"].ColumnName = "택배"; dataSetExpense.Tables[0].Columns["st_exp_arti"].ColumnName = "용품판매"; tempFuncForWinform.setDataGridView(dataSetExpense, dataGridViewExpense); // Panel_Main_Forth datatable 할당 string queryReadEmployee = sqlQuery.select_From_Where("st_employee", new string[] { "st_emp_level", "st_emp_member", "st_emp_state", "st_emp_time", "st_emp_year", "st_emp_etc" }, "st_code", new string[] { store.St_code }); DataSet dataSetEmployee = crud.ReadToGrid_MySql(queryReadEmployee); dataSetEmployee.Tables[0].Columns["st_emp_level"].ColumnName = "직급"; dataSetEmployee.Tables[0].Columns["st_emp_member"].ColumnName = "이름"; dataSetEmployee.Tables[0].Columns["st_emp_state"].ColumnName = "상태"; dataSetEmployee.Tables[0].Columns["st_emp_time"].ColumnName = "근무시간"; dataSetEmployee.Tables[0].Columns["st_emp_year"].ColumnName = "년차"; dataSetEmployee.Tables[0].Columns["st_emp_etc"].ColumnName = "비고"; dataGridViewEmployee.Columns.Clear(); DataColumn dataColumn = new DataColumn(); dataColumn.ColumnName = "No"; dataSetEmployee.Tables[0].Columns.Add(dataColumn); dataColumn.SetOrdinal(0); tempFuncForWinform.setDataGridView(dataSetEmployee, dataGridViewEmployee); for (int i = 0; i < dataSetEmployee.Tables[0].Rows.Count; i++) { dataGridViewEmployee.Rows[i].Cells[0].Value = i + 1; } ; dataColumn.ReadOnly = true; //Panel_Select_Employee 할당 string queryReadEmployeePanel = sqlQuery.select_From_Where("st_employee", new string[] { "st_emp_level", "st_emp_member" }, "st_code", new string[] { store.St_code }); DataSet dataSetEmployeePanel = crud.ReadToGrid_MySql(queryReadEmployeePanel); dataSetEmployeePanel.Tables[0].Columns["st_emp_level"].ColumnName = "직급"; dataSetEmployeePanel.Tables[0].Columns["st_emp_member"].ColumnName = "이름"; labelEmployeeCount.Text = $"매장직원 : {dataSetEmployee.Tables[0].Rows.Count} 명"; dataGridViewSelectEmployee.Columns.Clear(); tempFuncForWinform.setDataGridView(dataSetEmployeePanel, dataGridViewSelectEmployee); //관리비 남은 날짜 표시 //과거 if (DateTime.Now.Month == dateTimePickerManagementExpense.Value.Month) { if (DateTime.Now.Day == dateTimePickerManagementExpense.Value.Day) { labelManagementCostDateLeft.Text = "0"; return; } if (DateTime.Now.Day < dateTimePickerManagementExpense.Value.Day) { labelManagementCostDateLeft.Text = (dateTimePickerManagementExpense.Value.Day - DateTime.Now.Day).ToString(); return; } labelManagementCostDateLeft.Text = (DateTime.DaysInMonth(dateTimePickerManagementExpense.Value.Year, dateTimePickerManagementExpense.Value.Month) - DateTime.Now.Day + dateTimePickerManagementExpense.Value.Day).ToString(); return; } labelManagementCostDateLeft.Text = (DateTime.DaysInMonth(dateTimePickerManagementExpense.Value.Year, dateTimePickerManagementExpense.Value.Month) - DateTime.Now.Day - 1 + dateTimePickerManagementExpense.Value.Day).ToString(); } }
/// <summary> /// <para>기능 : 실적 상세 테이블 생성</para> /// <para>진입 : </para> /// <para>분기 : 1. needQuery == true</para> /// <para>로직 : 1. needQuery == true</para> /// <para>로직 : ----2. 선택된 개통번호 selectedUser_phone_number에 저장</para> /// <para>로직 : ----3. sqlQuery.SelectAllFrom_Where_와 Crud.Read를 사용하여 st_emp_result를 얻음</para> /// <para>로직 : ----4. sqlQuery.SelectAllFrom_Where_와 Crud.Read를 사용하여 user_t를 얻음</para> /// <para>로직 : ----5. sqlQuery.SelectAllFrom_Where_와 Crud.Read를 사용하여 st_table을 얻음</para> /// <para>로직 : ----6. 각 항목별 데이터 할당</para> /// <para>로직 : ----7. 각 항목 Readonly</para> /// <para>로직 : ----return</para> /// <para>로직 : 8. 빈 DataSet에 빈 DataTable 추가</para> /// <para>로직 : 9. tempFuncForWinform.setDataGridView</para> /// <para>로직 : 10. 기타 테이블 설정 적용</para> /// </summary> /// <param name="needQuery"></param> /// <param name="e"></param> public void makeDetailTable(bool needQuery, DataGridViewCellEventArgs e) { //true 시 만들어진 테이블에 데이터 할당, false시 빈 테이블 생성 if (needQuery) { string userName = dataGridViewSelectDate.Rows[e.RowIndex].Cells["가입자명"].Value.ToString(); string storeName = dataGridViewSelectDate.Rows[e.RowIndex].Cells["매장"].Value.ToString(); string salerName = dataGridViewSelectDate.Rows[e.RowIndex].Cells["판매자"].Value.ToString(); selectedUser_phone_number = dataGridViewSelectDate.Rows[e.RowIndex].Cells["개통번호"].Value.ToString(); string querySelectResult = sqlQuery.SelectAllFrom_Where_("st_emp_result", new string[] { "user_open_number" }, new string[] { selectedUser_phone_number }); St_emp_result st_emp_result = crud.Read_MySql(querySelectResult, new St_emp_result()); string querySelectUser = sqlQuery.SelectAllFrom_Where_("user_t", new string[] { "user_code" }, new string[] { st_emp_result.user_code }); User_t user_t = crud.Read_MySql(querySelectUser, new User_t()); string querySelectStore = sqlQuery.SelectAllFrom_Where_("st_table", new string[] { "st_code" }, new string[] { employee.st_code }); St_table st_table = crud.Read_MySql(querySelectStore, new St_table()); //개통일 dataGridViewSelectionDateDetail[1, 0].Value = st_emp_result.result_open_date.ToString("yyyy-MM-dd"); //가입자명 dataGridViewSelectionDateDetail[1, 1].Value = userName; //은행 user_bank user_t dataGridViewSelectionDateDetail[1, 2].Value = user_t.user_bank; //모델명 dataGridViewSelectionDateDetail[1, 3].Value = st_emp_result.result_ph_m; DataGridViewComboBoxCell comboPreviousCom = new DataGridViewComboBoxCell(); comboPreviousCom.Items.Add("1"); comboPreviousCom.Items.Add("SKT"); comboPreviousCom.Items.Add("KT"); comboPreviousCom.Items.Add("LG"); dataGridViewSelectionDateDetail[1, 4] = comboPreviousCom; //이전통신사 combo comboPreviousCom.Value = st_emp_result.user_previous_com; //공시지원금 dataGridViewSelectionDateDetail[1, 5].Value = st_emp_result.subsidy_price; //리베이트/NET dataGridViewSelectionDateDetail[1, 6].Value = st_emp_result.net_rebate; //보험가입유무 dataGridViewSelectionDateDetail[1, 7].Value = st_emp_result.insurance_YN; //송금금액 dataGridViewSelectionDateDetail[1, 8].Value = st_emp_result.send_price; //현금파냄 금액 dataGridViewSelectionDateDetail[1, 9].Value = st_emp_result.cash_sale_price; //모바일 개통시간 dataGridViewSelectionDateDetail[3, 0].Value = st_emp_result.result_open_m_date.ToString("yyyy-MM-dd"); //가입자 생년 user_birth user_t dataGridViewSelectionDateDetail[3, 1].Value = user_t.user_birth; //계좌번호 user_bank_number user_t dataGridViewSelectionDateDetail[3, 2].Value = user_t.user_bank_number; //일련번호 dataGridViewSelectionDateDetail[3, 3].Value = st_emp_result.result_serial_number; //현/카/할 dataGridViewSelectionDateDetail[3, 4].Value = st_emp_result.user_pur_type; //할부원금 dataGridViewSelectionDateDetail[3, 5].Value = st_emp_result.installment_price; DataGridViewComboBoxCell comboPricePlan = new DataGridViewComboBoxCell(); comboPricePlan.Items.Add("1"); comboPricePlan.Items.Add("1만원"); comboPricePlan.Items.Add("2만원"); comboPricePlan.Items.Add("3만원"); dataGridViewSelectionDateDetail[3, 6] = comboPricePlan; //요금제 combo comboPricePlan.Value = st_emp_result.price_plan; //유심후납 dataGridViewSelectionDateDetail[3, 7].Value = st_emp_result.late_payment_usim; //예정일 dataGridViewSelectionDateDetail[3, 8].Value = st_emp_result.due_date.ToString("yyyy-MM-dd"); //카드판매금액 dataGridViewSelectionDateDetail[3, 9].Value = st_emp_result.card_sale_price; DataGridViewComboBoxCell comboAgent = new DataGridViewComboBoxCell(); comboAgent.Items.Add("1"); comboAgent.Items.Add("스포"); comboAgent.Items.Add("모다"); comboAgent.Items.Add("아이원"); dataGridViewSelectionDateDetail[5, 0] = comboAgent; //대리점 combo comboAgent.Value = st_emp_result.agent; //요금제변경일 user_plan_date user_t dataGridViewSelectionDateDetail[5, 1].Value = user_t.user_plan_date; //예금주 bank_userName user_t dataGridViewSelectionDateDetail[5, 2].Value = user_t.bank_userName; //고객명? 없음 dataGridViewSelectionDateDetail[5, 3].Value = null; //출고가 dataGridViewSelectionDateDetail[5, 4].Value = st_emp_result.release_price; //선납금 dataGridViewSelectionDateDetail[5, 5].Value = st_emp_result.prepayments; //빈칸 //정산금 dataGridViewSelectionDateDetail[5, 7].Value = st_emp_result.user_calculate; //현금 dataGridViewSelectionDateDetail[5, 8].Value = st_emp_result.cash; //기타차감 dataGridViewSelectionDateDetail[5, 9].Value = st_emp_result.etc_offset; DataGridViewComboBoxCell comboStoreName = new DataGridViewComboBoxCell(); comboStoreName.Items.Add("서울 강서"); comboStoreName.Items.Add("원구 행주"); comboStoreName.Items.Add("서울 마곡"); comboStoreName.Items.Add("김포 공항"); comboStoreName.Items.Add(st_table.St_name); dataGridViewSelectionDateDetail[7, 0] = comboStoreName; //매장 combo comboStoreName.Value = storeName; //빈칸 //CIA? 없음 dataGridViewSelectionDateDetail[7, 2].Value = null; //개통번호 dataGridViewSelectionDateDetail[7, 3].Value = st_emp_result.user_open_number; //빈칸 //빈칸 //정책추가 dataGridViewSelectionDateDetail[7, 6].Value = st_emp_result.add_policy; //유심선납 dataGridViewSelectionDateDetail[7, 7].Value = st_emp_result.prepayments_usim; //카드 dataGridViewSelectionDateDetail[7, 8].Value = st_emp_result.card; //세후금액 dataGridViewSelectionDateDetail[7, 9].Value = st_emp_result.after_tax_price; //판매자 dataGridViewSelectionDateDetail[9, 0].Value = salerName; //빈칸 //비고 dataGridViewSelectionDateDetail[9, 2].Value = st_emp_result.note; //약정유형 dataGridViewSelectionDateDetail[9, 3].Value = st_emp_result.user_agree_type; //빈칸 //MNP수수료 dataGridViewSelectionDateDetail[9, 5].Value = st_emp_result.mnp_commission; //구두추가 dataGridViewSelectionDateDetail[9, 6].Value = st_emp_result.sound_policy; //부가서비스추가/차감 dataGridViewSelectionDateDetail[9, 7].Value = st_emp_result.addition_service; //마진 dataGridViewSelectionDateDetail[9, 9].Value = st_emp_result.profit_margin; dataGridViewSelectionDateDetail.ReadOnly = true; return; } DataSet dataSet = new DataSet(); dataSet.Tables.Add(new DataTable()); tempFuncForWinform.setDataGridView(dataSet, dataGridViewSelectionDateDetail); dataGridViewSelectionDateDetail.DataSource = null; dataGridViewSelectionDateDetail.ColumnHeadersVisible = false; dataGridViewInit(); dataGridViewSelectionDateDetail.ClearSelection(); dataGridViewSelectionDateDetail.SelectionMode = DataGridViewSelectionMode.CellSelect; dataGridViewSelectionDateDetail.ReadOnly = true; }
/// <summary> /// <para>기능 : 실적 상세 테이블 클리어 </para> /// <para>진입 : </para> /// <para>분기 : </para> /// <para>로직 : 1. sqlquery.SelectAllFrom_Where_과 Crud.Read를 통해 st_table 생성</para> /// <para>로직 : 2. st_table을 통해 combobox보완</para> /// <para>로직 : 3. ""를 통해 입력컨트롤 클리어</para> /// <para>로직 : 5. 테이블 Readonly = false 설정</para> /// <para>로직 : 4. label Readonly 설정</para> /// <para>로직 : 6. if needReadOnly == true</para> /// <para>로직 : ----7. 테이블 readonly = true 설정</para> /// </summary> /// <param name="needReadOnly"></param> //false시 readonly 추가 public void clearSelectedDetail(bool needReadOnly) { string querySelectStore = sqlQuery.SelectAllFrom_Where_("st_table", new string[] { "st_code" }, new string[] { employee.st_code }); St_table st_table = crud.Read_MySql(querySelectStore, new St_table()); //개통일 dataGridViewSelectionDateDetail[1, 0].Value = ""; //가입자명 dataGridViewSelectionDateDetail[1, 1].Value = ""; //은행 user_bank user_t dataGridViewSelectionDateDetail[1, 2].Value = ""; //모델명 dataGridViewSelectionDateDetail[1, 3].Value = ""; DataGridViewComboBoxCell comboPreviousCom = new DataGridViewComboBoxCell(); comboPreviousCom.Items.Add("1"); comboPreviousCom.Items.Add("SKT"); comboPreviousCom.Items.Add("KT"); comboPreviousCom.Items.Add("LG"); dataGridViewSelectionDateDetail[1, 4] = comboPreviousCom; //이전통신사 combo comboPreviousCom.Value = "SKT"; //공시지원금 dataGridViewSelectionDateDetail[1, 5].Value = ""; //리베이트/NET dataGridViewSelectionDateDetail[1, 6].Value = ""; //보험가입유무 dataGridViewSelectionDateDetail[1, 7].Value = ""; //송금금액 dataGridViewSelectionDateDetail[1, 8].Value = ""; //현금파냄 금액 dataGridViewSelectionDateDetail[1, 9].Value = ""; //모바일 개통시간 dataGridViewSelectionDateDetail[3, 0].Value = ""; //가입자 생년 user_birth user_t dataGridViewSelectionDateDetail[3, 1].Value = ""; //계좌번호 user_bank_number user_t dataGridViewSelectionDateDetail[3, 2].Value = ""; //일련번호 dataGridViewSelectionDateDetail[3, 3].Value = ""; //현/카/할 dataGridViewSelectionDateDetail[3, 4].Value = ""; //할부원금 dataGridViewSelectionDateDetail[3, 5].Value = ""; DataGridViewComboBoxCell comboPricePlan = new DataGridViewComboBoxCell(); comboPricePlan.Items.Add("1"); comboPricePlan.Items.Add("1만원"); comboPricePlan.Items.Add("2만원"); comboPricePlan.Items.Add("3만원"); dataGridViewSelectionDateDetail[3, 6] = comboPricePlan; //요금제 combo comboPricePlan.Value = "1만원"; //유심후납 dataGridViewSelectionDateDetail[3, 7].Value = ""; //예정일 dataGridViewSelectionDateDetail[3, 8].Value = ""; //카드판매금액 dataGridViewSelectionDateDetail[3, 9].Value = ""; DataGridViewComboBoxCell comboAgent = new DataGridViewComboBoxCell(); comboAgent.Items.Add("1"); comboAgent.Items.Add("스포"); comboAgent.Items.Add("모다"); comboAgent.Items.Add("아이원"); dataGridViewSelectionDateDetail[5, 0] = comboAgent; //대리점 combo comboAgent.Value = "스포"; //요금제변경일 user_plan_date user_t dataGridViewSelectionDateDetail[5, 1].Value = ""; //예금주 bank_userName user_t dataGridViewSelectionDateDetail[5, 2].Value = ""; //고객명? 없음 dataGridViewSelectionDateDetail[5, 3].Value = null; //출고가 dataGridViewSelectionDateDetail[5, 4].Value = ""; //선납금 dataGridViewSelectionDateDetail[5, 5].Value = ""; //빈칸 //정산금 dataGridViewSelectionDateDetail[5, 7].Value = ""; //현금 dataGridViewSelectionDateDetail[5, 8].Value = ""; //기타차감 dataGridViewSelectionDateDetail[5, 9].Value = ""; DataGridViewComboBoxCell comboStoreName = new DataGridViewComboBoxCell(); comboStoreName.Items.Add("서울 강서"); comboStoreName.Items.Add("원구 행주"); comboStoreName.Items.Add("서울 마곡"); comboStoreName.Items.Add("김포 공항"); comboStoreName.Items.Add(st_table.St_name); dataGridViewSelectionDateDetail[7, 0] = comboStoreName; //매장 combo comboStoreName.Value = st_table.St_name; //빈칸 //CIA? 없음 dataGridViewSelectionDateDetail[7, 2].Value = null; //개통번호 dataGridViewSelectionDateDetail[7, 3].Value = ""; //빈칸 //빈칸 //정책추가 dataGridViewSelectionDateDetail[7, 6].Value = ""; //유심선납 dataGridViewSelectionDateDetail[7, 7].Value = ""; //카드 dataGridViewSelectionDateDetail[7, 8].Value = ""; //세후금액 dataGridViewSelectionDateDetail[7, 9].Value = ""; //판매자 dataGridViewSelectionDateDetail[9, 0].Value = ""; //빈칸 //비고 dataGridViewSelectionDateDetail[9, 2].Value = ""; //약정유형 dataGridViewSelectionDateDetail[9, 3].Value = ""; //빈칸 //MNP수수료 dataGridViewSelectionDateDetail[9, 5].Value = ""; //구두추가 dataGridViewSelectionDateDetail[9, 6].Value = ""; //부가서비스추가/차감 dataGridViewSelectionDateDetail[9, 7].Value = ""; //마진 dataGridViewSelectionDateDetail[9, 9].Value = ""; dataGridViewSelectionDateDetail.ReadOnly = false; //readonly 설정 for (int i = 0; i < cellLabelArray.Length; i++) { dataGridViewSelectionDateDetail[2 * Convert.ToInt32(i / 10), i - 10 * Convert.ToInt32(i / 10)].ReadOnly = true; } if (needReadOnly) { dataGridViewSelectionDateDetail.ReadOnly = true; } }