Ejemplo n.º 1
0
        protected IDalc PrepareDalc()
        {
            var dalc = new DatasetDalc();
            var ds   = new DataSet();
            //
            var accountsTbl = ds.Tables.Add("accounts");

            accountsTbl.Columns.Add("id", typeof(int));
            accountsTbl.Columns.Add("name", typeof(string));
            accountsTbl.Columns.Add("age", typeof(int));
            accountsTbl.Columns.Add("number", typeof(int));
            accountsTbl.Columns.Add("aff_id", typeof(int));
            AddRow(accountsTbl, 1, "Vitalik", 26, 2, 3);
            AddRow(accountsTbl, 2, "Zhenya", 2, 0, 1);
            AddRow(accountsTbl, 3, "Bill", 52, 100, 0);

            dalc.PersistedDS = ds;
            return(dalc);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Composes sample DALC based on DataSet object.
        /// In real life you will use DbDalc implementation.
        /// </summary>
        protected IDalc PrepareDalc()
        {
            var dalc = new DatasetDalc();
            var ds   = new DataSet();
            //
            var accountsTbl = ds.Tables.Add("persons");

            accountsTbl.Columns.Add("id", typeof(int));
            accountsTbl.Columns.Add("name", typeof(string));
            accountsTbl.Columns.Add("mother_id", typeof(int)).AllowDBNull = true;
            accountsTbl.Columns.Add("father_id", typeof(int)).AllowDBNull = true;
            AddRow(accountsTbl, 1, "Adam");
            AddRow(accountsTbl, 2, "Eve");
            AddRow(accountsTbl, 3, "Jane", 2, 1);
            AddRow(accountsTbl, 4, "Bill", 2, 0);
            AddRow(accountsTbl, 5, "Joe", 3, 4);
            AddRow(accountsTbl, 6, "Anna", 0, 5);

            dalc.PersistedDS = ds;
            return(dalc);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Composes sample DALC based on DataSet object.
        /// In real life you will use DbDalc implementation.
        /// </summary>
        protected IDalc PrepareDalc()
        {
            var dalc = new DatasetDalc();
            var ds = new DataSet();
            //
            var accountsTbl = ds.Tables.Add("persons");
            accountsTbl.Columns.Add("id", typeof(int));
            accountsTbl.Columns.Add("name", typeof(string));
            accountsTbl.Columns.Add("mother_id", typeof(int)).AllowDBNull = true;
            accountsTbl.Columns.Add("father_id", typeof(int)).AllowDBNull = true;
            AddRow(accountsTbl, 1, "Adam");
            AddRow(accountsTbl, 2, "Eve");
            AddRow(accountsTbl, 3, "Jane", 2, 1);
            AddRow(accountsTbl, 4, "Bill", 2, 0);
            AddRow(accountsTbl, 5, "Joe", 3, 4);
            AddRow(accountsTbl, 6, "Anna", 0, 5);

            dalc.PersistedDS = ds;
            return dalc;
        }
Ejemplo n.º 4
0
        protected IDalc PrepareDalc()
        {
            var dalc = new DatasetDalc();
            var ds = new DataSet();
            //
            var accountsTbl = ds.Tables.Add("accounts");
            accountsTbl.Columns.Add("id", typeof(int));
            accountsTbl.Columns.Add("name", typeof(string));
            accountsTbl.Columns.Add("age", typeof(int));
            accountsTbl.Columns.Add("number", typeof(int));
            accountsTbl.Columns.Add("aff_id", typeof(int));
            AddRow(accountsTbl, 1, "Vitalik", 26, 2, 3);
            AddRow(accountsTbl, 2, "Zhenya", 2, 0, 1);
            AddRow(accountsTbl, 3, "Bill", 52, 100, 0);

            dalc.PersistedDS = ds;
            return dalc;
        }