Exemplo n.º 1
0
        private string analyzeCmdStr(string sCmdStr)
        {
            string sDstStr;
            string sStr;
            string mm, dd;
            int    idx;
            int    num;

            sDstStr = "";
            if (sCmdStr == "PRICE")
            {
                if (m_nSumPrice == 0)
                {
                    sDstStr = "";
                }
                else
                {
                    sStr    = m_libCmn.AddPriceKanma(m_nSumPrice);
                    sDstStr = m_libCmn.HanToZen(sStr);;
                }
            }
            else if (sCmdStr == "CRTTIME")
            {
                DateTime dt = DateTime.Now;
                sStr    = m_libCmn.AnlizeNengou(dt.ToString("yyyy"));
                mm      = dt.ToString("MM");
                dd      = dt.ToString("dd");
                sDstStr = sStr + "年" + mm + "月" + dd + "日";
                sDstStr = m_libCmn.HanToZen(sDstStr);
            }
            else if (sCmdStr == "NAME")
            {
                sDstStr = m_sName;
            }
            else if (sCmdStr == "SOUKE")
            {
                sDstStr = m_sSouke;
            }
            else if (sCmdStr == "TUYA")
            {
                sStr    = m_libCmn.AnlizeNengou(m_sTuya.Substring(0, 4));
                mm      = m_sTuya.Substring(5, 2);
                dd      = m_sTuya.Substring(8, 2);
                sDstStr = sStr + "年" + mm + "月" + dd + "日";
                sDstStr = m_libCmn.HanToZen(sDstStr);
            }
            else if (sCmdStr == "KOKUBETU")
            {
                sStr    = m_libCmn.AnlizeNengou(m_sKokubetu.Substring(0, 4));
                mm      = m_sKokubetu.Substring(5, 2);
                dd      = m_sKokubetu.Substring(8, 2);
                sDstStr = sStr + "年" + mm + "月" + dd + "日";
                sDstStr = m_libCmn.HanToZen(sDstStr);
            }
            else if (sCmdStr == "SEKOU")
            {
                sDstStr = m_sSekou;
            }
            else if (sCmdStr == "KAISYA1")
            {
                sDstStr = m_sKaisya1;
            }
            else if (sCmdStr == "KAISYA2")
            {
                sDstStr = m_sKaisya2;
            }
            else if (sCmdStr == "POSTNO")
            {
                sDstStr = m_sPostNo;
            }
            else if (sCmdStr == "ADDRESS")
            {
                sDstStr = m_sAddress;
            }
            else if (sCmdStr == "TEL")
            {
                sDstStr = m_sTel;
            }
            else if (sCmdStr == "FAX")
            {
                sDstStr = m_sFax;
            }
            else if (sCmdStr.Substring(0, 6) == "BSBANK")
            {
                idx     = m_libCmn.StrToInt(sCmdStr.Substring(6));
                sDstStr = m_sBank[idx];
            }
            else if (sCmdStr.Substring(0, 6) == "NOUHIN")
            {
                idx     = m_libCmn.StrToInt(sCmdStr.Substring(6));
                sDstStr = m_sNouhin[idx];
            }
            else if (sCmdStr.Substring(0, 6) == "SEIKYU")
            {
                idx     = m_libCmn.StrToInt(sCmdStr.Substring(6));
                sDstStr = m_sSeikyu[idx];
            }
            else if (sCmdStr.Substring(0, 6) == "HBNAME")
            {
                idx = m_libCmn.StrToInt(sCmdStr.Substring(6)) - 1;
                if (idx < m_list.Count)
                {
                    sDstStr = m_list[idx].name;
                }
            }
            else if (sCmdStr.Substring(0, 6) == "HNAIYU")
            {
                idx = m_libCmn.StrToInt(sCmdStr.Substring(6)) - 1;
                if (idx < m_list.Count)
                {
                    sDstStr = m_list[idx].naiyou;
                }
            }
            else if (sCmdStr.Substring(0, 6) == "HTANKA")
            {
                idx = m_libCmn.StrToInt(sCmdStr.Substring(6)) - 1;
                if (idx < m_list.Count)
                {
                    num     = m_list[idx].tanka;
                    sDstStr = String.Format("{0:#,0}", num);
                    sDstStr = m_libCmn.HanToZen(sDstStr);
                }
            }
            else if (sCmdStr.Substring(0, 6) == "HBKOSU")
            {
                idx = m_libCmn.StrToInt(sCmdStr.Substring(6)) - 1;
                if (idx < m_list.Count)
                {
                    num     = m_list[idx].kosu;
                    sDstStr = String.Format("{0:#,0}", num);
                    sDstStr = m_libCmn.HanToZen(sDstStr);
                }
            }
            else if (sCmdStr.Substring(0, 6) == "HPRICE")
            {
                idx = m_libCmn.StrToInt(sCmdStr.Substring(6)) - 1;
                if (idx < m_list.Count)
                {
                    num     = m_list[idx].price;
                    sDstStr = String.Format("{0:#,0}", num);
                    sDstStr = m_libCmn.HanToZen(sDstStr);
                }
            }
            else if (sCmdStr.Substring(0, 6) == "HBIKOU")
            {
                idx = m_libCmn.StrToInt(sCmdStr.Substring(6)) - 1;
                if (idx < m_list.Count)
                {
                    sDstStr = m_list[idx].bikou;
                }
            }
            return(sDstStr);
        }