// ---------------------------------------------------------- // private void ctr_cbx_open_api_type_SelectedIndexChanged(object sender, EventArgs e) { String sel_delivery_open_api_type = KnDevexpressFunc.ComboBoxGetSelectedItemKey(ctr_cbx_open_api_type); m_store_api_info = new ObjConfigStoreApiInfo(); m_store_api_info.loadFromDevice(sel_delivery_open_api_type); m_store_reg_info = new ObjConfigStoreApiRegInfo(); m_store_reg_info.loadFromDevice(sel_delivery_open_api_type); setDlgObjectDataToControls(); }
private void setGridViewFocusedRowObject() { object order_num = gridView.GetFocusedRowCellValue("store_num"); if (null != order_num) { m_sel_obj = getSelObject(order_num.ToString()); if (null != m_sel_obj) { this.DialogResult = DialogResult.OK; this.Close(); } } }
public void loadReportControlData() { // set container ArrayList store_list = (ArrayList)m_dlg_obj; // check data list if (null == store_list) { return; } // check view datasource DataTable view_table = getGridViewDataSource(); if (null == view_table) { return; } // reset m_dic_store_info.Clear(); // set for (int i = 0; i < store_list.Count; i++) { ObjConfigStoreApiInfo sel_obj = (ObjConfigStoreApiInfo)store_list[i]; if (null != sel_obj) { DataRow sel_row = view_table.NewRow(); if (null != sel_row) { ObjConfigStoreApiInfo.setTableData(ref sel_row, ref sel_obj); // obj -> data row view_table.Rows.Add(sel_row); // 관리목록에 넣기 m_dic_store_info.Add(sel_obj.m_store_num, sel_obj); } } } // refresh gridView.RefreshData(); }
// ---------------------------------------------------------- // private DataTable getGridViewDataSource() { DataTable dt = (DataTable)gridControl.DataSource; if (null == dt) { dt = new DataTable(); if (null != dt) { ObjConfigStoreApiInfo.makeTableSchema(ref dt); // set table columns with ObjOrder class gridControl.DataSource = dt; } else { Debug.Assert(false); } } return(dt); }
private void ctr_btn_req_store_find_Click(object sender, EventArgs e) { String req_store_pno = ctr_tbx_store_pno.Text.Trim().Replace("-", ""); if (0 >= req_store_pno.Length) { FormPopupNotify.Show(this.Owner, "먼저 사업자번호를 입력 해 주십시오.", "알림"); return; } // 이미매핑되어 있는지 확인 if (0 < m_store_reg_info.m_store_id.Length) { if (DialogResult.Yes != MessageBox.Show(this.Owner, "이미 상점이 매핑되어 있습니다. \r다시 매핑하시겠습니까?", "확인", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { return; } } // 가맹정보 확인 ObjConfigStoreApiInfo sel_store_info = null; ArrayList res_store_list = requestStoreApiInfo(req_store_pno); if (null != res_store_list) { if (1 == res_store_list.Count) { sel_store_info = (ObjConfigStoreApiInfo)res_store_list[0]; } else if (1 < res_store_list.Count) { FormStoreInfoSelecter sel_dlg = new FormStoreInfoSelecter(this, res_store_list); if (DialogResult.OK == sel_dlg.ShowDialog()) { sel_store_info = sel_dlg.m_sel_obj; } } } // 받은 값 확인 if (null == sel_store_info || 0 == sel_store_info.m_store_num.Length) { FormPopupNotify.Show(this.Owner, "선택된 상점 코드가 없습니다. 확인 해 주십시오.", "알림"); return; } if (0 < sel_store_info.m_store_num.Length) { m_store_api_info.setObj(sel_store_info); // 정상적으로 받았으면 교체 m_store_api_info.saveToDevice(); } // 가맹코드( 매핑 ) 할 값 확인 - 로그인키를 사용한다. String req_store_id = Kons.ShopCallpass.AppMain.AppCore.Instance.getLoginUserLoginKey(); // 가맹코드 if (0 > req_store_id.Length) { FormPopupNotify.Show(this.Owner, "상점 매핑을 위한 접속 정보를 가져올 수 없습니다.", "알림"); return; } // 매핑요청 ObjConfigStoreApiRegInfo res_store_reg = requestShopRegInfo(sel_store_info.m_store_num, sel_store_info.m_store_pno, req_store_id); if (null == res_store_reg) { FormPopupNotify.Show(this.Owner, "상점 매핑코드를 가지고 올수 없습니다.", "알림"); return; } if (0 == res_store_reg.m_ret_cd && 0 < res_store_reg.m_store_id.Length) { // 정상적으로 받았으면 교체 m_store_reg_info.setObj(res_store_reg); m_store_reg_info.saveToDevice(); // 마지막 매핑값으로 저장 if (null != m_last_request_config) { m_last_request_config.m_delivery_company_type = KnDevexpressFunc.ComboBoxGetSelectedItemKey(ctr_cbx_open_api_type); m_last_request_config.saveToDevice(); } // 알림 FormPopupNotify.Show(this.Owner, "상점 매핑에 성공하였습니다. 배달요청을 \n이용하실 수 있습니다.", "알림"); } else if (0 < res_store_reg.m_ret_msg.Length) { FormPopupNotify.Show(this.Owner, res_store_reg.m_ret_msg, "알림"); return; } else { switch (res_store_reg.m_ret_cd) { case 1: FormPopupNotify.Show(this.Owner, "인증키가 잘못되었습니다. ( 인증키 오류 )", "알림"); return; case 2: FormPopupNotify.Show(this.Owner, "상점코드가 중복등록 되었습니다. ( 상점 코드 중복 )", "알림"); return; } } // set control setDlgObjectDataToControls(); }