本文整理汇总了C#中SqlQuery.GetRecordCount方法的典型用法代码示例。如果您正苦于以下问题:C# SqlQuery.GetRecordCount方法的具体用法?C# SqlQuery.GetRecordCount怎么用?C# SqlQuery.GetRecordCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlQuery
的用法示例。
在下文中一共展示了SqlQuery.GetRecordCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateSysConfigRadio
public ActionResult UpdateSysConfigRadio(SysConfigRadio objConfigRadio)
{
try
{
using (var scope = new TransactionScope())
{
using (var sp = new SharedDbConnectionScope())
{
SqlQuery q =
new SqlQuery().From(SysConfigRadio.Schema).Where(SysConfigRadio.Columns.SysId).IsEqualTo(1);
if(q.GetRecordCount()<=0)
{
objConfigRadio.IsNew = true;
objConfigRadio.Save();
}else
{
new Update(SysConfigRadio.Schema)
.Set(SysConfigRadio.PassWordColumn).EqualTo(objConfigRadio.PassWord)
.Set(SysConfigRadio.UserNameColumn).EqualTo(objConfigRadio.UserName)
.Set(SysConfigRadio.DomainColumn).EqualTo(objConfigRadio.Domain)
.Set(SysConfigRadio.PathUNCColumn).EqualTo(objConfigRadio.PathUNC)
.Where(SysConfigRadio.SysIdColumn).IsEqualTo(1).Execute();
}
}
scope.Complete();
return ActionResult.Success;
}
}
catch (Exception exception)
{
return ActionResult.Error;
}
}
示例2: CorrectLinePatientExam
public static bool CorrectLinePatientExam(string vClinicCode)
{
DataTable dataTable = new DataTable();
dataTable = SPs.DetmayGetClinicCode(vClinicCode).GetDataSet().Tables[0];
if (dataTable.Rows.Count > 0)
{
SqlQuery q = new SqlQuery().From(SysSystemParameter.Schema)
.Where(SysSystemParameter.Columns.SName).IsEqualTo("ACCOUNTCLINIC");
if (q.GetRecordCount() > 0)
{
SysSystemParameter objParameter = q.ExecuteSingle<SysSystemParameter>();
if (objParameter.SValue.Contains(vClinicCode)) return true;
else
{
return false;
}
}
else
{
return false;
}
}
else
{
return true;
}
}
示例3: AllowDelete
/// <summary>
/// hàm cho phép thực hiện công việc
/// </summary>
/// <param name="q">câu lệnh sql của subsonic</param>
/// <returns></returns>
public static bool AllowDelete(SqlQuery q)
{
int recordcount = q.GetRecordCount();
if (recordcount > 0) return false;
else return true;
}
示例4: EnsureTotals
/// <summary>
/// Ensures the totals.
/// </summary>
/// <param name="qry">The qry.</param>
private void EnsureTotals(SqlQuery qry)
{
//if there's paging, we have to run an initial query to figure out
//how many records we have
//we should only do this once...
if(pageSize > 0)
{
if(ViewState[TOTAL_RECORDS] == null)
{
//set it
int originalPageSize = qry.PageSize;
qry.PageSize = 0;
TotalRecords = qry.GetRecordCount();
qry.PageSize = originalPageSize;
ViewState[TOTAL_RECORDS] = TotalRecords;
}
else
TotalRecords = (int)ViewState[TOTAL_RECORDS];
//the pages are the records/pageSize+1
//totalPages = (totalPages % pageSize == 0) ? totalRecords / pageSize : totalRecords / pageSize + 1;
totalPages = (totalRecords % pageSize == 0) ? totalRecords / pageSize : totalRecords / pageSize + 1;
lblRecordCount.Text = " of " + totalPages + " (" + totalRecords + " total) ";
if(ddlPages.Items.Count == 0)
{
//set up the dropDown
for(int i = 1; i <= totalPages; i++)
ddlPages.Items.Add(new ListItem(i.ToString(), i.ToString()));
}
}
}
示例5: KiemtraDungtuyenTraituyen
public static bool KiemtraDungtuyenTraituyen(string vClinicCode)
{
DataTable dataTable = new DataTable();
dataTable = SPs.DmucLaydanhsachNoikcbbd(vClinicCode).GetDataSet().Tables[0];
if (dataTable.Rows.Count > 0)
{
SqlQuery q = new SqlQuery().From(SysSystemParameter.Schema)
.Where(SysSystemParameter.Columns.SName).IsEqualTo("BHYT_NOIDANGKY_KCBBD");
if (q.GetRecordCount() > 0)
{
SysSystemParameter objParameter = q.ExecuteSingle<SysSystemParameter>();
if (objParameter.SValue.Contains(vClinicCode)) return true;
else
{
return false;
}
}
else
{
return false;
}
}
else
{
return true;
}
}