Exemplo n.º 1
0
        public string searchLogBook(string jsonReq)
        {
            string strRes = string.Empty;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);

                ServerUrl = Constants.SERVER_URL + "/service/merchant/tfm/searchLogBook";

                JObject jsonRes = null;

                Constants.LOGGER_DOC.Info("-->" + jsonReq.ToString());
                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);
                Constants.LOGGER_DOC.Info("<--" + strRes);

                jsonRes = JObject.Parse(strRes);
                strRes  = jsonRes["list"].ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }

            return(strRes);
        }
Exemplo n.º 2
0
        public bool checkNetworkStatus()
        {
            string strRes = "";

            bool retValue = false;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);

                ServerUrl = Constants.SERVER_URL + "/service/merchant/tfm/checkNetworkStatus";

                JObject jsonReq = new JObject();
                JObject jsonRes = null;

                jsonReq.Add("userid", Constants.USER_ID);

                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);

                jsonRes = JObject.Parse(strRes);

                if (jsonRes["code"] != null && jsonRes["code"].ToString().Equals("1"))
                {
                    retValue = true;
                }
            }
            catch (Exception ex)
            {
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }

            return(retValue);
        }
Exemplo n.º 3
0
        public int searchLogBookCount(string jsonReq)
        {
            int total_cnt = 0;

            string strRes = string.Empty;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);

                ServerUrl = Constants.SERVER_URL + "/service/merchant/tfm/searchLogBookCount";

                JObject jsonRes = null;

                Constants.LOGGER_DOC.Info("-->" + jsonReq.ToString());
                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);
                Constants.LOGGER_DOC.Info("<--" + strRes);

                jsonRes = JObject.Parse(strRes);
                if (jsonRes["code"].ToString().Equals("1"))
                {
                    total_cnt = int.Parse(jsonRes["total_cnt"].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }

            return(total_cnt);
        }
Exemplo n.º 4
0
        public string updateSealBagInfo(string jsonReq)
        {
            string strRes = string.Empty;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);

                ServerUrl = Constants.SERVER_URL + "/service/json/etrs/updateSealBagInfo";
                JObject jsonRes = null;

                //Constants.LOGGER_DOC.Info("-->" + jsonReq.ToString());
                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);
                //Constants.LOGGER_DOC.Info("<--" + strRes);
                jsonRes = JObject.Parse(strRes);
                strRes  = jsonRes["code"].ToString();
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }
            return(strRes);
        }
Exemplo n.º 5
0
        public string getReceiptDetails(String strDocId)
        {
            string strReq = string.Empty;
            string strRes = string.Empty;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);

                ServerUrl = Constants.SERVER_URL + "/service/merchant/tfm/getReceiptDetails";

                JObject jsonReq = new JObject();
                JObject jsonRes = null;

                jsonReq.Add("doc_id", strDocId);

                //Constants.LOGGER_DOC.Info("-->" + jsonReq.ToString());
                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);
                //Constants.LOGGER_DOC.Info("<--" + strRes);

                jsonRes = JObject.Parse(strRes);
                strRes  = jsonRes["list"].ToString();
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }

            return(strRes);
        }
Exemplo n.º 6
0
        public string checkRefundAmt(string jsonReq)
        {
            string strRes = string.Empty;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);

                ServerUrl = Constants.SERVER_URL + "/service/merchant/tfm/checkRefundAmt";

                JObject jsonRes = null;

                //Constants.LOGGER_DOC.Info("-->" + jsonReq.ToString());
                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);
                //Constants.LOGGER_DOC.Info("<--" + strRes);
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }

            return(strRes);
        }
Exemplo n.º 7
0
        //자동완성 가맹점 검색
        public string searchAutoCompanyName(String strKeyword)
        {
            string strReq = string.Empty;
            string strRes = string.Empty;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);

                ServerUrl = Constants.SERVER_URL + "/service/merchant/tfm/searchAutoCompanyName";

                JObject jsonReq = new JObject();
                JObject jsonRes = null;

                jsonReq.Add("keyword", strKeyword);
                jsonReq.Add("group_id", Constants.GROUP_ID);

                // Constants.LOGGER_DOC.Info("-->" + jsonReq.ToString());
                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);
                // Constants.LOGGER_DOC.Info("<--" + strRes);

                jsonRes = JObject.Parse(strRes);
                strRes  = jsonRes["list"].ToString();
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }

            return(strRes);
        }
Exemplo n.º 8
0
        public JObject sendServer_object(String sendData, String strUrl, int nTimeout = 60, Boolean bLog = true, Boolean bEnocode = false)
        {
            string  strReq  = string.Empty;
            string  strRes  = string.Empty;
            JObject jsonRes = null;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(Constants.LOGGER_MAIN);
                strRes = comm.sendHttp_Json(Constants.SERVER_URL + strUrl, sendData, true, nTimeout, bLog, bEnocode);

                if (strRes == null || string.Empty.Equals(strRes.Trim()))
                {
                    jsonRes = null;
                }
                else
                {
                    jsonRes = JObject.Parse(strRes);
                }
            }
            catch (Exception e)
            {
                Constants.LOGGER_MAIN.Error(e.Message, e);
            }
            return(jsonRes);
        }
