本文整理汇总了C#中Select类的典型用法代码示例。如果您正苦于以下问题:C# Select类的具体用法?C# Select怎么用?C# Select使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Select类属于命名空间,在下文中一共展示了Select类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillElement
protected void FillElement(IWebElement element, object value)
{
if (value == null)
{
return;
}
if (IsInput(element))
{
String inputType = element.GetAttribute("type");
if (inputType == null || inputType == TextInputType || inputType == PasswordInputType)
{
element.SendKeys(value.ToString());
}
else if (inputType == CheckboxType)
{
CheckBox checkBox = new CheckBox(element);
checkBox.Set(bool.Parse(value.ToString()));
}
else if (inputType == RadioType)
{
Radio radio = new Radio(element);
radio.SelectByValue(value.ToString());
}
}
else if (IsSelect(element))
{
Select select = new Select(element);
select.SelectByValue(value.ToString());
}
else if (IsTextArea(element))
{
element.SendKeys(value.ToString());
}
}
示例2: Delete
public Delete(string table, Select select, bool allowMultiple)
{
Table.Name = table;
AllowMultiple = allowMultiple;
Select = select;
Filter = FilterType.Select;
}
示例3: SelectionElement
public SelectionElement(string myAlias, Select.EdgeList myEdgeList, bool myIsGroupedOrAggregated, IDChainDefinition myRelatedIDChainDefinition, IAttributeDefinition myElement = null)
: this(myAlias, myRelatedIDChainDefinition)
{
EdgeList = myEdgeList;
IsGroupedOrAggregated = myIsGroupedOrAggregated;
Element = myElement;
}
示例4: Acc_Exec_AggregateAvg
public void Acc_Exec_AggregateAvg()
{
const double expected = 28.8664;
// overload #1
double result = new
Select(Aggregate.Avg("UnitPrice"))
.From(Product.Schema)
.ExecuteScalar<double>();
Assert.AreEqual(expected, result);
// overload #2
result = new
Select(Aggregate.Avg(Product.UnitPriceColumn))
.From(Product.Schema)
.ExecuteScalar<double>();
Assert.AreEqual(expected, result);
// overload #3
result = new
Select(Aggregate.Avg("UnitPrice", "AverageUnitPrice"))
.From(Product.Schema)
.ExecuteScalar<double>();
Assert.AreEqual(expected, result);
// overload #4
result = new
Select(Aggregate.Avg(Product.UnitPriceColumn, "AverageUnitPrice"))
.From(Product.Schema)
.ExecuteScalar<double>();
Assert.AreEqual(expected, result);
}
示例5: Start
// Use this for initialization
void Start()
{
posicionAPuntador = new Vector3 (transform.position.x,transform.position.y+5,0);
seleccionador = new Select ();
seleccionador = GameObject.FindGameObjectWithTag("Select").GetComponent<Select>();
escogido = false;
}
示例6: Start
// Use this for initialization
void Start()
{
IModule mountainTerrain = new RidgedMulti();
IModule baseFlatTerrain = new Billow();
((Billow)baseFlatTerrain).Frequency = 2.0;
IModule flatTerrain = new ScaleBias(baseFlatTerrain, 0.125, -0.75);
IModule terrainType = new Perlin();
((Perlin)terrainType).Frequency = 0.5;
((Perlin)terrainType).Persistence = 0.25;
IModule terrainSelector = new Select(flatTerrain, mountainTerrain, terrainType);
((Select)terrainSelector).SetBounds(0.0, 1000.0);
((Select)terrainSelector).SetEdgeFallOff(0.125);
IModule finalTerrain = new Turbulence(terrainSelector);
((Turbulence)finalTerrain).Frequency = 4.0;
((Turbulence)finalTerrain).Power = 0.125;
NoiseMapBuilderPlane heightMapBuilder = new NoiseMapBuilderPlane(256, 256);
heightMapBuilder.SetBounds(6.0, 10.0, 1.0, 5.0);
heightMapBuilder.Build(finalTerrain);
RendererImage render = new RendererImage();
render.SourceNoiseMap = heightMapBuilder.Map;
render.ClearGradient ();
render.AddGradientPoint(-1.0000, new Color32(32, 160, 0, 255));
render.AddGradientPoint(-0.2500, new Color32(224, 224, 0, 255));
render.AddGradientPoint(0.2500, new Color32(128, 128, 128, 255));
render.AddGradientPoint(1.0000, new Color32(255, 255, 255, 255));
render.IsLightEnabled = true;
render.LightContrast = 3.0;
render.LightBrightness = 2.0;
render.Render();
tex = render.GetTexture();
}
示例7: BarcodeExist
private bool BarcodeExist()
{
try
{
int count = 1;
switch (SysPara.AutoGenerateBarcode)
{
case 0:
case 1:
count = new Select().From(TTestInfo.Schema).Where(TTestInfo.Columns.Barcode).IsEqualTo(txtBarcode.Text.Trim()).
And(TTestInfo.Columns.PatientId).IsNotEqualTo(vPatient_ID).GetRecordCount();
break;
case 2:
count = new Select().From(TTestInfo.Schema).Where(TTestInfo.Columns.TestTypeId).IsEqualTo(vTestType_ID).
And(TTestInfo.Columns.Barcode).IsEqualTo(txtBarcode.Text.Trim()).GetRecordCount();
break;
}
if (count > 0) return true;
else return false;
}
catch (Exception ex)
{
return true;
}
}
示例8: Exec_AggregateMax
public void Exec_AggregateMax()
{
const double expected = 100.00;
// overload #1
double result = new
Select(Aggregate.Max("UnitPrice"))
.From(Product.Schema)
.ExecuteScalar<double>();
Assert.AreEqual(expected, result);
// overload #2
result = new
Select(Aggregate.Max(Product.UnitPriceColumn))
.From(Product.Schema)
.ExecuteScalar<double>();
Assert.AreEqual(expected, result);
// overload #3
result = new
Select(Aggregate.Max("UnitPrice", "MostExpensive"))
.From(Product.Schema)
.ExecuteScalar<double>();
Assert.AreEqual(expected, result);
// overload #4
result = new
Select(Aggregate.Max(Product.UnitPriceColumn, "MostExpensive"))
.From(Product.Schema)
.ExecuteScalar<double>();
Assert.AreEqual(expected, result);
}
示例9: Start
void Start()
{
// STEP 1
// Gradient is set directly on the object
var mountainTerrain = new RidgedMultifractal();
RenderAndSetImage(mountainTerrain);
// Stop rendering if we're only getting as far as this tutorial
// step. It saves me from doing multiple files.
if (_tutorialStep <= 1) return;
// STEP 2
var baseFlatTerrain = new Billow();
baseFlatTerrain.Frequency = 2.0;
RenderAndSetImage(baseFlatTerrain);
if (_tutorialStep <= 2) return;
// STEP 3
var flatTerrain = new ScaleBias(0.125, -0.75, baseFlatTerrain);
RenderAndSetImage(flatTerrain);
if (_tutorialStep <= 3) return;
// STEP 4
var terrainType = new Perlin();
terrainType.Frequency = 0.5;
terrainType.Persistence = 0.25;
var finalTerrain = new Select(flatTerrain, mountainTerrain, terrainType);
finalTerrain.SetBounds(0, 1000);
finalTerrain.FallOff = 0.125;
RenderAndSetImage(finalTerrain);
}
示例10: Exec_AggregateAvg
public void Exec_AggregateAvg()
{
const double expected = 55.5922077922078; //55.5922;
// overload #1
double result = new
Select(Aggregate.Avg("UnitPrice"))
.From(Product.Schema)
.ExecuteScalar<double>();
//Assert.AreEqual(expected, result);
Assert.AreEqual(Math.Round(expected, 8), Math.Round(result, 8)); // [[55.5922]]!=[[55.5922077922078]]
// overload #2
result = new
Select(Aggregate.Avg(Product.UnitPriceColumn))
.From(Product.Schema)
.ExecuteScalar<double>();
//Assert.AreEqual(expected, result);
Assert.AreEqual(Math.Round(expected, 8), Math.Round(result, 8));
// overload #3
result = new
Select(Aggregate.Avg("UnitPrice", "AverageUnitPrice"))
.From(Product.Schema)
.ExecuteScalar<double>();
//Assert.AreEqual(expected, result);
Assert.AreEqual(Math.Round(expected, 8), Math.Round(result, 8));
// overload #4
result = new
Select(Aggregate.Avg(Product.UnitPriceColumn, "AverageUnitPrice"))
.From(Product.Schema)
.ExecuteScalar<double>();
//Assert.AreEqual(expected, result);
Assert.AreEqual(Math.Round(expected, 8), Math.Round(result, 8));
}
示例11: bind_chart
//databind to total orders by eta and company id
protected void bind_chart(Int32 companyid)
{
try
{
int _countopen = 0;
//total open orders for this company or total open orders for company = -1
if (companyid > -1)
{
_countopen = new Select(OrderTable.OrderIDColumn).From<OrderTable>().Where(OrderTable.CompanyIDColumn).IsEqualTo(companyid).
And(OrderTable.JobClosedColumn).IsEqualTo(false).GetRecordCount();
}
else
{
_countopen = new Select(OrderTable.OrderIDColumn).From<OrderTable>().Where(OrderTable.JobClosedColumn).IsEqualTo(false).GetRecordCount();
}
//bind to gauge
this.dxgaugeSumopen.Value = _countopen.ToString();
}
catch (Exception ex)
{
this.dxlblerr1.Text = ex.Message.ToString();
this.dxlblerr1.Visible = true;
}
}
示例12: SelectTests
public SelectTests()
{
context = new TestingContext();
select = new Select<Role>(context.Set<Role>());
context.DropData();
SetUpData();
}
示例13: SelectTests
public SelectTests()
{
context = new TestingContext();
select = new Select<Role>(context.Set<Role>());
context.Set<Role>().Add(ObjectFactory.CreateRole());
context.DropData();
}
示例14: HuyXacNhanPhieuTraLaiKho
/// <summary>
/// hàm thực hiện việc xác nhận thông tin
/// </summary>
/// <param name="objPhieuNhap"></param>
/// <returns></returns>
public ActionResult HuyXacNhanPhieuTraLaiKho(TPhieuNhapxuatthuoc objPhieuNhap)
{
HisDuocProperties objHisDuocProperties = PropertyLib._HisDuocProperties;
string errorMessage = "";
try
{
using (var Scope = new TransactionScope())
{
using (var dbScope = new SharedDbConnectionScope())
{
SqlQuery sqlQuery = new Select().From(TPhieuNhapxuatthuocChitiet.Schema)
.Where(TPhieuNhapxuatthuocChitiet.Columns.IdPhieu).IsEqualTo(objPhieuNhap.IdPhieu);
TPhieuNhapxuatthuocChitietCollection objPhieuNhapCtCollection =
sqlQuery.ExecuteAsCollection<TPhieuNhapxuatthuocChitietCollection>();
foreach (TPhieuNhapxuatthuocChitiet objPhieuNhapCt in objPhieuNhapCtCollection)
{
//Kiểm tra ở kho nhập xem thuốc đã sử dụng chưa
ActionResult _Kiemtrathuochuyxacnhan = Kiemtrathuochuyxacnhan(objPhieuNhap, objPhieuNhapCt);
if (_Kiemtrathuochuyxacnhan != ActionResult.Success) return _Kiemtrathuochuyxacnhan;
int id_thuockho = -1;
StoredProcedure sp = SPs.ThuocNhapkhoOutput(objPhieuNhapCt.NgayHethan, objPhieuNhapCt.GiaNhap, objPhieuNhapCt.GiaBan,
objPhieuNhapCt.SoLuong, Utility.DecimaltoDbnull(objPhieuNhapCt.Vat),
objPhieuNhapCt.IdThuoc, objPhieuNhap.IdKhonhap, objPhieuNhapCt.MaNhacungcap,
objPhieuNhapCt.SoLo, objPhieuNhapCt.SoDky, objPhieuNhapCt.SoQdinhthau, -1, id_thuockho,
objPhieuNhap.NgayXacnhan, objPhieuNhapCt.GiaBhyt, objPhieuNhapCt.GiaPhuthuDungtuyen, objPhieuNhapCt.GiaPhuthuTraituyen, objPhieuNhapCt.KieuThuocvattu);
sp.Execute();
sp = SPs.ThuocXuatkho(objPhieuNhap.IdKhoxuat, objPhieuNhapCt.IdThuoc,
objPhieuNhapCt.NgayHethan, objPhieuNhapCt.GiaNhap,objPhieuNhapCt.GiaBan,
Utility.DecimaltoDbnull(objPhieuNhapCt.Vat),
Utility.Int32Dbnull(objPhieuNhapCt.SoLuong), objPhieuNhapCt.IdThuockho, objPhieuNhapCt.MaNhacungcap, objPhieuNhapCt.SoLo, objHisDuocProperties.XoaDulieuKhiThuocDaHet ? 1 : 0, errorMessage);
sp.Execute();
errorMessage = Utility.sDbnull(sp.OutputValues[0]);
}
//Xóa toàn bộ chi tiết trong TBiendongThuoc
new Delete().From(TBiendongThuoc.Schema)
.Where(TBiendongThuoc.IdPhieuColumn).IsEqualTo(objPhieuNhap.IdPhieu).Execute();
new Update(TPhieuNhapxuatthuoc.Schema)
.Set(TPhieuNhapxuatthuoc.Columns.IdNhanvien).EqualTo(null)
.Set(TPhieuNhapxuatthuoc.Columns.NguoiXacnhan).EqualTo(null)
.Set(TPhieuNhapxuatthuoc.Columns.NgayXacnhan).EqualTo(null)
.Set(TPhieuNhapxuatthuoc.Columns.TrangThai).EqualTo(0)
.Where(TPhieuNhapxuatthuoc.Columns.IdPhieu).IsEqualTo(objPhieuNhap.IdPhieu).Execute();
}
Scope.Complete();
return ActionResult.Success;
}
}
catch (Exception exception)
{
log.Error("Loi ban ra tu sp :{0}", errorMessage);
log.Error("Loi trong qua trinh xac nhan don thuoc :{0}", exception);
return ActionResult.Error;
}
}
示例15: Exec_Simple
public void Exec_Simple()
{
//string dbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"MyApplication\Northwind.db3");
//DataService.Providers["Northwind"].DefaultConnectionString =
// String.Format(@"Data Source={0};Version=3;New=False;Connection Timeout=3", dbPath);
int records = new Select("productID").From("Products").GetRecordCount();
Assert.IsTrue(records == 77);
}