コード例 #1
0
ファイル: DbAttr.cs プロジェクト: Dhenskr/hoyi-entities
 public DbAttr(datatype _type, int _length, string _fieldName,  string _comment)
 {
     this.type = _type;
     this.Length = _length;
     this.Comment = _comment;
     this.FieldName = _fieldName;
 }
コード例 #2
0
ファイル: DbAttr.cs プロジェクト: Dhenskr/hoyi-entities
 public DbAttr(datatype _type, int _length, bool _identity, bool _isPK)
 {
     this.type = _type;
     this.Length = _length;
     this.Identity = _identity;
     this.isPK = _isPK;
 }
コード例 #3
0
        //10. Создаём метод вставки элемента в массив
        public bool CtrlCCtrlV(datatype item, int v)
        {
            if (v >= size)
            {
                throw new IndexOutOfRangeException();
            }
            T[] k      = new T[size];
            int length = k.Length;

            Array.Copy(array, 0, k, 0, v);
            k[v] = item;
            for (int i = v + 1; i <= length; i++)
            {
                if (k.Length - (a + 1) < 0)
                {
                    PlusSize();
                    T[] t = new T[size];
                    for (int j = 0; j < k.Length; j++)
                    {
                        t[j] = k[j];
                    }
                    k = t;
                }
                try { k[i] = array[i - 1]; }
                catch {}
            }
            array = k;
            a++;
            return(true);
        }
コード例 #4
0
        public static datatype Create <datatype>() where datatype : new()
        {
            datatype dt = new datatype();

            CreateWorker <datatype>(ref dt, typeof(datatype));

            return(dt);
        }
コード例 #5
0
ファイル: DbAttr.cs プロジェクト: Dhenskr/hoyi-entities
 public DbAttr(datatype _type, int _length, bool _identity, bool _isPK, string _fieldName, string _comment)
 {
     this.type = _type;
     this.Length = _length;
     this.Identity = _identity;
     this.isPK = _isPK;
     this.FieldName = _fieldName;
     this.Comment = _comment;
 }
コード例 #6
0
ファイル: Program.cs プロジェクト: mbilenko03/Basic-Build-Ups
        static void Main(string[] args)
        {
            //Declaring Size:

              int size;
              int[] arrVariable = new datatype[size];

              //Accessing Elements:

              int[] arrVariable = {List of Values Ex: 1,2,3,4,5};
              datatype variable = arrVariable[Which Element Ex: 0];
コード例 #7
0
 //8. Создаём метод, который удаляет элемент из массива
 public bool DeleteElement(datatype item)
 {
     for (int i = 0; i < a; i++)
     {
         if (array[i].Equals(item))
         {
             IndexOfArray(i);
             return(true);
         }
     }
     return(false);
 }
コード例 #8
0
        /// <summary>
        /// 获取最后一根柱子的信息
        /// </summary>
        /// <param name="pcode">商品行情编码</param>
        /// <param name="dtype">周期类型</param>
        /// <returns>获取最后一根柱子的信息(逗号隔开的行情数据)</returns>
        public string GetLastPillar(string pcode, datatype dtype)
        {
            string      strtmp = String.Empty;
            TradeClient tc     = new TradeClient();

            try
            {
                switch (dtype)
                {
                case datatype.M1: strtmp = "M1";
                    break;

                case datatype.M5: strtmp = "M5";
                    break;

                case datatype.M15: strtmp = "M15";
                    break;

                case datatype.M30: strtmp = "M30";
                    break;

                case datatype.H1: strtmp = "H1";
                    break;

                case datatype.H4: strtmp = "H4";
                    break;

                case datatype.D1: strtmp = "D1";
                    break;

                case datatype.W1: strtmp = "W1";
                    break;

                case datatype.MN: strtmp = "MN";
                    break;

                default:
                    break;
                }
                strtmp = tc.GetLastPillarData(strtmp, pcode);
                tc.Close();
            }
            catch (Exception ex)
            {
                tc.Abort();
                ComFunction.WriteErr(ex);
            }
            return(strtmp);
        }
コード例 #9
0
 /// <summary>
 /// 获取最后一根柱子的信息
 /// </summary>
 /// <param name="pcode">商品行情编码</param>
 /// <param name="dtype">周期类型</param>
 /// <returns>获取最后一根柱子的信息(逗号隔开的行情数据)</returns>
 public string GetLastPillar(string pcode, datatype dtype)
 {
     string strtmp = String.Empty;
     TradeClient tc = new TradeClient();
     try
     {
         switch (dtype)
         {
             case datatype.M1: strtmp = "M1";
                 break;
             case datatype.M5: strtmp = "M5";
                 break;
             case datatype.M15: strtmp = "M15";
                 break;
             case datatype.M30: strtmp = "M30";
                 break;
             case datatype.H1: strtmp = "H1";
                 break;
             case datatype.H4: strtmp = "H4";
                 break;
             case datatype.D1: strtmp = "D1";
                 break;
             case datatype.W1: strtmp = "W1";
                 break;
             case datatype.MN: strtmp = "MN";
                 break;
             default:
                 break;
         }
         strtmp = tc.GetLastPillarData(strtmp, pcode);
         tc.Close();
     }
     catch (Exception ex)
     {
         tc.Abort();
         ComFunction.WriteErr(ex);
     }
     return strtmp;
 }
コード例 #10
0
ファイル: DbAttr.cs プロジェクト: Dhenskr/hoyi-entities
 public DbAttr(datatype _type, int _length, string _comment)
 {
     this.type = _type;
     this.Length = _length;
     this.Comment = _comment;
 }
コード例 #11
0
ファイル: DbAttr.cs プロジェクト: Dhenskr/hoyi-entities
 public DbAttr(datatype _type, int _length)
 {
     this.type = _type;
     this.Length = _length;
 }
コード例 #12
0
 Init(realsymbol, date, datatype, aggregation, path);
コード例 #13
0
ファイル: MySQLDBTr.cs プロジェクト: Dhenskr/hoyi-entities
 public static MySqlDbType TransByEnDbType(datatype dbtype)
 {
     switch (dbtype)
     {
         case datatype.Varchar:
             return MySqlDbType.VarChar;
         case datatype.Nvarchar:
             return MySqlDbType.VarChar;
         case datatype.Int:
             return MySqlDbType.Int32;
         case datatype.Decimal:
             return MySqlDbType.Decimal;
         case datatype.Bigint:
             return MySqlDbType.Int64;
         case datatype.DateTime:
             return MySqlDbType.DateTime;
         default:
             break;
     }
     return MySqlDbType.VarChar;
 }