Exemplo n.º 9
0
        public string voidTicket(string jsonReq)
        {
            string strRes = string.Empty;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);

                ServerUrl = Constants.SERVER_URL + "/service/json/etrs/voidTicket";

                //Constants.LOGGER_DOC.Info("-->" + jsonReq.ToString());
                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);
                //Constants.LOGGER_DOC.Info("<--" + strRes);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }
            return(strRes);
        }
Exemplo n.º 10
0
        public bool checkNetworkStatus()
        {
            Boolean bRet    = true;
            string  strReq  = string.Empty;
            string  strRes  = string.Empty;
            JObject jsonRes = null;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);
                strRes = comm.sendHttp_Json(Constants.SERVER_URL + url_Status_check, strReq, true, 10, false);

                if (strRes == null || string.Empty.Equals(strRes.Trim()))
                {
                    //처리오류
                    bRet = false;
                }
                else
                {
                    jsonRes = JObject.Parse(strRes);
                    if ("S".Equals((string)jsonRes["result"]))
                    {
                        //서버상태 체크 성공
                        bRet = true;
                    }
                    else
                    {
                        //서버상태 체크 실패
                        bRet = false;
                    }
                }
            }
            catch (Exception e)
            {
                Constants.LOGGER_MAIN.Info(e.Message);
            }
            return(bRet);
        }
Exemplo n.º 11
0
        public string Login(String strUserId, String strPassword)
        {
            string strReq = string.Empty;
            string strRes = string.Empty;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);
                // mac adress 가지고 오기
                //string mac_adress = GetMacAdress();
                ServerUrl = Constants.SERVER_URL + "/service/merchant/tfm/login";

                JObject jsonReq      = new JObject();
                JObject jsonRes      = null;
                JObject jsonmerchant = new JObject();

                jsonReq.Add("userid", strUserId);
                jsonReq.Add("password", strPassword);
                jsonReq.Add("outlet", Constants.OUTLET_TYPE);
                //jsonReq.Add("mac_adress", mac_adress);

                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);

                /*
                 * jsonRes = JObject.Parse(strRes);
                 * Constants.merchant_list = JArray.Parse(jsonRes["list"].ToString());
                 * strRes = jsonRes["code"].ToString();
                 * jsonmerchant = Constants.merchant_list[0].ToObject<JObject>();
                 *
                 * if (jsonRes["group_id"] != null)
                 * {
                 *  Constants.GROUP_ID = jsonRes["group_id"].ToString();
                 *  Constants.GROUP_NAME = jsonRes["group_name"].ToString();
                 * }
                 *
                 * if (jsonmerchant["mid"] != null)
                 * {
                 *  Constants.MID = jsonmerchant["mid"].ToString();
                 * }
                 * if (jsonmerchant["tid"] != null)
                 * {
                 *  Constants.TID = jsonmerchant["tid"].ToString();
                 * }
                 * if (jsonmerchant["gst_no"] != null)
                 * {
                 *  Constants.GST_NO = jsonmerchant["gst_no"].ToString();
                 * }
                 * if (jsonmerchant["rec_prefix"] != null)
                 * {
                 *  Constants.REC_PREFIX = jsonmerchant["rec_prefix"].ToString();
                 * }
                 * if (jsonmerchant["dup_rc"] != null)
                 * {
                 *  Constants.DUP_RC = jsonmerchant["dup_rc"].ToString();
                 * }
                 * if (jsonmerchant["rec_digits"] != null)
                 * {
                 *  Constants.REC_DIGITS = jsonmerchant["rec_digits"].ToString();
                 * }
                 * if (jsonmerchant["item_code1"] != null)
                 * {
                 *  Constants.ITEM_CODE1 = jsonmerchant["item_code1"].ToString();
                 * }
                 * if (jsonmerchant["item_code2"] != null)
                 * {
                 *  Constants.ITEM_CODE2 = jsonmerchant["item_code2"].ToString();
                 * }
                 * if (jsonmerchant["item_code3"] != null)
                 * {
                 *  Constants.ITEM_CODE3 = jsonmerchant["item_code3"].ToString();
                 * }
                 * if (jsonmerchant["item_code4"] != null)
                 * {
                 *  Constants.ITEM_CODE4 = jsonmerchant["item_code4"].ToString();
                 * }
                 * if (jsonmerchant["item_code5"] != null)
                 * {
                 *  Constants.ITEM_CODE5 = jsonmerchant["item_code5"].ToString();
                 * }
                 */
                jsonRes = JObject.Parse(strRes);
                strRes  = jsonRes["code"].ToString();

                if (jsonRes["group_id"] != null)
                {
                    Constants.GROUP_ID   = jsonRes["group_id"].ToString();
                    Constants.GROUP_NAME = jsonRes["group_name"].ToString();
                }
                if (jsonRes["mid"] != null)
                {
                    Constants.MID = jsonRes["mid"].ToString();
                }
                if (jsonRes["tid"] != null)
                {
                    Constants.TID = jsonRes["tid"].ToString();
                }
                if (jsonRes["gst_no"] != null)
                {
                    Constants.GST_NO = jsonRes["gst_no"].ToString();
                }
                if (jsonRes["rec_prefix"] != null)
                {
                    Constants.REC_PREFIX = jsonRes["rec_prefix"].ToString();
                }
                if (jsonRes["dup_rc"] != null)
                {
                    Constants.DUP_RC = jsonRes["dup_rc"].ToString();
                }
                if (jsonRes["item_code1"] != null)
                {
                    Constants.ITEM_CODE1 = jsonRes["item_code1"].ToString();
                }
                if (jsonRes["item_code2"] != null)
                {
                    Constants.ITEM_CODE2 = jsonRes["item_code2"].ToString();
                }
                if (jsonRes["item_code3"] != null)
                {
                    Constants.ITEM_CODE3 = jsonRes["item_code3"].ToString();
                }
                if (jsonRes["item_code4"] != null)
                {
                    Constants.ITEM_CODE4 = jsonRes["item_code4"].ToString();
                }
                if (jsonRes["item_code5"] != null)
                {
                    Constants.ITEM_CODE5 = jsonRes["item_code5"].ToString();
                }
                string dtn = DateTime.Now.ToString("yyyyMMdd");

                if (dtn.Equals(jsonRes["to_day"].ToString()))
                {
                    Constants.CHECK_SERVERDATE = "Y";
                }
            }
            catch (Exception ex)
            {
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }

            return(strRes);
        }
