예제 #1
0
파일: t2814.cs 프로젝트: tdoobw/XingAPI
        public static XQAllOutBlocks Get(char gubun1 = default, char gubun2 = default, string from_date = default, string to_date = default)
        {
            using (XQt2814 instance = new XQt2814())
            {
                instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.gubun1, 0, gubun1.ToString());        // char 1
                instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.gubun2, 0, gubun2.ToString());        // char 1
                instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.from_date, 0, from_date);             // char 8
                instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.to_date, 0, to_date);                 // char 8

                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);
            }
        }
예제 #2
0
파일: t2814.cs 프로젝트: tdoobw/XingAPI
        public static XQAllOutBlocks ReadFromDB(string tableNamePostfix = null /*, char gubun1 = default,char gubun2 = default,string from_date = default,string to_date = default */)
        {
            using (XQt2814 instance = new XQt2814())
            {
                XQAllOutBlocks results = new XQAllOutBlocks();

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

                tableName         = (tableNamePostfix == null) ? "XQt2814OutBlock1" : $"XQt2814OutBlock1_{tableNamePostfix}";
                qo                = new QueryOption(tableName);
                results.OutBlock1 = instance.SelectMany <XQt2814OutBlock1>(qo);
                return(results);
            }
        }
예제 #3
0
파일: t2814.cs 프로젝트: iPeterPan/XingAPI
        public static XQt2814OutBlock1[] Get(char gubun1 = default, char gubun2 = default, string from_date = default, string to_date = default)
        {
            using (XQt2814 instance = new XQt2814())
            {
                instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.gubun1, 0, gubun1.ToString());        // char 1
                instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.gubun2, 0, gubun2.ToString());        // char 1
                instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.from_date, 0, from_date);             // char 8
                instance.SetFieldData(XQt2814InBlock.BlockName, XQt2814InBlock.F.to_date, 0, to_date);                 // char 8

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

                var outBlock = instance.GetBlock1s();
                return(outBlock);
            }
        }
예제 #4
0
파일: t2814.cs 프로젝트: iPeterPan/XingAPI
        public static XQt2814OutBlock FromQuery(XQt2814 query)
        {
            XQt2814OutBlock block = new XQt2814OutBlock();

            block.IsValidData   = true;
            block.InvalidReason = "";
            if (query.QueryResult != null && query.QueryResult.IsSystemError == true)
            {
                block.IsValidData   = false;
                block.InvalidReason = query.ReceiveMessage;
                return(block);
            }
            try
            {
                block.mcode = query.GetFieldData(block.GetBlockName(), "mcode", 0).TrimEnd('?');                 // char 8
                block.mname = query.GetFieldData(block.GetBlockName(), "mname", 0).TrimEnd('?');                 // char 20
            } catch (InvalidDataFormatException e) {
                block.IsValidData   = false;
                block.InvalidReason = $"FieldName == {e.DataFieldName}, FieldData == \"{e.DataValue}\"";
            }
            return(block);
        }