示例#1
0
        private People GetNextRecord()
        {
            var people = DBTeste.CreateObject <People>();
            var tbQry  = new TableQuery(people);

            tbQry.Top = 1;
            tbQry.Where.Add(new QueryParam(people.Collumns[People.FieldsName.Id], eCondition.ecGraterThan, _people.Id));

            var list = people.FillCollection <People>(tbQry);

            if (list.Count == 0)
            {
                throw new Exception("Nenhum registro encontrado");
            }
            else
            {
                return(list.First());
            }
        }
示例#2
0
        private void button3_Click(object sender, EventArgs e)
        {
            ProfitabilityBase obj = DBTeste.CreateObject <ProfitabilityBase>();

            TableQuery query = new TableQuery(obj);

            WhereCollection where = new WhereCollection()
            {
                new QueryParam(obj.Collumns[0], "1")
            };

            WhereCollection where1 = new WhereCollection()
            {
                new QueryParam(obj.Collumns[1], eCondition.ecIsNull),
            };

            query.Wheres.Add(where);
            query.Wheres.Add(where1);

            SqlServerScriptWizard scrip = new SqlServerScriptWizard(query);

            var result = scrip.GetSelectStatment();
        }