本文整理汇总了C#中MonoTests.System.Web.UI.WebControls.ObjectDataSourcePoker.Select方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectDataSourcePoker.Select方法的具体用法?C# ObjectDataSourcePoker.Select怎么用?C# ObjectDataSourcePoker.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTests.System.Web.UI.WebControls.ObjectDataSourcePoker
的用法示例。
在下文中一共展示了ObjectDataSourcePoker.Select方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateMethod
public static void UpdateMethod (Page p)
{
MyTableObject.ds = MyTableObject.CreateDataTable ();
ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
InitObjectDataSource (ods, "update");
ods.Updated += new ObjectDataSourceStatusEventHandler (odc_Updated);
ods.Updating += new ObjectDataSourceMethodEventHandler (odc_Updating);
p.Controls.Add (ods);
Assert.AreEqual (3, ((DataView) ods.Select ()).Count, "BeforeUpdate1");
Assert.AreEqual (1001, ((DataView) ods.Select ())[0].Row.ItemArray[0], "BeforeUpdate2");
Assert.AreEqual ("Mahesh", ((DataView) ods.Select ())[0].Row.ItemArray[1], "BeforeUpdate3");
Assert.AreEqual ("Chand", ((DataView) ods.Select ())[0].Row.ItemArray[2], "BeforeUpdate4");
Assert.AreEqual (false, updated, "BeforeUpdateEvent");
Assert.AreEqual (false, updating, "BeforeUpdatingEvent");
ods.Update ();
Assert.AreEqual (3, ((DataView) ods.Select ()).Count, "AfterUpdate1");
Assert.AreEqual (1001, ((DataView) ods.Select ())[0].Row.ItemArray[0], "AfterUpdate2");
Assert.AreEqual ("David", ((DataView) ods.Select ())[0].Row.ItemArray[1], "AfterUpdate3");
Assert.AreEqual ("Eli", ((DataView) ods.Select ())[0].Row.ItemArray[2], "AfterUpdate4");
Assert.AreEqual (true, updated, "AfterUpdateEvent");
Assert.AreEqual (true, updating, "AfterUpdatingEvent");
}
示例2: EventsTest
public static void EventsTest (Page p)
{
MyTableObject.ds = MyTableObject.CreateDataTable ();
DetailsView dv = new DetailsView ();
ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
ods.ObjectCreated += new ObjectDataSourceObjectEventHandler (odc_ObjectCreated);
ods.ObjectCreating += new ObjectDataSourceObjectEventHandler (odc_ObjectCreating);
InitObjectDataSource (ods,"");
ods.FilterExpression = "ID='1001'";
dv.Page = p;
ods.Page = p;
dv.DataKeyNames = new string[] { "ID" };
dv.DataSource = ods;
p.Controls.Add (ods);
p.Controls.Add (dv);
dv.DataBind ();
ods.Filtering += new ObjectDataSourceFilteringEventHandler (odc_Filtering);
Assert.AreEqual (false, filtering, "BeforeFilteringEvent");
ods.Select ();
Assert.AreEqual (true, filtering, "AfterFilteringEvent");
ods.ObjectDisposing += new ObjectDataSourceDisposingEventHandler (odc_ObjectDisposing);
//ToDo: Dispose, ObjectCreated and ObjectCreating should be tested.
}
示例3: InsertMethod
public static void InsertMethod (Page p)
{
MyTableObject.ds = MyTableObject.CreateDataTable ();
ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
InitObjectDataSource (ods,"insert");
ods.Inserted += new ObjectDataSourceStatusEventHandler (odc_Inserted);
ods.Inserting += new ObjectDataSourceMethodEventHandler (odc_Inserting);
p.Controls.Add (ods);
Assert.AreEqual (3, ((DataView) ods.Select ()).Count, "BeforeInsert");
Assert.AreEqual (false, inserted , "BeforeInsertedEvent");
Assert.AreEqual (false, inserting , "BeforeInsertingEvent");
ods.Insert ();
Assert.AreEqual (4, ((DataView) ods.Select ()).Count , "AfterInsert1");
Assert.AreEqual (1004,((DataView) ods.Select ())[3].Row.ItemArray[0], "AfterInsert2");
Assert.AreEqual ("David", ((DataView) ods.Select ())[3].Row.ItemArray[1], "AfterInsert3");
Assert.AreEqual (true, inserted, "AfterInsertedEvent");
Assert.AreEqual (true, inserting, "AfterInsertingEvent");
}
示例4: SelectMethodCached
public static void SelectMethodCached (Page p)
{
MyTableObject.ds = MyTableObject.CreateDataTable ();
ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
ods.EnableCaching = true;
InitObjectDataSource (ods, "");
p.Controls.Add (ods);
ods.Selecting += new ObjectDataSourceSelectingEventHandler (odc_Selecting);
selecting = false;
IEnumerable table = (IEnumerable) ods.Select ();
Assert.AreEqual (true, selecting, "AfterSelectingEvent");
selecting = false;
IEnumerable table2 = (IEnumerable) ods.Select ();
Assert.AreEqual (false, selecting, "AfterSelectingEvent");
}
示例5: SelectMethod
public static void SelectMethod (Page p)
{
MyTableObject.ds = MyTableObject.CreateDataTable ();
ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
InitObjectDataSource (ods,"");
ods.Selected += new ObjectDataSourceStatusEventHandler (odc_Selected);
ods.Selecting += new ObjectDataSourceSelectingEventHandler (odc_Selecting);
p.Controls.Add (ods);
Assert.AreEqual (false, selecting, "BeforeSelectingEvent");
Assert.AreEqual (false, selected, "BeforeSelectedEvent");
IEnumerable table = (IEnumerable) ods.Select ();
Assert.AreEqual (3,((DataView) table).Count, "ItemsCount");
Assert.AreEqual ("Mahesh", ((DataView) table)[0].Row.ItemArray[1], "FirstItemData");
Assert.AreEqual (1002, ((DataView) table)[1].Row.ItemArray[0], "SecondItemData");
Assert.AreEqual ("Bansal", ((DataView) table)[2].Row.ItemArray[2], "ThirdItemData");
Assert.AreEqual (true, selecting, "AfterSelectingEvent");
Assert.AreEqual (true, selected, "AfterSelectedEvent");
}
示例6: FilterExpressionException
public static void FilterExpressionException (Page p)
{
MyTableObject.ds = MyTableObject.CreateDataTable ();
ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
InitObjectDataSource (ods, "");
ods.SelectMethod = "SelectException";
ods.FilterExpression = "ID='1001'";
p.Controls.Add (ods);
IEnumerable table = (IEnumerable) ods.Select ();
}
示例7: EnableCachingException
public static void EnableCachingException (Page p)
{
MyTableObject.ds = MyTableObject.CreateDataTable ();
ObjectDataSourcePoker ods = new ObjectDataSourcePoker ();
InitObjectDataSource (ods, "");
ods.SelectMethod = "SelectException";
ods.EnableCaching = true;
p.Controls.Add (ods);
IEnumerable table = (IEnumerable) ods.Select ();
}