Example #1
0
        //websitename.com/mod/1113-name
        public ActionResult Upload()
        {
            var data = new BaseInfoViewModel()
            {
                Games      = db.Games.ToList(),
                Categories = db.Categories.ToList()
            };

            return(View(data));
        }
        public async Task <ActionResult> RegisterBaseInfo(BaseInfoViewModel baseInfoViewModel)
        {
            if (baseInfoViewModel.nType == -1)
            {
                return(Json(new TData
                {
                    Tag = 0,
                    Message = "请选择人员类型",
                }));
            }
            TData <string> obj = await baseInfoBLL.RegisterBase(baseInfoViewModel);

            return(Json(obj));
        }
        public async Task <HospMonData> Register([FromBody] BaseInfoViewModel baseInfoViewModel)
        {
            var AutReturn = await this.Authentication(new ParameterIn { sId = baseInfoViewModel?.sId });

            if (AutReturn.Code == 00)
            {
                HospMonData hospMonData = new HospMonData();
                var         data        = await baseInfoBLL.RegisterBase(baseInfoViewModel);

                hospMonData.Code    = data.Tag;
                hospMonData.Message = data.Message;
                return(hospMonData);
            }
            return(AutReturn);
        }
Example #4
0
        /// <summary>
        /// 登记
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <TData <string> > RegisterBase(BaseInfoViewModel entity)
        {
            TData <string> obj = new TData <string>();

            obj.Tag = 0;
            if (!System.Enum.IsDefined(typeof(nTypeEnum), entity.nType))
            {
                obj.Message = $"人员类型有误";
                return(obj);
            }
            if (!await QueryInLineCount(entity.sPatient, entity.nType))
            {
                var nTypeStr = (nTypeEnum)entity.nType == nTypeEnum.Chaperon ?"陪护":"访客";
                obj.Message = $"该患者的{nTypeStr}人数已达上线";
                return(obj);
            }
            await baseInfoService.SaveForm(new BaseInfoEntity
            {
                sId      = entity.sId,
                sName    = entity.sName,
                sPhone   = entity.sPhone,
                sAddress = entity.sAddress,
                sBedNo   = entity.sBedNo,
                sArea    = entity.sArea,
                sDoc     = entity.sDoc,
                sSex     = entity.sSex,
                sAge     = entity.sAge,
                sRemarks = entity.sRemarks,
                sExtend  = entity.sExtend
            });

            //if (entity.IsOnLine==1)
            if (true)
            {
                await inlinePeopleService.SaveForm(new InlinePeopleEntity
                {
                    sId        = entity.sId,
                    nType      = entity.nType,
                    dtCheckIn  = DateTime.Now,
                    sPatientId = entity.nType == 0 ? entity.sId : entity.sPatient
                });
            }

            //obj.Data = entity.sId;
            obj.Tag = 1;
            return(obj);
        }
Example #5
0
        public async Task <ActionResult> RegisterBaseInfo(BaseInfoViewModel baseInfoViewModel)
        {
            TData <string> obj = await baseInfoBLL.RegisterBase(baseInfoViewModel);

            return(Json(obj));
        }
Example #6
0
        /// <summary>
        /// 登记
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <TData <string> > RegisterBase(BaseInfoViewModel entity)
        {
            #region test
            //{
            //    var TdataPatInfo = await this.GetList(new BaseInfoListParam
            //    {
            //        sId = entity.sId
            //    });
            //    if (TdataPatInfo.Tag == 0) obj.Message = "网络异常,请重试";
            //    if (TdataPatInfo.Data == null || TdataPatInfo.Data.Count <= 0)
            //    {
            //        BiId = 0;
            //    }
            //    else
            //    {
            //        BiId = TdataPatInfo.Data.FirstOrDefault()?.Id ?? 0;
            //    }
            //}
            #endregion
            TData <string> obj = new TData <string>();
            obj.Tag = 0;
            long Oprlong;
            var  OprStr = await ComprehensiveOper(entity);

            //if (OprStr == "00")
            //{
            //    obj.Tag = 1;
            //    obj.Message= "认证成功,请通过";
            //    return obj;
            //}
            if (long.TryParse(OprStr, out Oprlong))
            {
                await baseInfoService.SaveForm(new BaseInfoEntity
                {
                    Id       = Oprlong,
                    sId      = entity.sId,
                    sName    = entity.sName,
                    sPhone   = entity.sPhone,
                    sAddress = entity.sAddress,
                    sBedNo   = entity.sBedNo,
                    sArea    = entity.sArea,
                    sDoc     = entity.sDoc,
                    sSex     = entity.sSex,
                    sAge     = entity.sAge,
                    sRemarks = entity.sRemarks,
                    sExtend  = entity.sExtend
                });
            }
            else
            {
                obj.Message = OprStr;
                return(obj);
            }



            //if (entity.IsOnLine==1)
            if (true)
            {
                await inlinePeopleService.SaveForm(new InlinePeopleEntity
                {
                    sId        = entity.sId,
                    nType      = entity.nType,
                    dtCheckIn  = DateTime.Now,
                    sPatientId = entity.nType == 0 ? entity.sId : entity.sPatient
                });
            }

            //obj.Data = entity.sId;
            obj.Tag     = 1;
            obj.Message = "登记成功";
            return(obj);
        }
Example #7
0
        /// <summary>
        /// 处理逻辑
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        private async Task <string> ComprehensiveOper(BaseInfoViewModel entity)
        {
            //if (entity == null || entity.sId == null)
            //{
            //    return "身份证不能为空";
            //}
            if (!ValidatorHelper.IsIDCard(entity.sId ?? ""))
            {
                return("身份证号码有误");
            }

            if (!System.Enum.IsDefined(typeof(nTypeEnum), entity.nType))
            {
                return($"人员类型有误");
            }
            var nTypeStr = (nTypeEnum)entity.nType == nTypeEnum.Chaperon ? "陪护" :
                           (nTypeEnum)entity.nType == nTypeEnum.Visitor ? "访客" : "患者";

            if (entity.sId.Equals(entity.sPatient) && entity.nType != (int)nTypeEnum.Patient)
            {
                //return $"{nTypeStr}不可绑定自己";
                return($"绑定患者有误");
            }

            var Count = await QueryInLineCount(entity.sPatient, entity.nType, entity.sId);

            if (Count == 2)
            {
                return($"该患者的{nTypeStr}人数已达上线");
            }
            else if (Count == 1)
            {
                return($"要綁定的患者不存在或已注销");
            }
            else if (Count == 3)
            {
                return($"該{nTypeStr}已在綫登記");
                //var BDPat = await passRecordBLL.SaveForm(new PassRecordEntity
                //{
                //    sId = entity.sId,
                //    nType = entity.nType,
                //    dtPass = DateTime.Now,
                //    sPatientId = entity.sPatient
                //});
                //if (BDPat.Tag==1) {
                //    return "00";
                //}
                //else
                //{
                //    return "认证失败";
                //}
            }

            {
                var TdataPatInfo = await this.GetList(new BaseInfoListParam
                {
                    sId = entity.sId
                });

                if (TdataPatInfo.Tag == 0)
                {
                    return("网络异常,请重试");
                }
                if (TdataPatInfo.Data == null || TdataPatInfo.Data.Count <= 0)
                {
                    return("0");
                }
                else
                {
                    return(TdataPatInfo.Data.FirstOrDefault()?.Id.ToString());
                }
            }
        }