本文整理汇总了C#中Select.GetRecordCount方法的典型用法代码示例。如果您正苦于以下问题:C# Select.GetRecordCount方法的具体用法?C# Select.GetRecordCount怎么用?C# Select.GetRecordCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Select
的用法示例。
在下文中一共展示了Select.GetRecordCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: cmdUpdateAllUser_Click
private void cmdUpdateAllUser_Click(object sender, EventArgs e)
{
if(grdSysUser.GetCheckedRows().Length<=0)
{
Utility.ShowMsg("Bạn phải chọn thông tin trên lưới thực hiện ","Thông báo");
return;
}
try
{
if(chkOverUser.Checked)
{
foreach (Janus.Windows.GridEX.GridEXRow gridExRow in grdSysUser.GetCheckedRows())
{
new Delete().From(SysTrinhky.Schema)
.Where(SysTrinhky.Columns.ReportName).IsEqualTo(TenBaoCao)
.And(SysTrinhky.Columns.ObjectName).IsEqualTo(
Utility.sDbnull(gridExRow.Cells[SysUser.Columns.PkSuid].Value, "")).Execute();
}
}
foreach (Janus.Windows.GridEX.GridEXRow gridExRow in grdSysUser.GetCheckedRows())
{
SqlQuery sqlQuery = new Select().From(SysTrinhky.Schema)
.Where(SysTrinhky.Columns.ReportName).IsEqualTo(TenBaoCao)
.And(SysTrinhky.Columns.ObjectName).IsEqualTo(
Utility.sDbnull(gridExRow.Cells[SysUser.Columns.PkSuid].Value, ""));
if(sqlQuery.GetRecordCount()<=0)
SysTrinhky.Insert(TenBaoCao, Utility.sDbnull(gridExRow.Cells[SysUser.Columns.PkSuid].Value, ""),NoiDung);
}
Utility.ShowMsg("Bạn thực hiện thành công","Thông báo thành công");
}
catch (Exception)
{
throw;
}
}
示例2: Exec_SimpleJoin
public void Exec_SimpleJoin()
{
var q = new Select(provider, "productid").From<OrderDetail>()
.InnerJoin<Product>()
.Where("CategoryID").IsEqualTo(5);
string sql = q.ToString();
int records = q.GetRecordCount();
Assert.Equal(100, records);
}
示例3: Exec_LeftOuterJoin_With_Generics
public void Exec_LeftOuterJoin_With_Generics()
{
var query = new Select(provider, Aggregate.GroupBy("CompanyName"))
.From<Customer>()
.LeftOuterJoin<Order>();
int records = query.GetRecordCount();
Assert.Equal(195, records);
}
示例4: Acc_Exec_SimpleJoin3
public void Acc_Exec_SimpleJoin3()
{
SubSonic.SqlQuery q = new Select().From(Tables.OrderDetail)
.InnerJoin(Tables.Product)
.Where("CategoryID").IsEqualTo(5);
string sql = q.ToString();
int records = q.GetRecordCount();
Assert.IsTrue(records == 196);
}
示例5: Acc_Exec_SimpleJoin2
public void Acc_Exec_SimpleJoin2()
{
SubSonic.SqlQuery q = new Select("productid").From<OrderDetail>()
.InnerJoin(Product.Schema)
.Where("CategoryID").IsEqualTo(5);
string sql = q.ToString();
int records = q.GetRecordCount();
Assert.IsTrue(records == 196);
Assert.IsTrue(q.Provider.Name == "NorthwindAccess");
}
示例6: Acc_Exec_SimpleAnd3
public void Acc_Exec_SimpleAnd3()
{
DataProvider provider = DataService.GetInstance("NorthwindAccess");
SubSonic.SqlQuery query = new
Select(provider, Aggregate.GroupBy("ProductID"), Aggregate.Avg("UnitPrice"), Aggregate.Avg("Quantity"))
.From("Order Details");
query
.Where(Aggregate.Avg("UnitPrice"))
.IsGreaterThan(30)
.And(Aggregate.Avg("Quantity"))
.IsGreaterThan(20);
int records = query.GetRecordCount();
string s = query.BuildSqlStatement();
Assert.AreEqual(17, records);
}
示例7: Acc_Exec_PagedViewJoined
public void Acc_Exec_PagedViewJoined()
{
SubSonic.SqlQuery q = new Select().From(Invoice.Schema).Paged(1, 20).InnerJoin(Product.Schema);
int records = q.GetRecordCount();
Assert.IsTrue(records == 20);
}
示例8: Acc_Exec_PagedJoined
public void Acc_Exec_PagedJoined()
{
//IDataReader rdr = Northwind.DB.Select("ProductId", "ProductName", "CategoryName")
// .From("Products")
// .InnerJoin(Northwind.Category.Schema)
// .Paged(1, 20)
// .ExecuteReader();
DataProvider provider = DataService.GetInstance("NorthwindAccess");
SubSonic.SqlQuery q = new Select(provider, "ProductId", "ProductName", "CategoryName").From("Products").InnerJoin(Category.Schema).Paged(1, 20);
int records = q.GetRecordCount();
Assert.IsTrue(records == 20);
}
示例9: Acc_Exec_MultipleInWithAnd
public void Acc_Exec_MultipleInWithAnd()
{
SubSonic.SqlQuery query = new Select()
.From(Product.Schema)
.Where(Product.CategoryIDColumn).In(2)
.And(Product.SupplierIDColumn).In(3);
string sql = query.ToString();
int records = query.GetRecordCount();
Assert.AreEqual(2, records);
}
示例10: ThemBenhNhan
/// <summary>
/// Thực hiện thêm mới thông tin không nhập qua phần tiếp đón
/// </summary>
/// <param name="TenBenhNhan">Tên bệnh nhân</param>
/// <param name="StudyInstanseUid">StudyInstanseUid</param>
/// <param name="SERIES_INSTANCE_UID">SERIES_INSTANCE_UID</param>
/// <param name="SOP_INSTANCE_UID">SOP_INSTANCE_UID</param>
/// <param name="IdDichVu">ID dịch vụ </param>
/// <param name="PathImage">Đường dẫn ảnh</param>
/// <returns></returns>
public ActionResult ThemBenhNhan(string TenBenhNhan,string GTinh, string StudyInstanseUid, string SERIES_INSTANCE_UID, string SOP_INSTANCE_UID, string BodyPart,string Position, string PathImage,string PathImage_thumb)
{
try
{
Query _QuerySoPhieu = RisPhieuCdinh.CreateQuery();
Query _QueryChiTiet = RisPhieuCdinhCtiet.CreateQuery();
using (var scope = new TransactionScope())
{
using (var sp = new SharedDbConnectionScope())
{
DateTime sysDateTime = BusinessHelper.GetSysDateTime();
RisBenhNhan objBenhNhan = new RisBenhNhan();
SqlQuery sqlQuery = new Select().From(RisPhieuCdinh.Schema)
.Where(RisPhieuCdinh.Columns.StudyInstanseUid).IsEqualTo(StudyInstanseUid);
RisPhieuCdinh objPhieuCdinh = new RisPhieuCdinh();
if(sqlQuery.GetRecordCount()<=0)
{
objBenhNhan = ThemMoiBenhNhan(TenBenhNhan, GTinh);
objPhieuCdinh.StudyInstanseUid = StudyInstanseUid;
objPhieuCdinh.IdBnhan = objBenhNhan.IdBnhan;
objPhieuCdinh.MaPhieu = BusinessHelper.LayMaPhieu();
objPhieuCdinh.Pid = objBenhNhan.Pid;
objPhieuCdinh.LoaiPhieu = 1;
// objPhieuCdinh.IdKhoaThien = -1;
//objPhieuCdinh.MaTbi = String.Empty;
objPhieuCdinh.NgayDky = sysDateTime;
objPhieuCdinh.NgayTao = sysDateTime;
objPhieuCdinh.NguoiTao = globalVariables.UserName;
objPhieuCdinh.IsNew = true;
objPhieuCdinh.Save();
objPhieuCdinh.IdPhieu = Utility.Int32Dbnull(_QuerySoPhieu.GetMax(RisPhieuCdinh.Columns.IdPhieu));
}
else
{
objPhieuCdinh = sqlQuery.ExecuteSingle<RisPhieuCdinh>();
new Update(RisBenhNhan.Schema)
.Set(RisBenhNhan.Columns.TenBnhan).EqualTo(TenBenhNhan)
.Set(RisBenhNhan.Columns.TenBnhanKdau).EqualTo(Utility.UnSignedCharacter(TenBenhNhan))
.Set(RisBenhNhan.Columns.Gtinh).EqualTo(GTinh)
.Where(RisBenhNhan.Columns.IdBnhan).IsEqualTo(objPhieuCdinh.IdBnhan).Execute();
}
sqlQuery = new Select().From(RisPhieuCdinhCtiet.Schema)
.Where(RisPhieuCdinhCtiet.Columns.IdPhieu).IsEqualTo(objPhieuCdinh.IdPhieu)
.And(RisPhieuCdinhCtiet.Columns.SeriesInstanceUid).IsEqualTo(SERIES_INSTANCE_UID)
.And(RisPhieuCdinhCtiet.Columns.StudyInstanceUid).IsEqualTo(StudyInstanseUid)
.And(RisPhieuCdinhCtiet.Columns.SopInstanceUid).IsEqualTo(SOP_INSTANCE_UID);
RisPhieuCdinhCtiet objRisPhieuCdinhCtiet = new RisPhieuCdinhCtiet();
if(sqlQuery.GetRecordCount()<=0)
{
SqlQuery sqlQueryDV = new Select().From(DDichVu.Schema)
.Where(DDichVu.Columns.MaDvu).IsEqualTo(Position)
.And(DDichVu.Columns.IdLoaiDvu).In(
new Select(DLoaiDvu.Columns.IdLoaiDvu).From(DLoaiDvu.Schema)
.Where(DLoaiDvu.Columns.MaLoaiDvu).
IsEqualTo(BodyPart));
DDichVu objDichVu = sqlQueryDV.ExecuteSingle<DDichVu>();
if (objDichVu != null)
{
objRisPhieuCdinhCtiet.IdDvu = Utility.Int32Dbnull(objDichVu.IdDvu, -1);
if (objDichVu != null)
{
objRisPhieuCdinhCtiet.IdLoaiDvu = objDichVu.IdLoaiDvu;
objRisPhieuCdinhCtiet.GhiChu = Utility.sDbnull(objDichVu.MoTa, "");
SqlQuery sqlQueryVungKS = new Select().From(DVungKsat.Schema)
.Where(DVungKsat.Columns.IdVungKs).IsEqualTo(objDichVu.IdVungKs);
DVungKsat objDVungKsat = sqlQueryVungKS.ExecuteSingle<DVungKsat>();
if (objDVungKsat != null)
{
objRisPhieuCdinhCtiet.VungKs = Utility.sDbnull(objDVungKsat.TenVungKs, "");
objRisPhieuCdinhCtiet.KetLuan = Utility.sDbnull(objDVungKsat.KetLuan, "");
objRisPhieuCdinhCtiet.DeNghi = Utility.sDbnull(objDVungKsat.DeNghi, "");
objRisPhieuCdinhCtiet.KyThuat = Utility.sDbnull(objDVungKsat.KyThuat, "");
objRisPhieuCdinhCtiet.MoTa = Utility.sDbnull(objDVungKsat.MoTa, "");
}
}
}
objRisPhieuCdinhCtiet.Sluong = 1;
objRisPhieuCdinhCtiet.DaIn = 0;
objRisPhieuCdinhCtiet.SeriesInstanceUid = SERIES_INSTANCE_UID;
objRisPhieuCdinhCtiet.SopInstanceUid = SOP_INSTANCE_UID;
objRisPhieuCdinhCtiet.StudyInstanceUid = objPhieuCdinh.StudyInstanseUid;
// objRisPhieuCdinhCtiet.DdanAnh = PathImage;
objRisPhieuCdinhCtiet.MaDvu = Position;
objRisPhieuCdinhCtiet.MaLoaiDvu = BodyPart;
objRisPhieuCdinhCtiet.MaTbi = string.Empty;
//.........这里部分代码省略.........
示例11: ThemMoiBenhNhan
private RisBenhNhan ThemMoiBenhNhan(string TenBenhNhan,string Gtinh)
{
DateTime sysDateTime = BusinessHelper.GetSysDateTime();
Query _Query = RisBenhNhan.CreateQuery();
RisBenhNhan objBenhNhan=new RisBenhNhan();
objBenhNhan.Pid = CommonBusiness.SinhPID();
objBenhNhan.TenBnhan = TenBenhNhan;
objBenhNhan.TenBnhanKdau = Utility.UnSignedCharacter(TenBenhNhan);
objBenhNhan.MaDtuong = "KHAC";
objBenhNhan.BvTrangthai = 0;
objBenhNhan.TrangThaiGui = 0;
objBenhNhan.Gtinh = Gtinh;
objBenhNhan.TenBnhanKdau = TenBenhNhan;
objBenhNhan.NamSinh = sysDateTime.Year;
objBenhNhan.NgayTao = sysDateTime;
objBenhNhan.IsNew = true;
objBenhNhan.Save();
objBenhNhan.IdBnhan = Utility.Int32Dbnull(_Query.GetMax(RisBenhNhan.Columns.IdBnhan), -1);
SqlQuery sqlQuery = new Select().From(RisBenhNhan.Schema)
.Where(RisBenhNhan.Columns.IdBnhan).IsNotEqualTo(objBenhNhan.IdBnhan)
.And(RisBenhNhan.Columns.Pid).IsEqualTo(objBenhNhan.Pid);
if(sqlQuery.GetRecordCount()>0)
{
objBenhNhan.Pid = VietBaIT.CommonLibrary.CommonBusiness.SinhPID();
new Update(RisBenhNhan.Schema)
.Set(RisBenhNhan.Columns.Pid).EqualTo(objBenhNhan.Pid)
.Where(RisBenhNhan.Columns.IdBnhan).IsEqualTo(objBenhNhan.IdBnhan).Execute();
}
return objBenhNhan;
}
示例12: Exec_SimpleJoin
public void Exec_SimpleJoin()
{
SubSonic.SqlQuery q = new Select("productid").From(OrderDetail.Schema)
.InnerJoin(Product.Schema)
.Where("CategoryID").IsEqualTo(5);
string sql = q.ToString();
int records = q.GetRecordCount();
Assert.IsTrue(records == 196);
}
示例13: Exec_SimpleAnd3
public void Exec_SimpleAnd3()
{
SubSonic.SqlQuery query = new
Select(Aggregate.GroupBy("ProductID"), Aggregate.Avg("UnitPrice"), Aggregate.Avg("Quantity"))
.From("Order Details")
.Where(Aggregate.Avg("UnitPrice"))
.IsGreaterThan(30)
.And(Aggregate.Avg("Quantity"))
.IsGreaterThan(20);
int records = query.GetRecordCount();
// Change to 17?
Assert.AreEqual(17, records); // Equal assertion failed: [[16]]!=[[17]]
}
示例14: Exec_PagedView
public void Exec_PagedView()
{
SubSonic.SqlQuery q = new Select().From(Invoice.Schema).Paged(1, 20);
int records = q.GetRecordCount();
Assert.IsTrue(records == 20);
}
示例15: Exec_SimpleAnd3
public void Exec_SimpleAnd3()
{
SubSonic.SqlQuery query = new
Select(Aggregate.GroupBy("ProductID"), Aggregate.Avg("UnitPrice"), Aggregate.Avg("Quantity"))
.From("Order Details");
query
.Where(Aggregate.Avg("UnitPrice"))
.IsGreaterThan(30)
.And(Aggregate.Avg("Quantity"))
.IsGreaterThan(20);
int records = query.GetRecordCount();
Assert.AreEqual(16, records);
}