Esempio n. 1
0
        public static XQAllOutBlocks Get(string accno = default, string passwd = default, string expcode = default, char chegb = default, char sortgb = default, string cts_ordno = default)
        {
            using (XQt0434 instance = new XQt0434())
            {
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.accno, 0, accno);                 // char 11
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.passwd, 0, passwd);               // char 8
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.expcode, 0, expcode);             // char 8
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.chegb, 0, chegb.ToString());      // char 1
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.sortgb, 0, sortgb.ToString());    // char 1
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.cts_ordno, 0, cts_ordno);         // char 7

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

                XQAllOutBlocks results = new XQAllOutBlocks();
                results.OutBlock = instance.GetBlock();
                if (results.OutBlock.IsValidData == false)
                {
                    return(null);
                }

                results.OutBlock1 = instance.GetBlock1s();
                return(results);
            }
        }
Esempio n. 2
0
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, string accno = default,string passwd = default,string expcode = default,char chegb = default,char sortgb = default,string cts_ordno = default */)
        {
            using (XQt0434 instance = new XQt0434())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

                string      tableName = (tableNamePostfix == null) ? "XQt0434OutBlock" : $"XQt0434OutBlock_{tableNamePostfix}";
                QueryOption qo        = new QueryOption(tableName);
                results.OutBlock = instance.Select <XQt0434OutBlock>(qo);

                tableName         = (tableNamePostfix == null) ? "XQt0434OutBlock1" : $"XQt0434OutBlock1_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock1 = instance.SelectMany <XQt0434OutBlock1>(qo);
                return(results);
            }
        }
Esempio n. 3
0
        public static XQt0434OutBlock1[] Get(string accno = default, string passwd = default, string expcode = default, char chegb = default, char sortgb = default, string cts_ordno = default)
        {
            using (XQt0434 instance = new XQt0434())
            {
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.accno, 0, accno);                 // char 11
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.passwd, 0, passwd);               // char 8
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.expcode, 0, expcode);             // char 8
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.chegb, 0, chegb.ToString());      // char 1
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.sortgb, 0, sortgb.ToString());    // char 1
                instance.SetFieldData(XQt0434InBlock.BlockName, XQt0434InBlock.F.cts_ordno, 0, cts_ordno);         // char 7

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

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }
Esempio n. 4
0
        public static XQt0434OutBlock FromQuery(XQt0434 query)
        {
            XQt0434OutBlock block = new XQt0434OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.cts_ordno = query.GetFieldData(block.GetBlockName(), "cts_ordno", 0).TrimEnd('?');                 // char 7
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }
Esempio n. 5
0
        public static XQt0434OutBlock1[] ListFromQuery(XQt0434 query)
        {
            int count = query.GetBlockCount(XQt0434OutBlock1.BlockName);
            List <XQt0434OutBlock1> list = new List <XQt0434OutBlock1>();

            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                return(list.ToArray());
            }
            for (int i = 0; i < count; i++)
            {
                XQt0434OutBlock1 block = new XQt0434OutBlock1();
                block.IsValidData   = true;
                block.InvalidReason = "";
                try
                {
                    block.ordno      = query.GetFieldData(block.GetBlockName(), "ordno", i).ParseLong("ordno");           // long 7
                    block.orgordno   = query.GetFieldData(block.GetBlockName(), "orgordno", i).ParseLong("orgordno");     // long 7
                    block.medosu     = query.GetFieldData(block.GetBlockName(), "medosu", i).TrimEnd('?');                // char 10
                    block.ordgb      = query.GetFieldData(block.GetBlockName(), "ordgb", i).TrimEnd('?');                 // char 20
                    block.qty        = query.GetFieldData(block.GetBlockName(), "qty", i).ParseLong("qty");               // long 9
                    block.price      = query.GetFieldData(block.GetBlockName(), "price", i).ParseFloat("price");          // float 9.2
                    block.cheqty     = query.GetFieldData(block.GetBlockName(), "cheqty", i).ParseLong("cheqty");         // long 9
                    block.cheprice   = query.GetFieldData(block.GetBlockName(), "cheprice", i).ParseFloat("cheprice");    // float 9.2
                    block.ordrem     = query.GetFieldData(block.GetBlockName(), "ordrem", i).ParseLong("ordrem");         // long 9
                    block.status     = query.GetFieldData(block.GetBlockName(), "status", i).TrimEnd('?');                // char 10
                    block.ordtime    = query.GetFieldData(block.GetBlockName(), "ordtime", i).TrimEnd('?');               // char 8
                    block.ordermtd   = query.GetFieldData(block.GetBlockName(), "ordermtd", i).TrimEnd('?');              // char 10
                    block.expcode    = query.GetFieldData(block.GetBlockName(), "expcode", i).TrimEnd('?');               // char 8
                    block.rtcode     = query.GetFieldData(block.GetBlockName(), "rtcode", i).TrimEnd('?');                // char 3
                    block.sysprocseq = query.GetFieldData(block.GetBlockName(), "sysprocseq", i).ParseLong("sysprocseq"); // long 10
                    block.hogatype   = query.GetFieldData(block.GetBlockName(), "hogatype", i).FirstOrDefault();          // char 1
                } catch (InvalidDataFormatException e) {
                    block.IsValidData   = false;
                    block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
                }
                list.Add(block);
            }
            return(list.ToArray());
        }