当前位置: 首页>>代码示例>>C#>>正文


C# SqlQuery.GetRecordCount方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:khaha2210,项目名称:CodeNewHis,代码行数:33,代码来源:KCB_HinhAnh.cs

示例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;
            }
        }
开发者ID:khaha2210,项目名称:VXIS,代码行数:29,代码来源:THU_VIEN_CHUNG.cs

示例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;

        }
开发者ID:khaha2210,项目名称:radio,代码行数:12,代码来源:CommonLibrary.cs

示例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()));
                }
            }
        }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:35,代码来源:QuickTable.cs

示例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;
               }
        }
开发者ID:vmshis2020,项目名称:VMSHISServer,代码行数:29,代码来源:THU_VIEN_CHUNG.cs


注:本文中的SqlQuery.GetRecordCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。