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


C# QueryTerms类代码示例

本文整理汇总了C#中QueryTerms的典型用法代码示例。如果您正苦于以下问题:C# QueryTerms类的具体用法?C# QueryTerms怎么用?C# QueryTerms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


QueryTerms类属于命名空间,在下文中一共展示了QueryTerms类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            string username = context.Request.Params["username"];
            string password = context.Request.Params["password"];

            if (String.IsNullOrEmpty(username) || String.IsNullOrEmpty(password))
                return;

            List<ICriterion> criterionList = new List<ICriterion>();
            criterionList.Add(Restrictions.Eq("UserName", username));
            criterionList.Add(Restrictions.Eq("Password", password));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.CriterionList = criterionList;
            queryTerms.PersistentClass = typeof(SystemUser);

            List<SystemUser> userList = (List<SystemUser>)SystemUserBll.GetSystemUserList(queryTerms, false).Data;

            string script = "";
            if (userList == null || userList.Count != 1)
            {
                script = "$('#messageSpan').html(''); setTimeout(\"$('#messageSpan').html('用户名或密码错误……');\", 50);";
            }
            else
            {
                HttpContext.Current.Session["SystemUser"] = userList[0];
                script = "location.href='Default.htm';";
            }
            context.Response.Write(script);
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:30,代码来源:LoginApp.ashx.cs

示例2: GetOperationLogList

        public static ResultModel GetOperationLogList(QueryTerms queryTerms)
        {
            List<OperationLog> logList = new List<OperationLog>();
            int totalCount = 0;
            ResultModel result = new ResultModel();

            try
            {
                logList = (List<OperationLog>)(OperationLogDal.GetList(queryTerms));
                totalCount = Convert.ToInt32(OperationLogDal.GetTotalCount(queryTerms));

                result.Data = logList;
                result.DataSize = totalCount;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_SUCCESS;

                return result;;
            }
            catch (Exception exception)
            {
                result.Data = logList;
                result.DataSize = totalCount;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_ERROR;
                result.ResultMessage = exception.Message;
                return result;
            }
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:28,代码来源:OperationLogBll.cs

示例3: GetList

 /// <summary>
 /// 根据查询条件获取ServiceItem表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<ServiceItem> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<ServiceItem>(queryTerms);
 }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:9,代码来源:ServiceItemDal.cs

示例4: GetTotalCount

 /// <summary>
 /// 根据查询条件获取符合查询条件的总记录数
 /// </summary>
 /// <param name="queryTerms">封装的查询条件</param>
 /// <returns>总记录数</returns>
 public static object GetTotalCount(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetTotalCount(queryTerms);
 }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:9,代码来源:CobminationItemDal.cs

