コード例 #1
0
        private static void Batch_Insert()
        {
            const int len = 3;
            List<SICIL> list = new List<SICIL>(len);
            for (int j = 0; j < len; ++j)
            {
                SICIL s = new SICIL();
                s.ADI = j.ToString();
                s.CINSIYET = (byte)j;

                s.MEZUNBOLK = 30;
                s.PERSONELTIPK = 2;
                s.SICILKOD = new Random(DateTime.Now.Millisecond).Next(1, 1001);
                s.SICILNO = s.SICILKOD.ToString();
                s.SILINDI = 1;
                s.SOYADI = s.ADI + " SOYADI";

                list.Add(s);
            }

            Console.WriteLine(Util.Adapter.BatchInsert(list, BatchCommandMode.Batch));
            for (int j = 0; j < len; ++j)
            {
                Console.WriteLine(list[j].SICIL2K);
            }

            Console.WriteLine(); Console.WriteLine();

            Console.WriteLine(Util.Adapter.BatchInsert(list, BatchCommandMode.Single));
            for (int j = 0; j < len; ++j)
            {
                Console.WriteLine(list[j].SICIL2K);
            }
        }
コード例 #2
0
        private static void Batch_Upsert_Insert()
        {
            const int len = 3;
            SICIL[] arr = new SICIL[len];
            for (int j = 0; j < len; ++j)
            {
                SICIL s = new SICIL();
                s.ADI = j.ToString() + " BY WCF BATCH";
                s.CINSIYET = (byte)j;

                s.MEZUNBOLK = 30;
                s.PERSONELTIPK = 2;
                s.SICILKOD = new Random(DateTime.Now.Millisecond).Next(1, 1001);
                s.SICILNO = s.SICILKOD.ToString();
                s.SILINDI = 0;
                s.SOYADI = s.ADI + " SOYADI";

                arr[j] = s;
            }

            Console.WriteLine(Util.Adapter.BatchUpsert(arr, BatchCommandMode.Batch));
            Console.WriteLine(); Console.WriteLine();
            foreach (SICIL k in arr)
                Console.WriteLine(k.SICIL2K);

            Console.WriteLine(); Console.WriteLine();

            arr = new SICIL[len];
            for (int j = 0; j < len; ++j)
            {
                SICIL s = new SICIL();
                s.ADI = (j + 3003).ToString() + " BY WCF SINGLE";
                s.CINSIYET = (byte)j;

                s.MEZUNBOLK = 30;
                s.PERSONELTIPK = 2;
                s.SICILKOD = new Random(DateTime.Now.Millisecond).Next(1, 1001);
                s.SICILNO = s.SICILKOD.ToString();
                s.SILINDI = 0;
                s.SOYADI = s.ADI + " SOYADI";

                arr[j] = s;
            }

            Console.WriteLine(Util.Adapter.BatchUpsert(arr, BatchCommandMode.Single));
            Console.WriteLine(); Console.WriteLine();
            foreach (SICIL k in arr)
                Console.WriteLine(k.SICIL2K);
        }
        private void OnAddNewRecord(object sender, RoutedEventArgs e)
        {
            SICIL s = new SICIL();
            int seed = new Random(DateTime.Now.Millisecond).Next(1, 1001);
            s.ADI = "Adı" + seed;
            s.CINSIYET = (byte)(seed % 2);

            s.MEZUNBOLK = 30;
            s.PERSONELTIPK = 2;
            s.SICILKOD = new Random(DateTime.Now.Millisecond).Next(1, 1001);
            s.SICILNO = s.SICILKOD.ToString();
            s.SILINDI = 0;
            s.SOYADI = s.ADI + " SOYADI";

            this.ItemSource.Add(s);
        }
コード例 #4
0
        private static void UpsertInsert()
        {
            SICIL s = new SICIL();
            s.ADI = "Upsert Insert by WCF";
            s.CINSIYET = 1;

            s.MEZUNBOLK = 30;
            s.PERSONELTIPK = 2;
            s.SICILKOD = new Random(DateTime.Now.Millisecond).Next(1, 1001);
            s.SICILNO = s.SICILKOD.ToString();
            s.SILINDI = 0;
            s.SOYADI = s.ADI + " SOYADI";

            Console.WriteLine(Util.Adapter.Upsert(s) + " - " + s.SICIL2K);
        }
コード例 #5
0
 /// <summary>
 /// Create a new SICIL object.
 /// </summary>
 /// <param name="sICIL2K">Initial value of the SICIL2K property.</param>
 /// <param name="sICILKOD">Initial value of the SICILKOD property.</param>
 /// <param name="sICILNO">Initial value of the SICILNO property.</param>
 /// <param name="aDI">Initial value of the ADI property.</param>
 /// <param name="sOYADI">Initial value of the SOYADI property.</param>
 /// <param name="pERSONELTIPK">Initial value of the PERSONELTIPK property.</param>
 /// <param name="mEZUNBOLK">Initial value of the MEZUNBOLK property.</param>
 public static SICIL CreateSICIL(global::System.Int32 sICIL2K, global::System.Int32 sICILKOD, global::System.String sICILNO, global::System.String aDI, global::System.String sOYADI, global::System.Int32 pERSONELTIPK, global::System.Int32 mEZUNBOLK)
 {
     SICIL sICIL = new SICIL();
     sICIL.SICIL2K = sICIL2K;
     sICIL.SICILKOD = sICILKOD;
     sICIL.SICILNO = sICILNO;
     sICIL.ADI = aDI;
     sICIL.SOYADI = sOYADI;
     sICIL.PERSONELTIPK = pERSONELTIPK;
     sICIL.MEZUNBOLK = mEZUNBOLK;
     return sICIL;
 }
コード例 #6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the SICILs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSICILs(SICIL sICIL)
 {
     base.AddObject("SICILs", sICIL);
 }