Exemplo n.º 12
0
        public string Login(String strUserId, String strPassword)
        {
            string strReq = string.Empty;
            string strRes = string.Empty;

            try
            {
                GTF_CommManager comm = new GTF_CommManager(null);

                ServerUrl = Constants.SERVER_URL + "/service/merchant/tfm/login";

                JObject jsonReq = new JObject();
                JObject jsonRes = null;

                jsonReq.Add("userid", strUserId);
                jsonReq.Add("password", strPassword);
                jsonReq.Add("outlet", Constants.OUTLET_TYPE);
                strRes = comm.sendHttp_Json(ServerUrl, jsonReq.ToString(), true, Constants.SERVER_TIMEOUT);

                jsonRes = JObject.Parse(strRes);
                strRes  = jsonRes["code"].ToString();

                if (jsonRes["group_id"] != null)
                {
                    Constants.GROUP_ID   = jsonRes["group_id"].ToString();
                    Constants.GROUP_NAME = jsonRes["group_name"].ToString();
                }

                if (jsonRes["mid"] != null)
                {
                    Constants.MID = jsonRes["mid"].ToString();
                }
                if (jsonRes["tid"] != null)
                {
                    Constants.TID = jsonRes["tid"].ToString();
                }
                if (jsonRes["gst_no"] != null)
                {
                    Constants.GST_NO = jsonRes["gst_no"].ToString();
                }
                if (jsonRes["rec_prefix"] != null)
                {
                    Constants.REC_PREFIX = jsonRes["rec_prefix"].ToString();
                }
                if (jsonRes["dup_rc"] != null)
                {
                    Constants.DUP_RC = jsonRes["dup_rc"].ToString();
                }
                if (jsonRes["rec_digits"] != null)
                {
                    Constants.REC_DIGITS = jsonRes["rec_digits"].ToString();
                }
                if (jsonRes["item_code1"] != null)
                {
                    Constants.ITEM_CODE1 = jsonRes["item_code1"].ToString();
                }
                if (jsonRes["item_code2"] != null)
                {
                    Constants.ITEM_CODE2 = jsonRes["item_code2"].ToString();
                }
                if (jsonRes["item_code3"] != null)
                {
                    Constants.ITEM_CODE3 = jsonRes["item_code3"].ToString();
                }
                if (jsonRes["item_code4"] != null)
                {
                    Constants.ITEM_CODE4 = jsonRes["item_code4"].ToString();
                }
                if (jsonRes["item_code5"] != null)
                {
                    Constants.ITEM_CODE5 = jsonRes["item_code5"].ToString();
                }
                if (jsonRes["store_name"] != null)
                {
                    Constants.STORE_NAME = jsonRes["store_name"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.Message);
                Constants.LOGGER_MAIN.Error(ex.StackTrace);
            }

            return(strRes);
        }