示例5: QueryRecord

        /// <summary>
        /// 复杂查询操作
        /// </summary>
        protected void QueryRecord()
        {
            HttpContext context = HttpContext.Current;
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;

            string pageSize = request.Params["pageSize"];
            string pageIndex = request.Params["pageIndex"];

            string addTime=request.Params["textAddTime"];
            string cardId=request.Params["textCardId"];
            string conComId=request.Params["textConComId"];
            string consumerId=request.Params["textConsumerId"];
            string itemId=request.Params["textItemId"];
            string logId=request.Params["textLogId"];

            CriterionAndOrder consumptionLogCriterionAndOrder = new CriterionAndOrder();
            consumptionLogCriterionAndOrder.CriteriaName = typeof(ConsumptionLog).FullName;
            consumptionLogCriterionAndOrder.CriteriaAsName = "CL";
            consumptionLogCriterionAndOrder.OrderList.Add(new Order("CL.AddTime", false));

            CriterionAndOrder membershipCardCriterionAndOrder = new CriterionAndOrder();
            membershipCardCriterionAndOrder.CriteriaName ="CardRef" ;
            membershipCardCriterionAndOrder.CriteriaAsName = "MC";
            membershipCardCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            CriterionAndOrder consumptionCombinationCriterionAndOrder = new CriterionAndOrder();
            consumptionCombinationCriterionAndOrder.CriteriaName ="ConComRef" ;
            consumptionCombinationCriterionAndOrder.CriteriaAsName = "CC";
            consumptionCombinationCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            CriterionAndOrder consumerCriterionAndOrder = new CriterionAndOrder();
            consumerCriterionAndOrder.CriteriaName ="ConsumerRef" ;
            consumerCriterionAndOrder.CriteriaAsName = "C";
            consumerCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            CriterionAndOrder serviceItemCriterionAndOrder = new CriterionAndOrder();
            serviceItemCriterionAndOrder.CriteriaName ="ItemRef" ;
            serviceItemCriterionAndOrder.CriteriaAsName = "SI";
            serviceItemCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            if (!String.IsNullOrEmpty(addTime))
                consumptionLogCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CL.AddTime", Convert.ToDateTime(addTime)));
            if (!String.IsNullOrEmpty(cardId))
                consumptionLogCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CL.CardId", cardId));
            if (!String.IsNullOrEmpty(conComId))
                consumptionLogCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CL.ConComId", conComId));
            if (!String.IsNullOrEmpty(consumerId))
                consumptionLogCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CL.ConsumerId", consumerId));
            if (!String.IsNullOrEmpty(itemId))
                consumptionLogCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CL.ItemId", itemId));
            if (!String.IsNullOrEmpty(logId))
                consumptionLogCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CL.LogId", logId));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("CL.LogId").As("PrimaryKey"));
            pList.Add(Projections.Property("CL.AddTime").As("AddTime"));
            pList.Add(Projections.Property("MC.CardId").As("CardId"));
            pList.Add(Projections.Property("CC.ConComId").As("ConComId"));
            pList.Add(Projections.Property("C.ConsumerId").As("ConsumerId"));
            pList.Add(Projections.Property("SI.ItemId").As("ItemId"));
            pList.Add(Projections.Property("CL.LogId").As("LogId"));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(ConsumptionLog);
            queryTerms.ColumnList = pList;
            queryTerms.CriterionAndOrderList.Add(consumptionLogCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(membershipCardCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(consumptionCombinationCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(consumerCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(serviceItemCriterionAndOrder);
            queryTerms.PageSize = Convert.ToInt32(pageSize);
            queryTerms.PageIndex = Convert.ToInt32(pageIndex) - 1;

            ResultModel result = ConsumptionLogBll.GetConsumptionLogList(queryTerms);

            string jsonString = JsonConvert.SerializeObject(result, new JsonSerializerSettings()
            {
                NullValueHandling=NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            response.Write(jsonString);
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:87,代码来源:ConsumptionLogApp.ashx.cs

示例6: QueryRecord

        /// <summary>
        /// 复杂查询操作
        /// </summary>
        protected void QueryRecord()
        {
            HttpContext context = HttpContext.Current;
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;

            string pageSize = request.Params["pageSize"];
            string pageIndex = request.Params["pageIndex"];

            string actualBeginTime=request.Params["textActualBeginTime"];
            string actualDurationTime=request.Params["textActualDurationTime"];
            string actualEndTime=request.Params["textActualEndTime"];
            string actualUserNo=request.Params["textActualUserNo"];
            string addTime=request.Params["textAddTime"];
            string adminId=request.Params["textAdminId"];
            string conferenceId=request.Params["textConferenceId"];
            string createrId=request.Params["textCreaterId"];
            string maxUserNo=request.Params["textMaxUserNo"];
            string password=request.Params["textPassword"];
            string reserBeginTime=request.Params["textReserBeginTime"];
            string reserDurationTime=request.Params["textReserDurationTime"];
            string reserEndTime=request.Params["textReserEndTime"];
            string updateTime=request.Params["textUpdateTime"];

            CriterionAndOrder conferenceCriterionAndOrder = new CriterionAndOrder();
            conferenceCriterionAndOrder.CriteriaName = typeof(Conference).FullName;
            conferenceCriterionAndOrder.CriteriaAsName = "C";
            conferenceCriterionAndOrder.OrderList.Add(new Order("C.AddTime", false));

            CriterionAndOrder systemUserCriterionAndOrder = new CriterionAndOrder();
            systemUserCriterionAndOrder.CriteriaName ="AdminRef" ;
            systemUserCriterionAndOrder.CriteriaAsName = "SU";
            systemUserCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            CriterionAndOrder systemUserCriterionAndOrder = new CriterionAndOrder();
            systemUserCriterionAndOrder.CriteriaName ="CreaterRef" ;
            systemUserCriterionAndOrder.CriteriaAsName = "SU";
            systemUserCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            if (!String.IsNullOrEmpty(actualBeginTime))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ActualBeginTime", Convert.ToDateTime(actualBeginTime)));
            if (!String.IsNullOrEmpty(actualDurationTime))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ActualDurationTime", Convert.ToInt32(actualDurationTime)));
            if (!String.IsNullOrEmpty(actualEndTime))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ActualEndTime", Convert.ToDateTime(actualEndTime)));
            if (!String.IsNullOrEmpty(actualUserNo))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ActualUserNo", Convert.ToInt32(actualUserNo)));
            if (!String.IsNullOrEmpty(addTime))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.AddTime", Convert.ToDateTime(addTime)));
            if (!String.IsNullOrEmpty(adminId))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.AdminId", adminId));
            if (!String.IsNullOrEmpty(conferenceId))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ConferenceId", conferenceId));
            if (!String.IsNullOrEmpty(createrId))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.CreaterId", createrId));
            if (!String.IsNullOrEmpty(maxUserNo))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.MaxUserNo", Convert.ToInt32(maxUserNo)));
            if (!String.IsNullOrEmpty(password))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.Password", password));
            if (!String.IsNullOrEmpty(reserBeginTime))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ReserBeginTime", Convert.ToDateTime(reserBeginTime)));
            if (!String.IsNullOrEmpty(reserDurationTime))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ReserDurationTime", reserDurationTime));
            if (!String.IsNullOrEmpty(reserEndTime))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ReserEndTime", Convert.ToDateTime(reserEndTime)));
            if (!String.IsNullOrEmpty(updateTime))
                conferenceCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.UpdateTime", Convert.ToDateTime(updateTime)));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("C.ConferenceId").As("PrimaryKey"));
            pList.Add(Projections.Property("C.ActualBeginTime").As("ActualBeginTime"));
            pList.Add(Projections.Property("C.ActualDurationTime").As("ActualDurationTime"));
            pList.Add(Projections.Property("C.ActualEndTime").As("ActualEndTime"));
            pList.Add(Projections.Property("C.ActualUserNo").As("ActualUserNo"));
            pList.Add(Projections.Property("C.AddTime").As("AddTime"));
            pList.Add(Projections.Property("SU.UserId").As("AdminId"));
            pList.Add(Projections.Property("C.ConferenceId").As("ConferenceId"));
            pList.Add(Projections.Property("SU.UserId").As("CreaterId"));
            pList.Add(Projections.Property("C.MaxUserNo").As("MaxUserNo"));
            pList.Add(Projections.Property("C.Password").As("Password"));
            pList.Add(Projections.Property("C.ReserBeginTime").As("ReserBeginTime"));
            pList.Add(Projections.Property("C.ReserDurationTime").As("ReserDurationTime"));
            pList.Add(Projections.Property("C.ReserEndTime").As("ReserEndTime"));
            pList.Add(Projections.Property("C.UpdateTime").As("UpdateTime"));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(Conference);
            queryTerms.ColumnList = pList;
            queryTerms.CriterionAndOrderList.Add(conferenceCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(systemUserCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(systemUserCriterionAndOrder);
            queryTerms.PageSize = Convert.ToInt32(pageSize);
            queryTerms.PageIndex = Convert.ToInt32(pageIndex) - 1;

            ResultModel result = ConferenceBll.GetConferenceList(queryTerms);

            string jsonString = JsonConvert.SerializeObject(result, new JsonSerializerSettings()
//.........这里部分代码省略.........
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:101,代码来源:ConferenceApp.ashx.cs

示例7: GetCardUserList

        /// <summary>
        /// 根据查询条件获取CardUser表中符合查询条件的记录
        /// </summary>
        /// <param name="queryTerms">自定义查询条件</param>
        /// <returns>查询结果,封装了查询的数据信息</returns>
        public static ResultModel GetCardUserList(QueryTerms queryTerms)
        {
            List<CardUser> cardUserList = new List<CardUser>();
            OperationLog log = new OperationLog();
            int totalCount = 0;
            ResultModel result = new ResultModel();

            try
            {
                log.AddTime = DateTime.Now;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_TRUE;
                log.OperationLogId = System.Guid.NewGuid().ToString("N");
                log.OperationContent = SymbolicConstant.OPERATIONCONTENT_GETLIST;
                log.OperationTable = typeof(CardUser).Name;
                log.OperationTypeCode =SymbolicConstant.OPERATIONTYPE_GETLIST;
                log.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_SUCCESS;
                log.ResultMessage=SymbolicConstant.RESULTMESSAGE_GETLIST_SUCCESS;
                log.UserId = CurrentSession.getUser().UserId;

                cardUserList = (List<CardUser>)(CardUserDal.GetList(queryTerms));
                totalCount=Convert.ToInt32(SystemUserDal.GetTotalCount(queryTerms));

                log.TotalCount = totalCount;
                result.Data = cardUserList;
                result.DataSize = totalCount;
                result.IsSuccess = true;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_SUCCESS;
                result.ResultMessage = SymbolicConstant.RESULTMESSAGE_GETLIST_SUCCESS;

                return result;
            }
            catch (Exception exception)
            {
                log.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_ERROR;
                log.IsSuccessId = SymbolicConstant.ISSUCCESS_FALSE;
                log.ResultMessage=exception.Message;

                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
            finally
            {
                OperationLogBll.Insert(log);
            }
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:53,代码来源:CardUserBll.cs

示例8: QueryRecord

        /// <summary>
        /// 复杂查询操作
        /// </summary>
        protected void QueryRecord()
        {
            HttpContext context = HttpContext.Current;
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;

            string pageSize = request.Params["pageSize"];
            string pageIndex = request.Params["pageIndex"];

            string addTime=request.Params["textAddTime"];
            string description=request.Params["textDescription"];
            string imageId=request.Params["textImageId"];
            string patientId=request.Params["textPatientId"];
            string type=request.Params["textType"];
            string updateTime=request.Params["textUpdateTime"];
            string url=request.Params["textUrl"];

            CriterionAndOrder digitalImageCriterionAndOrder = new CriterionAndOrder();
            digitalImageCriterionAndOrder.CriteriaName = typeof(DigitalImage).FullName;
            digitalImageCriterionAndOrder.CriteriaAsName = "DI";
            digitalImageCriterionAndOrder.OrderList.Add(new Order("DI.AddTime", false));

            if (!String.IsNullOrEmpty(addTime))
                digitalImageCriterionAndOrder.CriterionList.Add(Restrictions.Eq("DI.AddTime", Convert.ToDateTime(addTime)));
            if (!String.IsNullOrEmpty(description))
                digitalImageCriterionAndOrder.CriterionList.Add(Restrictions.Eq("DI.Description", description));
            if (!String.IsNullOrEmpty(imageId))
                digitalImageCriterionAndOrder.CriterionList.Add(Restrictions.Eq("DI.ImageId", imageId));
            if (!String.IsNullOrEmpty(patientId))
                digitalImageCriterionAndOrder.CriterionList.Add(Restrictions.Eq("DI.PatientId", patientId));
            if (!String.IsNullOrEmpty(type))
                digitalImageCriterionAndOrder.CriterionList.Add(Restrictions.Eq("DI.Type", type));
            if (!String.IsNullOrEmpty(updateTime))
                digitalImageCriterionAndOrder.CriterionList.Add(Restrictions.Eq("DI.UpdateTime", Convert.ToDateTime(updateTime)));
            if (!String.IsNullOrEmpty(url))
                digitalImageCriterionAndOrder.CriterionList.Add(Restrictions.Eq("DI.Url", url));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("DI.ImageId").As("PrimaryKey"));
            pList.Add(Projections.Property("DI.AddTime").As("AddTime"));
            pList.Add(Projections.Property("DI.Description").As("Description"));
            pList.Add(Projections.Property("DI.ImageId").As("ImageId"));
            pList.Add(Projections.Property("DI.PatientId").As("PatientId"));
            pList.Add(Projections.Property("DI.Type").As("Type"));
            pList.Add(Projections.Property("DI.UpdateTime").As("UpdateTime"));
            pList.Add(Projections.Property("DI.Url").As("Url"));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(DigitalImage);
            queryTerms.ColumnList = pList;
            queryTerms.CriterionAndOrderList.Add(digitalImageCriterionAndOrder);
            queryTerms.PageSize = Convert.ToInt32(pageSize);
            queryTerms.PageIndex = Convert.ToInt32(pageIndex) - 1;

            ResultModel result = DigitalImageBll.GetDigitalImageList(queryTerms);

            string jsonString = JsonConvert.SerializeObject(result, new JsonSerializerSettings()
            {
                NullValueHandling=NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            response.Write(jsonString);
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:67,代码来源:DigitalImageApp.ashx.cs

示例9: GetModuleListByRole

        /// <summary>
        /// 根据角色查询相应功能模块
        /// </summary>
        protected void GetModuleListByRole()
        {
            HttpContext context = HttpContext.Current;
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;

            string roleId= request.Params["roleId"];

            CriterionAndOrder moduleCriterionAndOrder = new CriterionAndOrder();
            moduleCriterionAndOrder.CriteriaName = typeof(FunctionModule).FullName;
            moduleCriterionAndOrder.CriteriaAsName = "FE";

            CriterionAndOrder roleCriterionAndOrder = new CriterionAndOrder();
            roleCriterionAndOrder.CriteriaName = "Role";
            roleCriterionAndOrder.CriteriaAsName = "RO";
            roleCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.InnerJoin;

            if (!String.IsNullOrEmpty(roleId))
                moduleCriterionAndOrder.CriterionList.Add(Restrictions.Eq("RO.RoleId", roleId));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("FE.ModuleId").As("ModuleId"));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(FunctionModule);
            queryTerms.ColumnList = pList;
            queryTerms.CriterionAndOrderList.Add(moduleCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(roleCriterionAndOrder);

            ResultModel result = FunctionModuleBll.GetFunctionModuleList(queryTerms);

            string jsonString = JsonConvert.SerializeObject(result, new JsonSerializerSettings()
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            response.Write(jsonString);
        }
开发者ID:ZeeMenng,项目名称:VideoConsultation,代码行数:41,代码来源:FunctionModuleApp.ashx.cs

示例10: GetList

 /// <summary>
 /// 根据查询条件获取ConferenceMember表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<ConferenceMember> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<ConferenceMember>(queryTerms);
 }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:9,代码来源:ConferenceMemberDal.cs

示例11: QueryRecord

        /// <summary>
        /// 复杂查询操作
        /// </summary>
        protected void QueryRecord()
        {
            HttpContext context = HttpContext.Current;
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;

            string pageSize = request.Params["pageSize"];
            string pageIndex = request.Params["pageIndex"];

            string addTime=request.Params["textAddTime"];
            string cardTypeId=request.Params["textCardTypeId"];
            string description=request.Params["textDescription"];
            string expense=request.Params["textExpense"];
            string name=request.Params["textName"];
            string updateTime=request.Params["textUpdateTime"];
            string validityDate=request.Params["textValidityDate"];
            string validityTime=request.Params["textValidityTime"];

            CriterionAndOrder cardTypeCriterionAndOrder = new CriterionAndOrder();
            cardTypeCriterionAndOrder.CriteriaName = typeof(CardType).FullName;
            cardTypeCriterionAndOrder.CriteriaAsName = "CT";
            cardTypeCriterionAndOrder.OrderList.Add(new Order("CT.AddTime", false));

            if (!String.IsNullOrEmpty(addTime))
                cardTypeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CT.AddTime", Convert.ToDateTime(addTime)));
            if (!String.IsNullOrEmpty(cardTypeId))
                cardTypeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CT.CardTypeId", cardTypeId));
            if (!String.IsNullOrEmpty(description))
                cardTypeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CT.Description", description));
            if (!String.IsNullOrEmpty(expense))
                cardTypeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CT.Expense", expense));
            if (!String.IsNullOrEmpty(name))
                cardTypeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CT.Name", name));
            if (!String.IsNullOrEmpty(updateTime))
                cardTypeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CT.UpdateTime", Convert.ToDateTime(updateTime)));
            if (!String.IsNullOrEmpty(validityDate))
                cardTypeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CT.ValidityDate", Convert.ToDateTime(validityDate)));
            if (!String.IsNullOrEmpty(validityTime))
                cardTypeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CT.ValidityTime", validityTime));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("CT.CardTypeId").As("PrimaryKey"));
            pList.Add(Projections.Property("CT.AddTime").As("AddTime"));
            pList.Add(Projections.Property("CT.CardTypeId").As("CardTypeId"));
            pList.Add(Projections.Property("CT.Description").As("Description"));
            pList.Add(Projections.Property("CT.Expense").As("Expense"));
            pList.Add(Projections.Property("CT.Name").As("Name"));
            pList.Add(Projections.Property("CT.UpdateTime").As("UpdateTime"));
            pList.Add(Projections.Property("CT.ValidityDate").As("ValidityDate"));
            pList.Add(Projections.Property("CT.ValidityTime").As("ValidityTime"));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(CardType);
            queryTerms.ColumnList = pList;
            queryTerms.CriterionAndOrderList.Add(cardTypeCriterionAndOrder);
            queryTerms.PageSize = Convert.ToInt32(pageSize);
            queryTerms.PageIndex = Convert.ToInt32(pageIndex) - 1;

            ResultModel result = CardTypeBll.GetCardTypeList(queryTerms);

            string jsonString = JsonConvert.SerializeObject(result, new JsonSerializerSettings()
            {
                NullValueHandling=NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            response.Write(jsonString);
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:71,代码来源:CardTypeApp.ashx.cs

示例12: QueryRecord

        /// <summary>
        /// 复杂查询操作
        /// </summary>
        protected void QueryRecord()
        {
            HttpContext context = HttpContext.Current;
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;

            string pageSize = request.Params["pageSize"];
            string pageIndex = request.Params["pageIndex"];

            //keywords是处理AutoComplete下接框查询时设置的传入参数
            string keywords = request.Params["keywords"];
            string pageName = request.Params["textPageName"];
            string url = request.Params["textUrl"];

            List<ICriterion> criterionList = new List<ICriterion>();
            if (!String.IsNullOrEmpty(pageName))
                criterionList.Add(Restrictions.Like("PageName", "%" + pageName + "%"));
            if (!String.IsNullOrEmpty(url))
                criterionList.Add(Restrictions.Like("Url", "%" + url + "%"));
            if (!String.IsNullOrEmpty(keywords))
                criterionList.Add(Restrictions.Like("Url", "%" + keywords + "%"));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("PageId").As("PrimaryKey"));
            pList.Add(Projections.Property("PageId").As("PageId"));
            pList.Add(Projections.Property("PageName").As("PageName"));
            pList.Add(Projections.Property("Url").As("Url"));
            pList.Add(Projections.Property("AddTime").As("AddTime"));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(WebPage);
            queryTerms.ColumnList = pList;
            queryTerms.CriterionList = criterionList;
            queryTerms.PageSize = Convert.ToInt32(pageSize);
            queryTerms.PageIndex = Convert.ToInt32(pageIndex) - 1;
            queryTerms.OrderList.Add(new Order("Url", false));

            ResultModel result = WebPageBll.GetWebPageList(queryTerms);
            string jsonString = JsonConvert.SerializeObject(result);
            response.Write(jsonString);
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:44,代码来源:WebPageApp.ashx.cs

示例13: IfHavePage

        protected bool IfHavePage(string url)
        {
            List<ICriterion> criterionList = new List<ICriterion>();

            criterionList.Add(Restrictions.Eq("Url", url));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(WebPage);
            queryTerms.CriterionList = criterionList;
            queryTerms.OrderList.Add(new Order("AddTime", false));

            ResultModel result = WebPageBll.GetWebPageList(queryTerms);
            List<WebPage> list = (List<WebPage>)result.Data;
            if (list.Count == 0)
                return false;
            return true;
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:17,代码来源:WebPageApp.ashx.cs

示例14: QueryRecord

        /// <summary>
        /// 复杂查询操作
        /// </summary>
        protected void QueryRecord()
        {
            HttpContext contenxt = HttpContext.Current;
            HttpRequest request = contenxt.Request;
            HttpResponse response = contenxt.Response;

            string pageSize = request.Params["pageSize"];
            string pageIndex = request.Params["pageIndex"];
            string userName = request.Params["textUserName"];
            string realName = request.Params["textRealName"];
            string beginAddTime = request.Params["textBeginAddTime"];
            string endAddTime = request.Params["textEndAddTime"];
            string onlineFlagId = request.Params["selectOnlineFlag"];

            CriterionAndOrder systemUserCriterionAndOrder = new CriterionAndOrder();
            systemUserCriterionAndOrder.CriteriaName = typeof(SystemUser).FullName;
            systemUserCriterionAndOrder.CriteriaAsName = "SU";
            systemUserCriterionAndOrder.OrderList.Add(new Order("SU.AddTime", false));

            if (!String.IsNullOrEmpty(userName))
                systemUserCriterionAndOrder.CriterionList.Add(Restrictions.Like("SU.UserName", "%" + userName + "%"));
            if (!String.IsNullOrEmpty(realName))
                systemUserCriterionAndOrder.CriterionList.Add(Restrictions.Like("SU.RealName", "%" + realName + "%"));
            if (!String.IsNullOrEmpty(beginAddTime))
                systemUserCriterionAndOrder.CriterionList.Add(Restrictions.Gt("SU.AddTime", Convert.ToDateTime(beginAddTime)));
            if (!String.IsNullOrEmpty(endAddTime))
                systemUserCriterionAndOrder.CriterionList.Add(Restrictions.Lt("SU.AddTime", Convert.ToDateTime(endAddTime)));
            if (!String.IsNullOrEmpty(onlineFlagId))
                systemUserCriterionAndOrder.CriterionList.Add(Restrictions.Eq("SU.OnlineFlagId", Convert.ToChar(onlineFlagId)));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("SU.GenderName").As("GenderName"));
            pList.Add(Projections.Property("SU.OnlineFlagName").As("OnlineFlagName"));
            pList.Add(Projections.Property("SU.UserId").As("UserId"));
            pList.Add(Projections.Property("SU.UserId").As("PrimaryKey"));
            pList.Add(Projections.Property("SU.UserName").As("UserName"));
            pList.Add(Projections.Property("SU.RealName").As("RealName"));
            pList.Add(Projections.Property("SU.AddTime").As("AddTime"));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(SystemUser);
            queryTerms.ColumnList = pList;
            queryTerms.CriterionAndOrderList.Add(systemUserCriterionAndOrder);

            queryTerms.PageSize = Convert.ToInt32(pageSize);
            queryTerms.PageIndex = Convert.ToInt32(pageIndex) - 1;

            ResultModel result = SystemUserBll.GetSystemUserList(queryTerms);

            string jsonString = JsonConvert.SerializeObject(result, new JsonSerializerSettings()
            {
                NullValueHandling = NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            response.Write(jsonString);
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:60,代码来源:SystemUserApp.ashx.cs

示例15: QueryRecord

        /// <summary>
        /// 复杂查询操作
        /// </summary>
        protected void QueryRecord()
        {
            HttpContext context = HttpContext.Current;
            HttpRequest request = context.Request;
            HttpResponse response = context.Response;

            string pageSize = request.Params["pageSize"];
            string pageIndex = request.Params["pageIndex"];

            string addTime=request.Params["textAddTime"];
            string chiefComplaint=request.Params["textChiefComplaint"];
            string confirmedDiagnostic=request.Params["textConfirmedDiagnostic"];
            string consumerId=request.Params["textConsumerId"];
            string description=request.Params["textDescription"];
            string historyPresentIllness=request.Params["textHistoryPresentIllness"];
            string inHospitalDiagnostic=request.Params["textInHospitalDiagnostic"];
            string phyExamNum=request.Params["textPhyExamNum"];
            string physicalExam=request.Params["textPhysicalExam"];
            string physicalExamDate=request.Params["textPhysicalExamDate"];
            string recordId=request.Params["textRecordId"];
            string representor=request.Params["textRepresentor"];
            string updateTime=request.Params["textUpdateTime"];

            CriterionAndOrder medicalRecordCriterionAndOrder = new CriterionAndOrder();
            medicalRecordCriterionAndOrder.CriteriaName = typeof(MedicalRecord).FullName;
            medicalRecordCriterionAndOrder.CriteriaAsName = "MR";
            medicalRecordCriterionAndOrder.OrderList.Add(new Order("MR.AddTime", false));

            CriterionAndOrder consumerCriterionAndOrder = new CriterionAndOrder();
            consumerCriterionAndOrder.CriteriaName ="ConsumerRef" ;
            consumerCriterionAndOrder.CriteriaAsName = "C";
            consumerCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            if (!String.IsNullOrEmpty(addTime))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.AddTime", Convert.ToDateTime(addTime)));
            if (!String.IsNullOrEmpty(chiefComplaint))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.ChiefComplaint", chiefComplaint));
            if (!String.IsNullOrEmpty(confirmedDiagnostic))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.ConfirmedDiagnostic", confirmedDiagnostic));
            if (!String.IsNullOrEmpty(consumerId))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.ConsumerId", consumerId));
            if (!String.IsNullOrEmpty(description))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.Description", description));
            if (!String.IsNullOrEmpty(historyPresentIllness))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.HistoryPresentIllness", historyPresentIllness));
            if (!String.IsNullOrEmpty(inHospitalDiagnostic))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.InHospitalDiagnostic", inHospitalDiagnostic));
            if (!String.IsNullOrEmpty(phyExamNum))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.PhyExamNum", phyExamNum));
            if (!String.IsNullOrEmpty(physicalExam))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.PhysicalExam", physicalExam));
            if (!String.IsNullOrEmpty(physicalExamDate))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.PhysicalExamDate", Convert.ToDateTime(physicalExamDate)));
            if (!String.IsNullOrEmpty(recordId))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.RecordId", recordId));
            if (!String.IsNullOrEmpty(representor))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.Representor", representor));
            if (!String.IsNullOrEmpty(updateTime))
                medicalRecordCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MR.UpdateTime", Convert.ToDateTime(updateTime)));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("MR.RecordId").As("PrimaryKey"));
            pList.Add(Projections.Property("MR.AddTime").As("AddTime"));
            pList.Add(Projections.Property("MR.ChiefComplaint").As("ChiefComplaint"));
            pList.Add(Projections.Property("MR.ConfirmedDiagnostic").As("ConfirmedDiagnostic"));
            pList.Add(Projections.Property("C.ConsumerId").As("ConsumerId"));
            pList.Add(Projections.Property("MR.Description").As("Description"));
            pList.Add(Projections.Property("MR.HistoryPresentIllness").As("HistoryPresentIllness"));
            pList.Add(Projections.Property("MR.InHospitalDiagnostic").As("InHospitalDiagnostic"));
            pList.Add(Projections.Property("MR.PhyExamNum").As("PhyExamNum"));
            pList.Add(Projections.Property("MR.PhysicalExam").As("PhysicalExam"));
            pList.Add(Projections.Property("MR.PhysicalExamDate").As("PhysicalExamDate"));
            pList.Add(Projections.Property("MR.RecordId").As("RecordId"));
            pList.Add(Projections.Property("MR.Representor").As("Representor"));
            pList.Add(Projections.Property("MR.UpdateTime").As("UpdateTime"));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(MedicalRecord);
            queryTerms.ColumnList = pList;
            queryTerms.CriterionAndOrderList.Add(medicalRecordCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(consumerCriterionAndOrder);
            queryTerms.PageSize = Convert.ToInt32(pageSize);
            queryTerms.PageIndex = Convert.ToInt32(pageIndex) - 1;

            ResultModel result = MedicalRecordBll.GetMedicalRecordList(queryTerms);

            string jsonString = JsonConvert.SerializeObject(result, new JsonSerializerSettings()
            {
                NullValueHandling=NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            response.Write(jsonString);
        }
开发者ID:ZeeMenng,项目名称:HealthManagement,代码行数:97,代码来源:MedicalRecordApp.ashx.cs


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