Beispiel #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);
            }
        }
Beispiel #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();
                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();
                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);
        }
Beispiel #4
0
        private static void UpsertInsert()
        {
            SICIL s = new SICIL();
            s.ADI = "Upsert Insert";
            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);
        }
Beispiel #5
0
        private static void Batch_Upsert_Insert_Identity()
        {
            const int len = 2;
            SICIL[] arr = new 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 = 0;
                s.SOYADI = s.ADI + " SOYADI";

                arr[j] = s;
            }

            IBatchCommandUpsert cmd = (IBatchCommandUpsert)Helper.Factory.CreateBatchCommand(BatchCommandType.Upsert);
            cmd.UpdatedFields = new HashSet<string>() { "ADI" };
            cmd.InsertFields = new HashSet<string>() { "ADI", "MEZUNBOLK", "PERSONELTIPK", "SICILKOD", "SICILNO", "SOYADI" };

            Console.WriteLine(cmd.Upsert(arr, BatchCommandMode.Batch, new EntityMetaDataProviderEF4(typeof(SICIL))));
            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();
                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(cmd.Upsert(arr, BatchCommandMode.Single, new EntityMetaDataProviderEF4(typeof(SICIL))));
            Console.WriteLine(); Console.WriteLine();
            foreach (SICIL k in arr)
                Console.WriteLine(k.SICIL2K);
        }
Beispiel #6
0
        private static void Batch_Insert_Identity()
        {
            const int len = 2;
            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);
            }

            IBatchCommandInsert cmd = (IBatchCommandInsert)Helper.Factory.CreateBatchCommand(BatchCommandType.Insert);
            cmd.InsertFields = new HashSet<string>() { "ADI", "MEZUNBOLK", "PERSONELTIPK", "SICILKOD", "SICILNO", "SOYADI" };

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

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

            Console.WriteLine(Helper.Factory.CreateBatchCommand(BatchCommandType.Insert).Execute(list, BatchCommandMode.Single));
            for (int j = 0; j < len; ++j)
            {
                Console.WriteLine(list[j].SICIL2K);
            }
        }
Beispiel #7
0
        private static void UpsertInsert_Identity()
        {
            SICIL s = new SICIL();
            s.ADI = "Upsert Insert";
            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";

            IEntityCommandUpsert cmd = (IEntityCommandUpsert)Helper.Factory.CreateEntityCommand(EntityCommandType.Upsert);
            cmd.UpdatedFields = new HashSet<string>() { "ADI" };
            cmd.InsertFields = new HashSet<string>() { "ADI", "MEZUNBOLK", "PERSONELTIPK", "SICILKOD", "SICILNO", "SOYADI" };

            Console.WriteLine(cmd.Upsert(s) + " - " + s.SICIL2K);
        }
Beispiel #8
0
        private static void Insert_Identity()
        {
            SICIL s = new SICIL();
            s.ADI = "Insert";
            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 = 1;
            s.SOYADI = s.ADI + " SOYADI";
                    
            Console.WriteLine(Helper.Factory.CreateEntityCommand(EntityCommandType.Insert).Execute(s) + " - " + s.SICIL2K);
        }
Beispiel #9
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>
 /// <param name="cINSIYET">Initial value of the CINSIYET 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, global::System.Int16 cINSIYET)
 {
     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;
     sICIL.CINSIYET = cINSIYET;
     return sICIL;
 }
Beispiel #10
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);
 }