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);
        }
        public IActionResult BuyEvaluateList()
        {
            QueryTerms qry = new QueryTerms();

            qry.flowtyp = "待處理";
            return(PartialView("_BuyEvaluateList", GetList(qry, "")));
        }
        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;
            }
        }
        public async Task <IViewComponentResult> InvokeAsync(string id = null, string sid = null)
        {
            QueryTerms qry = new QueryTerms();

            qry.flowtyp = "待處理";
            var list = new BuyEvaluateController(_context, _userRepo, _dptRepo, _emailSender, userManager, roleManager).GetList(qry, "");

            return(View(list));
        }
        /// <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);
        }
        /// <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()
            {
                NullValueHandling=NullValueHandling.Ignore,
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            response.Write(jsonString);
        }
Example #7
0
        /// <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);
            }
        }
Example #8
0
 /// <summary>
 /// Indicates whether this query includes any of the specified terms
 /// </summary>
 public bool HasAny(QueryTerms terms) => (ActiveTerms & terms) != 0;
        /// <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);
        }
        /// <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 actualDoctorId=request.Params["textActualDoctorId"];
            string actualDoctorId2=request.Params["textActualDoctorId2"];
            string actualDoctorId3=request.Params["textActualDoctorId3"];
            string actualDoctorId4=request.Params["textActualDoctorId4"];
            string addTime=request.Params["textAddTime"];
            string arrangeConTime=request.Params["textArrangeConTime"];
            string beginConTime=request.Params["textBeginConTime"];
            string callerId=request.Params["textCallerId"];
            string cancelConResult=request.Params["textCancelConResult"];
            string chargeType=request.Params["textChargeType"];
            string conFile=request.Params["textConFile"];
            string conObjective=request.Params["textConObjective"];
            string consulationMode=request.Params["textConsulationMode"];
            string consulationType=request.Params["textConsulationType"];
            string consultationId=request.Params["textConsultationId"];
            string consultationStatus=request.Params["textConsultationStatus"];
            string description=request.Params["textDescription"];
            string diagnosis=request.Params["textDiagnosis"];
            string diagnosisFile=request.Params["textDiagnosisFile"];
            string endConTime=request.Params["textEndConTime"];
            string itemId=request.Params["textItemId"];
            string notPassResult=request.Params["textNotPassResult"];
            string processRequestTime=request.Params["textProcessRequestTime"];
            string receiverId=request.Params["textReceiverId"];
            string requestDoctorId=request.Params["textRequestDoctorId"];
            string requestDoctorId2=request.Params["textRequestDoctorId2"];
            string requestDoctorId3=request.Params["textRequestDoctorId3"];
            string requestDoctorId4=request.Params["textRequestDoctorId4"];
            string requestTime=request.Params["textRequestTime"];
            string roomId=request.Params["textRoomId"];
            string sectionOfficeId=request.Params["textSectionOfficeId"];
            string updateTime=request.Params["textUpdateTime"];

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

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

            CriterionAndOrder consultationRoomCriterionAndOrder = new CriterionAndOrder();
            consultationRoomCriterionAndOrder.CriteriaName ="RoomRef" ;
            consultationRoomCriterionAndOrder.CriteriaAsName = "CR";
            consultationRoomCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            if (!String.IsNullOrEmpty(actualDoctorId))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ActualDoctorId", actualDoctorId));
            if (!String.IsNullOrEmpty(actualDoctorId2))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ActualDoctorId2", actualDoctorId2));
            if (!String.IsNullOrEmpty(actualDoctorId3))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ActualDoctorId3", actualDoctorId3));
            if (!String.IsNullOrEmpty(actualDoctorId4))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ActualDoctorId4", actualDoctorId4));
            if (!String.IsNullOrEmpty(addTime))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.AddTime", Convert.ToDateTime(addTime)));
            if (!String.IsNullOrEmpty(arrangeConTime))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ArrangeConTime", Convert.ToDateTime(arrangeConTime)));
            if (!String.IsNullOrEmpty(beginConTime))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.BeginConTime", Convert.ToDateTime(beginConTime)));
            if (!String.IsNullOrEmpty(callerId))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.CallerId", callerId));
            if (!String.IsNullOrEmpty(cancelConResult))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.CancelConResult", cancelConResult));
            if (!String.IsNullOrEmpty(chargeType))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ChargeType", chargeType));
            if (!String.IsNullOrEmpty(conFile))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ConFile", conFile));
            if (!String.IsNullOrEmpty(conObjective))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ConObjective", conObjective));
            if (!String.IsNullOrEmpty(consulationMode))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ConsulationMode", consulationMode));
            if (!String.IsNullOrEmpty(consulationType))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ConsulationType", consulationType));
            if (!String.IsNullOrEmpty(consultationId))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ConsultationId", consultationId));
            if (!String.IsNullOrEmpty(consultationStatus))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ConsultationStatus", consultationStatus));
            if (!String.IsNullOrEmpty(description))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.Description", description));
            if (!String.IsNullOrEmpty(diagnosis))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.Diagnosis", diagnosis));
            if (!String.IsNullOrEmpty(diagnosisFile))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.DiagnosisFile", diagnosisFile));
            if (!String.IsNullOrEmpty(endConTime))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.EndConTime", Convert.ToDateTime(endConTime)));
            if (!String.IsNullOrEmpty(itemId))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ItemId", itemId));
            if (!String.IsNullOrEmpty(notPassResult))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.NotPassResult", notPassResult));
            if (!String.IsNullOrEmpty(processRequestTime))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ProcessRequestTime", Convert.ToDateTime(processRequestTime)));
            if (!String.IsNullOrEmpty(receiverId))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.ReceiverId", receiverId));
            if (!String.IsNullOrEmpty(requestDoctorId))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.RequestDoctorId", requestDoctorId));
            if (!String.IsNullOrEmpty(requestDoctorId2))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.RequestDoctorId2", requestDoctorId2));
            if (!String.IsNullOrEmpty(requestDoctorId3))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.RequestDoctorId3", requestDoctorId3));
            if (!String.IsNullOrEmpty(requestDoctorId4))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.RequestDoctorId4", requestDoctorId4));
            if (!String.IsNullOrEmpty(requestTime))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.RequestTime", Convert.ToDateTime(requestTime)));
            if (!String.IsNullOrEmpty(roomId))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.RoomId", roomId));
            if (!String.IsNullOrEmpty(sectionOfficeId))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.SectionOfficeId", sectionOfficeId));
            if (!String.IsNullOrEmpty(updateTime))
                consultationCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.UpdateTime", Convert.ToDateTime(updateTime)));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("C.ConsultationId").As("PrimaryKey"));
            pList.Add(Projections.Property("C.ActualDoctorId").As("ActualDoctorId"));
            pList.Add(Projections.Property("C.ActualDoctorId2").As("ActualDoctorId2"));
            pList.Add(Projections.Property("C.ActualDoctorId3").As("ActualDoctorId3"));
            pList.Add(Projections.Property("C.ActualDoctorId4").As("ActualDoctorId4"));
            pList.Add(Projections.Property("C.AddTime").As("AddTime"));
            pList.Add(Projections.Property("C.ArrangeConTime").As("ArrangeConTime"));
            pList.Add(Projections.Property("C.BeginConTime").As("BeginConTime"));
            pList.Add(Projections.Property("C.CallerId").As("CallerId"));
            pList.Add(Projections.Property("C.CancelConResult").As("CancelConResult"));
            pList.Add(Projections.Property("C.ChargeType").As("ChargeType"));
            pList.Add(Projections.Property("C.ConFile").As("ConFile"));
            pList.Add(Projections.Property("C.ConObjective").As("ConObjective"));
            pList.Add(Projections.Property("C.ConsulationMode").As("ConsulationMode"));
            pList.Add(Projections.Property("C.ConsulationType").As("ConsulationType"));
            pList.Add(Projections.Property("C.ConsultationId").As("ConsultationId"));
            pList.Add(Projections.Property("C.ConsultationStatus").As("ConsultationStatus"));
            pList.Add(Projections.Property("C.Description").As("Description"));
            pList.Add(Projections.Property("C.Diagnosis").As("Diagnosis"));
            pList.Add(Projections.Property("C.DiagnosisFile").As("DiagnosisFile"));
            pList.Add(Projections.Property("C.EndConTime").As("EndConTime"));
            pList.Add(Projections.Property("SI.ItemId").As("ItemId"));
            pList.Add(Projections.Property("C.NotPassResult").As("NotPassResult"));
            pList.Add(Projections.Property("C.ProcessRequestTime").As("ProcessRequestTime"));
            pList.Add(Projections.Property("C.ReceiverId").As("ReceiverId"));
            pList.Add(Projections.Property("C.RequestDoctorId").As("RequestDoctorId"));
            pList.Add(Projections.Property("C.RequestDoctorId2").As("RequestDoctorId2"));
            pList.Add(Projections.Property("C.RequestDoctorId3").As("RequestDoctorId3"));
            pList.Add(Projections.Property("C.RequestDoctorId4").As("RequestDoctorId4"));
            pList.Add(Projections.Property("C.RequestTime").As("RequestTime"));
            pList.Add(Projections.Property("CR.RoomId").As("RoomId"));
            pList.Add(Projections.Property("C.SectionOfficeId").As("SectionOfficeId"));
            pList.Add(Projections.Property("C.UpdateTime").As("UpdateTime"));

            QueryTerms queryTerms = new QueryTerms();
            queryTerms.PersistentClass = typeof(Consultation);
            queryTerms.ColumnList = pList;
            queryTerms.CriterionAndOrderList.Add(consultationCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(serviceItemCriterionAndOrder);
            queryTerms.CriterionAndOrderList.Add(consultationRoomCriterionAndOrder);
            queryTerms.PageSize = Convert.ToInt32(pageSize);
            queryTerms.PageIndex = Convert.ToInt32(pageIndex) - 1;

            ResultModel result = ConsultationBll.GetConsultationList(queryTerms);

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

            response.Write(jsonString);
        }
 /// <summary>
 /// 根据查询条件获取ConferenceMember表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<ConferenceMember> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<ConferenceMember>(queryTerms);
 }
        /// <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);
        }
        /// <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);
        }
        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;
        }
        /// <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);
        }
        /// <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);
        }
 /// <summary>
 /// 根据查询条件获取ServiceItem表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<ServiceItem> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<ServiceItem>(queryTerms);
 }
 /// <summary>
 /// 根据查询条件获取符合查询条件的总记录数
 /// </summary>
 /// <param name="queryTerms">封装的查询条件</param>
 /// <returns>总记录数</returns>
 public static object GetTotalCount(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetTotalCount(queryTerms);
 }
        /// <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 fartherId = request.Params["selectFartherId"];
            string name = request.Params["textName"];
            string officeLevel = request.Params["selectOfficeLevel"];

            CriterionAndOrder hospitalSectionOfficeCriterionAndOrder = new CriterionAndOrder();
            hospitalSectionOfficeCriterionAndOrder.CriteriaName = typeof(HospitalSectionOffice).FullName;
            hospitalSectionOfficeCriterionAndOrder.CriteriaAsName = "HSO";
            hospitalSectionOfficeCriterionAndOrder.OrderList.Add(new Order("HSO.OfficeLevel", true));
            hospitalSectionOfficeCriterionAndOrder.OrderList.Add(new Order("HSO.Name", true));

            if (!String.IsNullOrEmpty(fartherId))
                hospitalSectionOfficeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("HSO.FartherId", fartherId));
            if (!String.IsNullOrEmpty(name))
                hospitalSectionOfficeCriterionAndOrder.CriterionList.Add(Restrictions.Like("HSO.Name", "%" + name + "%"));
            if (!String.IsNullOrEmpty(officeLevel))
                hospitalSectionOfficeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("HSO.OfficeLevel", officeLevel));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("HSO.SectOffId").As("PrimaryKey"));
            pList.Add(Projections.Property("HSO.AddTime").As("AddTime"));
            pList.Add(Projections.Property("HSO.FartherId").As("FartherId"));
            pList.Add(Projections.Property("HSO.Name").As("Name"));
            pList.Add(Projections.Property("HSO.OfficeLevel").As("OfficeLevel"));
            pList.Add(Projections.Property("HSO.SectOffId").As("SectOffId"));
            pList.Add(Projections.Property("HSO.OfficeLevelName").As("OfficeLevelName"));
            pList.Add(Projections.Property("HSO.FartherIdName").As("FartherIdName"));

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

            ResultModel result = HospitalSectionOfficeBll.GetHospitalSectionOfficeList(queryTerms);

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

            response.Write(jsonString);
        }
        /// <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);
        }
        /// <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 isPublic = request.Params["textIsPublic"];
            string moduleId = request.Params["textModuleId"];
            string moduleLevelId = request.Params["selectModuleLevelId"];
            string moduleName = request.Params["textModuleName"];
            string parentModuleId = request.Params["selectParentModuleId"];
            string sortFieldId = request.Params["textSortFieldId"];
            string order = request.Params["order"];

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

            if (!String.IsNullOrEmpty(order))
                moduleCriterionAndOrder.OrderList.Add(new Order(order, false));
            else
                moduleCriterionAndOrder.OrderList.Add(new Order("FM.SortFieldId", true));

            CriterionAndOrder parentModuleCriterionAndOrder = new CriterionAndOrder();
            parentModuleCriterionAndOrder.CriteriaName = "ParentModuleRef";
            parentModuleCriterionAndOrder.CriteriaAsName = "PF";
            parentModuleCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;
            parentModuleCriterionAndOrder.OrderList.Add(new Order("PF.SortFieldId", true));

            if (!String.IsNullOrEmpty(addTime))
                moduleCriterionAndOrder.CriterionList.Add(Restrictions.Eq("FM.AddTime", addTime));
            if (!String.IsNullOrEmpty(description))
                moduleCriterionAndOrder.CriterionList.Add(Restrictions.Eq("FM.Description", description));
            if (!String.IsNullOrEmpty(isPublic))
                moduleCriterionAndOrder.CriterionList.Add(Restrictions.Eq("FM.IsPublicId", isPublic));
            if (!String.IsNullOrEmpty(moduleId))
                moduleCriterionAndOrder.CriterionList.Add(Restrictions.Eq("FM.ModuleId", moduleId));
            if (!String.IsNullOrEmpty(moduleLevelId))
                moduleCriterionAndOrder.CriterionList.Add(Restrictions.Eq("FM.ModuleLevelId", Convert.ToInt32(moduleLevelId)));
            if (!String.IsNullOrEmpty(moduleName))
                moduleCriterionAndOrder.CriterionList.Add(Restrictions.Like("FM.ModuleName", "%" + moduleName + "%"));
            if (!String.IsNullOrEmpty(parentModuleId))
                moduleCriterionAndOrder.CriterionList.Add(Restrictions.Eq("FM.ParentModuleId", parentModuleId));
            if (!String.IsNullOrEmpty(sortFieldId))
                moduleCriterionAndOrder.CriterionList.Add(Restrictions.Eq("FM.SortFieldId", sortFieldId));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("FM.ModuleId").As("ModuleId"));
            pList.Add(Projections.Property("FM.ModuleId").As("PrimaryKey"));
            pList.Add(Projections.Property("FM.ModuleName").As("ModuleName"));
            pList.Add(Projections.Property("FM.UpdateTime").As("UpdateTime"));
            pList.Add(Projections.Property("FM.AddTime").As("AddTime"));
            pList.Add(Projections.Property("FM.ModuleLevelId").As("ModuleLevelId"));
            pList.Add(Projections.Property("FM.ModuleLevelName").As("ModuleLevelName"));
            pList.Add(Projections.Property("PF.ModuleId").As("ParentModuleId"));
            pList.Add(Projections.Property("PF.ModuleName").As("ParentModuleName"));
            pList.Add(Projections.Property("FM.SortFieldId").As("SortFieldId"));
            pList.Add(Projections.Property("FM.SortFieldName").As("SortFieldName"));
            pList.Add(Projections.Property("FM.IsPublicId").As("IsPublicId"));
            pList.Add(Projections.Property("FM.IsPublicName").As("IsPublicName"));

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

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

            ResultModel result = FunctionModuleBll.GetFunctionModuleList(queryTerms);

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

            response.Write(jsonString);
        }
 /// <summary>
 /// 根据查询条件获取ConsultationDigitalImage表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<ConsultationDigitalImage> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<ConsultationDigitalImage>(queryTerms);
 }
        /// <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 cardTypeId=request.Params["textCardTypeId"];
            string description=request.Params["textDescription"];
            string updateTime=request.Params["textUpdateTime"];

            CriterionAndOrder membershipCardCriterionAndOrder = new CriterionAndOrder();
            membershipCardCriterionAndOrder.CriteriaName = typeof(MembershipCard).FullName;
            membershipCardCriterionAndOrder.CriteriaAsName = "MC";
            membershipCardCriterionAndOrder.OrderList.Add(new Order("MC.AddTime", false));

            CriterionAndOrder cardTypeCriterionAndOrder = new CriterionAndOrder();
            cardTypeCriterionAndOrder.CriteriaName ="CardTypeRef" ;
            cardTypeCriterionAndOrder.CriteriaAsName = "CT";
            cardTypeCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            if (!String.IsNullOrEmpty(addTime))
                membershipCardCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MC.AddTime", Convert.ToDateTime(addTime)));
            if (!String.IsNullOrEmpty(cardId))
                membershipCardCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MC.CardId", cardId));
            if (!String.IsNullOrEmpty(cardTypeId))
                membershipCardCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MC.CardTypeId", cardTypeId));
            if (!String.IsNullOrEmpty(description))
                membershipCardCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MC.Description", description));
            if (!String.IsNullOrEmpty(updateTime))
                membershipCardCriterionAndOrder.CriterionList.Add(Restrictions.Eq("MC.UpdateTime", Convert.ToDateTime(updateTime)));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("MC.CardId").As("PrimaryKey"));
            pList.Add(Projections.Property("MC.AddTime").As("AddTime"));
            pList.Add(Projections.Property("MC.CardId").As("CardId"));
            pList.Add(Projections.Property("CT.CardTypeId").As("CardTypeId"));
            pList.Add(Projections.Property("MC.Description").As("Description"));
            pList.Add(Projections.Property("MC.UpdateTime").As("UpdateTime"));

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

            ResultModel result = MembershipCardBll.GetMembershipCardList(queryTerms);

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

            response.Write(jsonString);
        }
