Esempio n. 1
0
        private OpenApiBase getSelOpenApiManager()
        {
            int sel_delivery_open_api_type = KnUtil.formatInt32(KnDevexpressFunc.ComboBoxGetSelectedItemKey(ctr_cbx_open_api_type));

            if (-1 != sel_delivery_open_api_type)
            {
                return(OpenApiBase.getOpenApiManager((OpenApiBase.OPEN_API_TYPE)sel_delivery_open_api_type));
            }
            return(null);
        }
Esempio n. 2
0
        // ----------------------------------------------------------
        //
        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();
        }
Esempio n. 3
0
 // control -> object
 override protected void setDlgControlDataToObjects()
 {
     for (int i = 0; i < m_controls_config_unit_list.Length; i++)
     {
         Controls_ConfigUnit sel_ctr = m_controls_config_unit_list[i];
         if (null != sel_ctr)
         {
             ObjConfigPrintOutput sel_obj = m_config_list.getObject(i);
             if (null != sel_ctr)
             {
                 sel_obj.m_is_use             = (sel_ctr.chk_is_use.Checked ? 1 : 0);
                 sel_obj.m_print_connect_type = KnDevexpressFunc.ComboBoxGetSelectedItemKey(sel_ctr.cbx_print_connect_type);
                 sel_obj.m_print_port_num     = KnDevexpressFunc.ComboBoxGetSelectedItemKey(sel_ctr.cbx_print_port_num);
                 sel_obj.m_print_port_baud    = KnUtil.parseInt32(KnDevexpressFunc.ComboBoxGetSelectedItemKey(sel_ctr.cbx_print_port_baud));
             }
             else
             {
                 sel_obj.m_is_use = 0;
             }
         }
     }
 }
Esempio n. 4
0
        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();
        }