Esempio n. 1
0
        public BaseResponse <AbNormaleMotionRec> QueryAB(int FeeNo, int year, int month)
        {
            //加载子项目
            var response = new BaseResponse <AbNormaleMotionRec>();

            //这边获取list的集合
            AbNormaleMotionRec AbNormaleMotionRec = new AbNormaleMotionRec();

            ABFilter ABFilter = new ABFilter();

            List <DC_AbNormaleMotionRec> DC_AbNormaleMotionRec = new List <DC_AbNormaleMotionRec>();

            List <DC_ABNORMALEMOTIONREC> regQuestion = unitOfWork.GetRepository <DC_ABNORMALEMOTIONREC>().dbSet.Where(m => m.YEAR == year && m.MONTH == month && m.FEENO == FeeNo).ToList();

            Mapper.CreateMap <DC_ABNORMALEMOTIONREC, DC_AbNormaleMotionRec>();

            Mapper.Map(regQuestion, DC_AbNormaleMotionRec);

            if (DC_AbNormaleMotionRec.Count > 0)
            {
                ABFilter.REGNAME    = DC_AbNormaleMotionRec[0].REGNAME;
                ABFilter.SEX        = DC_AbNormaleMotionRec[0].SEX;
                ABFilter.RESIDENTNO = DC_AbNormaleMotionRec[0].RESIDENTNO;
            }

            AbNormaleMotionRec.AbNormaleMotionlist = DC_AbNormaleMotionRec;
            AbNormaleMotionRec.ab = ABFilter;
            response.Data         = AbNormaleMotionRec;
            return(response);
        }
Esempio n. 2
0
        public BaseResponse <AbNormaleMotionRec> GetAb(long feeNo, int year, int month)
        {
            //加载子项目
            var response = new BaseResponse <AbNormaleMotionRec>();

            //这边获取list的集合
            AbNormaleMotionRec AbNormaleMotionRec = new AbNormaleMotionRec();

            ABFilter ABFilter = new ABFilter();

            List <DC_AbNormaleMotionRec> DC_AbNormaleMotionRec = new List <DC_AbNormaleMotionRec>();

            List <DC_ABNORMALEMOTIONREC> regQuestion = unitOfWork.GetRepository <DC_ABNORMALEMOTIONREC>().dbSet.Where(m => m.YEAR == year && m.MONTH == month && m.FEENO == feeNo).ToList();

            Mapper.CreateMap <DC_ABNORMALEMOTIONREC, DC_AbNormaleMotionRec>();

            Mapper.Map(regQuestion, DC_AbNormaleMotionRec);



            NurseingLifeWeeks DayLifeCarereclist = new NurseingLifeWeeks();

            if (DC_AbNormaleMotionRec.Count > 0)
            {
                StringBuilder sb = new StringBuilder();

                string sql = string.Format("select LTC_ORG.ORGNAME as OrgName from DC_ABNORMALEMOTIONREC as nurse  inner join LTC_ORG  on nurse.ORGID=LTC_ORG.ORGID ");

                sb.Append(sql);
                //这边默认的是时间
                using (TWSLTCContext context = new TWSLTCContext())
                {
                    DayLifeCarereclist = context.Database.SqlQuery <NurseingLifeWeeks>(sb.ToString()).ToList()[0];
                }
                ABFilter.REGNAME    = DC_AbNormaleMotionRec[0].REGNAME;
                ABFilter.SEX        = DC_AbNormaleMotionRec[0].SEX;
                ABFilter.RESIDENTNO = DC_AbNormaleMotionRec[0].RESIDENTNO;
                ABFilter.Res        = DC_AbNormaleMotionRec[0].RESIDENTNO;
                ABFilter.Day        = year + "." + month;
                ABFilter.NURSEAIDES = DC_AbNormaleMotionRec[0].NURSEAIDES;
                ABFilter.Nur        = DC_AbNormaleMotionRec[0].NURSEAIDES;
                ABFilter.OrgName    = DayLifeCarereclist.OrgName;
            }
            AbNormaleMotionRec.AbNormaleMotionlist = DC_AbNormaleMotionRec;
            AbNormaleMotionRec.ab = ABFilter;
            response.Data         = AbNormaleMotionRec;
            return(response);
        }