Example #24
0
 /// <summary>
 /// 根据查询条件获取CardUser表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<CardUser> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<CardUser>(queryTerms);
 }
 /// <summary>
 /// 根据查询条件获取HospitalExpert表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<HospitalExpert> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<HospitalExpert>(queryTerms);
 }
        /// <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 code = request.Params["textCode"];
            string description = request.Params["textDescription"];
            string id = request.Params["textId"];
            string name = request.Params["textName"];
            string typeName = request.Params["textTypeName"];
            string updateTime = request.Params["textUpdateTime"];
            string typeId = request.Params["textTypeId"];

            CriterionAndOrder dictionaryCriterionAndOrder = new CriterionAndOrder();
            dictionaryCriterionAndOrder.CriteriaName = typeof(Dictionary).FullName;
            dictionaryCriterionAndOrder.CriteriaAsName = "D";
            dictionaryCriterionAndOrder.OrderList.Add(new Order("D.TypeId", true));
            dictionaryCriterionAndOrder.OrderList.Add(new Order("D.Code", true));

            CriterionAndOrder dictionaryTypeCriterionAndOrder = new CriterionAndOrder();
            dictionaryTypeCriterionAndOrder.CriteriaName = "TypeRef";
            dictionaryTypeCriterionAndOrder.CriteriaAsName = "DT";
            dictionaryTypeCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            if (!String.IsNullOrEmpty(addTime))
                dictionaryCriterionAndOrder.CriterionList.Add(Restrictions.Gt("D.AddTime", Convert.ToDateTime(addTime)));
            if (!String.IsNullOrEmpty(code))
                dictionaryCriterionAndOrder.CriterionList.Add(Restrictions.Eq("D.Code", Convert.ToChar(code)));
            if (!String.IsNullOrEmpty(description))
                dictionaryCriterionAndOrder.CriterionList.Add(Restrictions.Like("D.Description", "%" + description + "%"));
            if (!String.IsNullOrEmpty(id))
                dictionaryCriterionAndOrder.CriterionList.Add(Restrictions.Eq("D.Id", id));
            if (!String.IsNullOrEmpty(name))
                dictionaryCriterionAndOrder.CriterionList.Add(Restrictions.Like("D.Name", "%" + name + "%"));
            if (!String.IsNullOrEmpty(typeId))
                dictionaryCriterionAndOrder.CriterionList.Add(Restrictions.Eq("D.TypeId", typeId));
            if (!String.IsNullOrEmpty(typeName))
                dictionaryCriterionAndOrder.CriterionList.Add(Restrictions.Like("DT.Name", "%" + typeName + "%"));
            if (!String.IsNullOrEmpty(updateTime))
                dictionaryCriterionAndOrder.CriterionList.Add(Restrictions.Gt("D.UpdateTime", Convert.ToDateTime(updateTime)));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("D.Id").As("PrimaryKey"));
            pList.Add(Projections.Property("D.AddTime").As("AddTime"));
            pList.Add(Projections.Property("D.Code").As("Code"));
            pList.Add(Projections.Property("D.Description").As("Description"));
            pList.Add(Projections.Property("D.Id").As("Id"));
            pList.Add(Projections.Property("D.Name").As("Name"));
            pList.Add(Projections.Property("DT.Id").As("TypeId"));
            pList.Add(Projections.Property("DT.Name").As("TypeName"));
            pList.Add(Projections.Property("D.UpdateTime").As("UpdateTime"));

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

            ResultModel result = DictionaryBll.GetDictionaryList(queryTerms);

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

            response.Write(jsonString);
        }
Example #27
0
 /// <summary>
 /// Indicates whether this query includes anything outside of the specified terms
 /// </summary>
 public bool HasAtMost(QueryTerms terms) => (ActiveTerms & ~terms) == 0;
Example #28
0
 /// <summary>
 /// 根据查询条件获取RoleRight表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<RoleRight> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<RoleRight>(queryTerms);
 }
Example #29
0
        /// <summary>
        /// 根据查询条件获取CardUser表中符合查询条件的记录
        /// </summary>
        /// <param name="queryTerms">自定义查询条件</param>
        /// <param name="isLog">是否写入日志</param>
        /// <returns>查询结果,封装了查询的数据信息</returns>
        public static ResultModel GetCardUserList(QueryTerms queryTerms, bool isLog)
        {
            if (isLog)
                return GetCardUserList(queryTerms);
            List<CardUser> cardUserList = new List<CardUser>();
            int totalCount = 0;
            ResultModel result = new ResultModel();

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

                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)
            {
                result.IsSuccess = false;
                result.ResultCode = SymbolicConstant.RESULTCODE_GETLIST_ERROR;
                result.ResultMessage = exception.Message;

                return result;
            }
        }
        /// <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 beginAddTime = request.Params["textBeginAddTime"];
            string endAddTime = request.Params["textEndAddTime"];
            string isSuccessId = request.Params["textIsSuccessId"];
            string operationTable = request.Params["textOperationTable"];
            string operationTypeCode = request.Params["selectOperationTypeCode"];
            string resultCode = request.Params["textResultCode"];
            string systemUserName = request.Params["textSystemUserName"];

            CriterionAndOrder operationLogCriterionAndOrder = new CriterionAndOrder();
            operationLogCriterionAndOrder.CriteriaName = typeof(OperationLog).FullName;
            operationLogCriterionAndOrder.CriteriaAsName = "OL";
            operationLogCriterionAndOrder.OrderList.Add(new Order("OL.AddTime", false));

            CriterionAndOrder conLogCriterionAndOrder = new CriterionAndOrder();
            conLogCriterionAndOrder.CriteriaName = "ConLogRef";
            conLogCriterionAndOrder.CriteriaAsName = "CL";
            conLogCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

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

            if (!String.IsNullOrEmpty(beginAddTime))
                operationLogCriterionAndOrder.CriterionList.Add(Restrictions.Gt("OL.AddTime", Convert.ToDateTime(beginAddTime)));
            if (!String.IsNullOrEmpty(endAddTime))
                operationLogCriterionAndOrder.CriterionList.Add(Restrictions.Lt("OL.AddTime", Convert.ToDateTime(endAddTime)));
            if (!String.IsNullOrEmpty(isSuccessId))
                operationLogCriterionAndOrder.CriterionList.Add(Restrictions.Eq("OL.IsSuccessId", isSuccessId));
            if (!String.IsNullOrEmpty(operationTable))
                operationLogCriterionAndOrder.CriterionList.Add(Restrictions.Like("OL.OperationTable", "%" + operationTable + "%"));
            if (!String.IsNullOrEmpty(operationTypeCode))
                operationLogCriterionAndOrder.CriterionList.Add(Restrictions.Eq("OL.OperationTypeCode", operationTypeCode));
            if (!String.IsNullOrEmpty(resultCode))
                operationLogCriterionAndOrder.CriterionList.Add(Restrictions.Eq("OL.ResultCode", Convert.ToInt32(resultCode)));
            if (!String.IsNullOrEmpty(systemUserName))
                operationLogCriterionAndOrder.CriterionList.Add(Restrictions.Like("OL.SystemUserId", "%" + systemUserName + "%"));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("OL.LogId").As("PrimaryKey"));
            pList.Add(Projections.Property("OL.AddTime").As("AddTime"));
            pList.Add(Projections.Property("OL.IsSuccessText").As("IsSuccessText"));
            pList.Add(Projections.Property("OL.LogId").As("LogId"));
            pList.Add(Projections.Property("OL.ObjectRecordId").As("ObjectRecordId"));
            pList.Add(Projections.Property("OL.OperationContent").As("OperationContent"));
            pList.Add(Projections.Property("OL.OperationTable").As("OperationTable"));
            pList.Add(Projections.Property("OL.OperationTypeText").As("OperationTypeText"));
            pList.Add(Projections.Property("OL.ResultText").As("ResultText"));
            pList.Add(Projections.Property("SU.UserId").As("SystemUserId"));
            pList.Add(Projections.Property("SU.UserName").As("SystemUserName"));

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

            ResultModel result = OperationLogBll.GetOperationLogList(queryTerms);

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

            response.Write(jsonString);
        }
        /// <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 userName = request.Params["textUserName"];
            string realName = request.Params["textRealName"];
            string medCardNum = request.Params["textMedCardNum"];
            string memCardNum = request.Params["textMemCardNumber"];

            CriterionAndOrder consumerCriterionAndOrder = new CriterionAndOrder();
            consumerCriterionAndOrder.CriteriaName = typeof(Consumer).FullName;
            consumerCriterionAndOrder.CriteriaAsName = "C";
            consumerCriterionAndOrder.OrderList.Add(new Order("C.ConsumerId", false));

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

            CriterionAndOrder cardUserListCriterionAndOrder = new CriterionAndOrder();
            cardUserListCriterionAndOrder.CriteriaName = "CardUserList";
            cardUserListCriterionAndOrder.CriteriaAsName = "CUL";
            cardUserListCriterionAndOrder.CriteriaSpecification = CriteriaSpecification.LeftJoin;

            if (!String.IsNullOrEmpty(userName))
                consumerCriterionAndOrder.CriterionList.Add(Restrictions.Like("SU.UserName", "%" + userName + "%"));
            if (!String.IsNullOrEmpty(realName))
                consumerCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.RealName", "%" + realName + "%"));
            if (!String.IsNullOrEmpty(memCardNum))
                consumerCriterionAndOrder.CriterionList.Add(Restrictions.Eq("CUL.CardNum", memCardNum));
            if (!String.IsNullOrEmpty(medCardNum))
                consumerCriterionAndOrder.CriterionList.Add(Restrictions.Eq("C.MedCardNum", medCardNum));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("C.ConsumerId").As("PrimaryKey"));
            //pList.Add(Projections.Property("C.ConsumerId").As("ConsumerId"));
            pList.Add(Projections.Property("C.MedCardNum").As("MedCardNum"));
            pList.Add(Projections.Property("SU.UserName").As("UserName"));
            pList.Add(Projections.Property("SU.RealName").As("RealName"));
            pList.Add(Projections.Property("SU.GenderName").As("GenderName"));
            pList.Add(Projections.Property("SU.AddTime").As("AddTime"));

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

            ResultModel result = ConsumerBll.GetConsumerList(queryTerms);

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

            response.Write(jsonString);
        }
        public IActionResult BuyEvaluateListIndex(IFormCollection form)
        {
            List <SelectListItem> listItem = new List <SelectListItem>();

            listItem.Add(new SelectListItem {
                Text = "待處理", Value = "待處理"
            });
            listItem.Add(new SelectListItem {
                Text = "已處理", Value = "已處理"
            });
            listItem.Add(new SelectListItem {
                Text = "已結案", Value = "已結案"
            });
            ViewData["Item"] = new SelectList(listItem, "Value", "Text", form["qtyFLOWTYP"]);
            //
            List <BuyEvaluateListVModel> vm;
            QueryTerms qry = new QueryTerms();

            if (form["qtyDOCID"] != "")
            {
                qry.docid = form["qtyDOCID"];
            }
            if (form["qtyACCNO"] != "")
            {
                qry.accno = form["qtyACCNO"];
            }
            //if (form["qtyASSETNO"] != "")
            //{
            //    qry.assetno = form["qtyASSETNO"];
            //}
            if (form["qtyCNAME"] != "")
            {
                qry.cname = form["qtyCNAME"];
            }
            if (form["qtyDPTID"] != "")
            {
                qry.applydpt = form["qtyDPTID"];
            }
            if (form["qtyFLOWTYP"] != "")
            {
                qry.flowtyp = form["qtyFLOWTYP"];
            }
            if (form["qtyBUDGETID"] != "")
            {
                qry.budgetid = form["qtyBUDGETID"];
            }
            if (form["qtyAGREEDATE1"] != "")
            {
                qry.agreedate1    = form["qtyAGREEDATE1"];
                qry.agreedate1    = qry.agreedate1.Replace("-", "/");
                ViewData["Sdate"] = qry.agreedate1;
            }
            if (form["qtyAGREEDATE2"] != "")
            {
                qry.agreedate2    = form["qtyAGREEDATE2"];
                qry.agreedate2    = qry.agreedate2.Replace("-", "/");
                ViewData["Edate"] = qry.agreedate2;
            }
            if (userManager.IsInRole(User, "BuyerMgr"))
            {
                vm = GetList(qry, "BuyerMgr");
            }
            else
            {
                vm = GetList(qry, "");
            }
            string c = form["qtySTANDARD"];

            if (Convert.ToBoolean(c.Split(new char[] { ',' }).GetValue(0)))
            {
                vm = vm.Where(v => v.IsAgree == true).ToList();
            }
            //
            string[] s = new string[] { "?", "2" };
            vm.ForEach(v =>
            {
                v.DelivCount = _context.Deliveries.Where(d => d.PurchaseNo == v.DocId)
                               .Join(_context.DelivFlows, d => d.DocId, f => f.DocId,
                                     (d, f) => f).Where(f => s.Contains(f.Status)).Count();
            });

            return(PartialView("_BuyEvaluateList", vm));
        }
 /// <summary>
 /// 根据查询条件获取CobminationItem表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<CobminationItem> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<CobminationItem>(queryTerms);
 }
 /// <summary>
 /// 根据查询条件获取Dictionary表中符合查询条件的记录
 /// </summary>
 /// <param name="queryTerms">自定义查询条件</param>
 /// <returns>实体列表</returns>
 public static IList<Dictionary> GetList(QueryTerms queryTerms)
 {
     return DataAccessUtility.GetList<Dictionary>(queryTerms);
 }
        /// <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 id = request.Params["textId"];
            string name = request.Params["textName"];
            string updateTime = request.Params["textUpdateTime"];
            //keywords是处理AutoComplete下接框查询时设置的传入参数
            string keywords = request.Params["keywords"];

            CriterionAndOrder dictionaryTypeCriterionAndOrder = new CriterionAndOrder();
            dictionaryTypeCriterionAndOrder.CriteriaName = typeof(DictionaryType).FullName;
            dictionaryTypeCriterionAndOrder.CriteriaAsName = "DT";
            dictionaryTypeCriterionAndOrder.OrderList.Add(new Order("DT.AddTime", false));

            if (!String.IsNullOrEmpty(addTime))
                dictionaryTypeCriterionAndOrder.CriterionList.Add(Restrictions.Gt("DT.AddTime", Convert.ToDateTime(addTime)));
            if (!String.IsNullOrEmpty(description))
                dictionaryTypeCriterionAndOrder.CriterionList.Add(Restrictions.Like("DT.Description", "%" + description + "%"));
            if (!String.IsNullOrEmpty(keywords))
                dictionaryTypeCriterionAndOrder.CriterionList.Add(Restrictions.Like("DT.Description", "%" + keywords + "%"));
            if (!String.IsNullOrEmpty(id))
                dictionaryTypeCriterionAndOrder.CriterionList.Add(Restrictions.Eq("DT.Id", id));
            if (!String.IsNullOrEmpty(name))
                dictionaryTypeCriterionAndOrder.CriterionList.Add(Restrictions.Like("DT.Name", "%" + name + "%"));
            if (!String.IsNullOrEmpty(updateTime))
                dictionaryTypeCriterionAndOrder.CriterionList.Add(Restrictions.Gt("DT.UpdateTime", Convert.ToDateTime(updateTime)));

            ProjectionList pList = Projections.ProjectionList();
            pList.Add(Projections.Property("DT.Id").As("PrimaryKey"));
            pList.Add(Projections.Property("DT.AddTime").As("AddTime"));
            pList.Add(Projections.Property("DT.Description").As("Description"));
            pList.Add(Projections.Property("DT.Id").As("Id"));
            pList.Add(Projections.Property("DT.Name").As("Name"));
            pList.Add(Projections.Property("DT.UpdateTime").As("UpdateTime"));

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

            ResultModel result = DictionaryTypeBll.GetDictionaryTypeList(queryTerms);

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

            response.Write(jsonString);
        }
        public List <BuyEvaluateListVModel> GetList(QueryTerms qry, string role)
        {
            // Get Login User's details.
            var user = _userRepo.Find(ur => ur.UserName == User.Identity.Name).FirstOrDefault();
            List <BuyEvaluateListVModel> rv = new List <BuyEvaluateListVModel>();
            List <BuyFlowModel>          rf = new List <BuyFlowModel>();
            List <string>   rs = new List <string>();
            AppUserModel    p  = _context.AppUsers.Find(user.Id);
            DepartmentModel d  = _context.Departments.Find(p.DptId);

            switch (qry.flowtyp)
            {
            case "已處理":
                rf = _context.BuyFlows.Where(m => m.Status == "?")
                     .ToList();

                break;

            case "已結案":
                rf = _context.BuyFlows.Where(m => m.Status == "2")
                     .ToList();
                break;

            default:
                rf = _context.BuyFlows.Where(m => m.Status == "?")
                     .Where(m => m.UserId == user.Id)
                     .ToList();
                break;
            }
            if (!string.IsNullOrEmpty(qry.docid))
            {
                rf = rf.Where(m => m.DocId == qry.docid).ToList();
            }
            rf = rf.OrderByDescending(m => m.Rtt).ToList();

            if (role == "BuyerMgr")
            {
                rs = rf.Join(_context.BuyEvaluates, m => m.DocId, f => f.DocId,
                             (m, f) => new
                {
                    m.DocId,
                    f.AccDpt,
                    m.Rtt
                })
                     .OrderByDescending(f => f.Rtt)
                     .Select(f => f.DocId).Distinct().ToList();
            }
            else
            {
                if (qry.flowtyp == "已處理")
                {
                    rs = rf.Join(_context.BuyFlows, m => m.DocId, f => f.DocId,
                                 (m, f) => f)
                         .Where(f => f.UserId == user.Id)
                         .Where(f => f.Status == "1")
                         .Select(f => f.DocId).Distinct().ToList();
                }
                else
                {
                    rs = rf.Select(m => m.DocId).Distinct().ToList();
                }
            }

            var data = rs.Join(_context.BuyEvaluates, m => m, f => f.DocId,
                               (m, f) => new
            {
                f.DocId,
                f.UserId,
                f.UserName,
                f.AccDpt,
                f.AccDptNam,
                f.PlantCnam,
                f.PlantEnam,
                f.PlantType,
                f.EngId,
                f.EngName,
                f.BudgetId,
                f.AgreeDate,
                f.Rtt
            }).Join(_context.AppUsers, f => f.UserId, u => u.Id,
                    (f, u) => new
            {
                f.DocId,
                f.UserId,
                f.UserName,
                f.AccDpt,
                f.AccDptNam,
                f.PlantCnam,
                f.PlantEnam,
                f.PlantType,
                f.EngId,
                f.EngName,
                f.BudgetId,
                f.AgreeDate,
                f.Rtt,
                u.DptId
            });

            if (!string.IsNullOrEmpty(qry.accno))
            {
                data = data.Where(f => f.AccDpt == qry.accno);
            }
            //if (!string.IsNullOrEmpty(qry.assetno))
            //{
            //    data = data.Where(f => f.AssetNo == qry.assetno);
            //}
            if (!string.IsNullOrEmpty(qry.cname))
            {
                data = data.Where(f => f.PlantCnam.Contains(qry.cname));
            }
            if (!string.IsNullOrEmpty(qry.applydpt))
            {
                data = data.Where(f => f.AccDpt == qry.applydpt);
            }
            if (!string.IsNullOrEmpty(qry.budgetid))
            {
                data = data.Where(f => f.BudgetId == qry.budgetid);
            }
            if (!string.IsNullOrEmpty(qry.agreedate1))
            {
                data = data.Where(f => f.AgreeDate != null)
                       .Where(f => f.AgreeDate.Value.CompareTo(DateTime.ParseExact(qry.agreedate1, "yyyy/MM/dd", null)) >= 0);
            }
            if (!string.IsNullOrEmpty(qry.agreedate2))
            {
                data = data.Where(f => f.AgreeDate != null)
                       .Where(f => f.AgreeDate.Value.Date.CompareTo(DateTime.ParseExact(qry.agreedate2, "yyyy/MM/dd", null)) <= 0);
            }
            data = data.Take((qry.pagecnt + 1) * 100);
            string status = "";

            if (qry.flowtyp == "已結案")
            {
                status = "2";
            }
            else
            {
                status = "?";
            }
            var s = new[] { "?", "2" };

            data.Join(_context.BuyFlows, m => m.DocId, f => f.DocId,
                      (m, f) => new
            {
                buyevaluate = m,
                flow        = f
            }).Where(bf => bf.flow.Status == status)
            .ToList()
            .ForEach(j => rv.Add(new BuyEvaluateListVModel
            {
                DocType  = "評估",
                DocId    = j.buyevaluate.DocId,
                BudgetId = j.buyevaluate.BudgetId,
                UserId   = j.buyevaluate.UserId,
                UserName = j.buyevaluate.UserName,
                CustId   = j.buyevaluate.AccDpt,
                CustNam  = (d = _context.Departments.Find(j.buyevaluate.AccDpt)) == null ? ""
                    : d.Name_C,
                PlantCnam = j.buyevaluate.PlantCnam,
                PlantEnam = j.buyevaluate.PlantEnam,
                PlantType = j.buyevaluate.PlantType,
                EngName   = (p = _context.AppUsers.Find(j.buyevaluate.EngId)) == null ? ""
                    : p.FullName,
                Days = DateTime.Now.Subtract(j.buyevaluate.Rtt.GetValueOrDefault()).Days,

                Flg = _context.Deliveries.Join(_context.DelivFlows, de => de.DocId, f => f.DocId,
                                               (de, f) =>
                                               new
                {
                    delivery  = de,
                    delivflow = f
                }).Where(k => k.delivery.PurchaseNo == j.buyevaluate.DocId)
                      .Where(k => s.Contains(k.delivflow.Status)).Count() > 0 ?
                      "E" : j.flow.Status,
                FlowUid   = j.flow.UserId,
                FlowUname = (p = _context.AppUsers.Find(j.flow.UserId)) == null ? "" : p.FullName,
                IsAgree   = j.buyevaluate.AgreeDate.HasValue ? true : false,
                AgreeDate = j.buyevaluate.AgreeDate == null ? "" : j.buyevaluate.AgreeDate.Value.ToString("yyyy/MM/dd")
            }));
            //
            //_context.Dispose();
            return(rv);
        }