Exemple #1
0
        public static XQt1621OutBlock FromQuery(XQt1621 query)
        {
            XQt1621OutBlock block = new XQt1621OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.indcode = query.GetFieldData(block.GetBlockName(), "indcode", 0).TrimEnd('?');               // char 4
                block.forcode = query.GetFieldData(block.GetBlockName(), "forcode", 0).TrimEnd('?');               // char 4
                block.syscode = query.GetFieldData(block.GetBlockName(), "syscode", 0).TrimEnd('?');               // char 4
                block.stocode = query.GetFieldData(block.GetBlockName(), "stocode", 0).TrimEnd('?');               // char 4
                block.invcode = query.GetFieldData(block.GetBlockName(), "invcode", 0).TrimEnd('?');               // char 4
                block.bancode = query.GetFieldData(block.GetBlockName(), "bancode", 0).TrimEnd('?');               // char 4
                block.inscode = query.GetFieldData(block.GetBlockName(), "inscode", 0).TrimEnd('?');               // char 4
                block.fincode = query.GetFieldData(block.GetBlockName(), "fincode", 0).TrimEnd('?');               // char 4
                block.moncode = query.GetFieldData(block.GetBlockName(), "moncode", 0).TrimEnd('?');               // char 4
                block.etccode = query.GetFieldData(block.GetBlockName(), "etccode", 0).TrimEnd('?');               // char 4
                block.natcode = query.GetFieldData(block.GetBlockName(), "natcode", 0).TrimEnd('?');               // char 4
                block.pefcode = query.GetFieldData(block.GetBlockName(), "pefcode", 0).TrimEnd('?');               // char 4
                block.jisucd  = query.GetFieldData(block.GetBlockName(), "jisucd", 0).TrimEnd('?');                // char 8
                block.jisunm  = query.GetFieldData(block.GetBlockName(), "jisunm", 0).TrimEnd('?');                // char 20
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Exemple #2
0
        public static XQt1621OutBlock1[] ListFromQuery(XQt1621 query)
        {
            int count = query.GetBlockCount(XQt1621OutBlock1.BlockName);
            List <XQt1621OutBlock1> list = new List <XQt1621OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt1621OutBlock1 block = new XQt1621OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.date      = query.GetFieldData(block.GetBlockName(), "date", i).TrimEnd('?');                // char 8
                    block.time      = query.GetFieldData(block.GetBlockName(), "time", i).TrimEnd('?');                // char 6
                    block.datetime  = query.GetFieldData(block.GetBlockName(), "datetime", i).TrimEnd('?');            // char 14
                    block.indmsvol  = query.GetFieldData(block.GetBlockName(), "indmsvol", i).ParseLong("indmsvol");   // long 8
                    block.indmsamt  = query.GetFieldData(block.GetBlockName(), "indmsamt", i).ParseDouble("indmsamt"); // double 12.0
                    block.formsvol  = query.GetFieldData(block.GetBlockName(), "formsvol", i).ParseLong("formsvol");   // long 8
                    block.formsamt  = query.GetFieldData(block.GetBlockName(), "formsamt", i).ParseDouble("formsamt"); // double 12.0
                    block.sysmsvol  = query.GetFieldData(block.GetBlockName(), "sysmsvol", i).ParseLong("sysmsvol");   // long 8
                    block.sysmsamt  = query.GetFieldData(block.GetBlockName(), "sysmsamt", i).ParseDouble("sysmsamt"); // double 12.0
                    block.stomsvol  = query.GetFieldData(block.GetBlockName(), "stomsvol", i).ParseLong("stomsvol");   // long 8
                    block.stomsamt  = query.GetFieldData(block.GetBlockName(), "stomsamt", i).ParseDouble("stomsamt"); // double 12.0
                    block.invmsvol  = query.GetFieldData(block.GetBlockName(), "invmsvol", i).ParseLong("invmsvol");   // long 8
                    block.invmsamt  = query.GetFieldData(block.GetBlockName(), "invmsamt", i).ParseDouble("invmsamt"); // double 12.0
                    block.banmsvol  = query.GetFieldData(block.GetBlockName(), "banmsvol", i).ParseLong("banmsvol");   // long 8
                    block.banmsamt  = query.GetFieldData(block.GetBlockName(), "banmsamt", i).ParseDouble("banmsamt"); // double 12.0
                    block.insmsvol  = query.GetFieldData(block.GetBlockName(), "insmsvol", i).ParseLong("insmsvol");   // long 8
                    block.insmsamt  = query.GetFieldData(block.GetBlockName(), "insmsamt", i).ParseDouble("insmsamt"); // double 12.0
                    block.finmsvol  = query.GetFieldData(block.GetBlockName(), "finmsvol", i).ParseLong("finmsvol");   // long 8
                    block.finmsamt  = query.GetFieldData(block.GetBlockName(), "finmsamt", i).ParseDouble("finmsamt"); // double 12.0
                    block.monmsvol  = query.GetFieldData(block.GetBlockName(), "monmsvol", i).ParseLong("monmsvol");   // long 8
                    block.monmsamt  = query.GetFieldData(block.GetBlockName(), "monmsamt", i).ParseDouble("monmsamt"); // double 12.0
                    block.etcmsvol  = query.GetFieldData(block.GetBlockName(), "etcmsvol", i).ParseLong("etcmsvol");   // long 8
                    block.etcmsamt  = query.GetFieldData(block.GetBlockName(), "etcmsamt", i).ParseDouble("etcmsamt"); // double 12.0
                    block.natmsvol  = query.GetFieldData(block.GetBlockName(), "natmsvol", i).ParseLong("natmsvol");   // long 8
                    block.natmsamt  = query.GetFieldData(block.GetBlockName(), "natmsamt", i).ParseDouble("natmsamt"); // double 12.0
                    block.pefmsvol  = query.GetFieldData(block.GetBlockName(), "pefmsvol", i).ParseLong("pefmsvol");   // long 8
                    block.pefmsamt  = query.GetFieldData(block.GetBlockName(), "pefmsamt", i).ParseDouble("pefmsamt"); // double 12.0
                    block.upclose   = query.GetFieldData(block.GetBlockName(), "upclose", i).ParseFloat("upclose");    // float 6.2
                    block.upcvolume = query.GetFieldData(block.GetBlockName(), "upcvolume", i).ParseLong("upcvolume"); // long 8
                    block.upvolume  = query.GetFieldData(block.GetBlockName(), "upvolume", i).ParseDouble("upvolume"); // double 12.0
                    block.upvalue   = query.GetFieldData(block.GetBlockName(), "upvalue", i).ParseDouble("upvalue");   // double 12.0
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }
Exemple #3
0
        public static XQt1621OutBlock1[] Get(string upcode = default, int nmin = default, int cnt = default, char bgubun = default)
        {
            using (XQt1621 instance = new XQt1621())
            {
                instance.SetFieldData(XQt1621InBlock.BlockName, XQt1621InBlock.F.upcode, 0, upcode);                 // char 3
                instance.SetFieldData(XQt1621InBlock.BlockName, XQt1621InBlock.F.nmin, 0, nmin.ToString("d2"));      // int 2
                instance.SetFieldData(XQt1621InBlock.BlockName, XQt1621InBlock.F.cnt, 0, cnt.ToString("d3"));        // int 3
                instance.SetFieldData(XQt1621InBlock.BlockName, XQt1621InBlock.F.bgubun, 0, bgubun.ToString());      // char 1

                if (instance.Request() < 0)
                {
                    return(null);
                }

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }