Example #1
0
        /// <summary>
        /// 通过工号登录
        /// </summary>
        /// <param name="workCode"></param>
        /// <returns></returns>
        public bool Login(string LoginName)
        {
            bool result = false;
            P_UserBLL bll = new P_UserBLL();
            P_User user = bll.GetListBy(u => u.LoginName == LoginName).Select(u => u.ToExtModle()).FirstOrDefault(); //查找用户名 密码
            if (user != null)
            {
                UserOperateContext.Current.Session_UsrInfo = user;
                UserPermissionBLL upbll = new UserPermissionBLL();  //实例化权限业务
                UserOperateContext.Current.Session_UsrPermission = upbll.GetUserPermission(user.ID); //保存到session中

                UserOperateContext.Current.Session_UsrRole = new P_UserRoleBLL().GetListBy(ur=>ur.UserID==user.ID).Select(ur=>ur.RoleID).ToList(); //把用户角色存入 session中

                StorageRelatedInfo srInfo = new StorageRelatedInfo();
                //获取 用户仓储列表
                List<int> listStorageID = new I_StoragePersonBLL().GetListBy(sp => sp.UserID == user.ID).Select(sp => sp.StorageID).ToList();
                srInfo.listUserStorage = listStorageID;

                //获取物资类型列表
                List<string> listMaterialType = upbll.GetStorageMaterialType(user.ID);
                srInfo.listUserStorageMaterialType = listMaterialType;
                UserOperateContext.Current.Session_StorageRelated = srInfo;  //存session信息

                result = true;
            }

            return result;
        }
Example #2
0
        public ActionResult GetUserDepAndRole()
        {
            int        userid   = Convert.ToInt32(Request.Form["UserId"]);
            List <int> userRole = new P_UserRoleBLL().GetListBy(ur => ur.UserID == userid).Select(ur => ur.RoleID).ToList();
            P_User     userInfo = new P_UserBLL().GetModelWithOutTrace(u => u.ID == userid);
            string     Depid    = "";

            if (userInfo != null)
            {
                Depid = userInfo.DepID.ToString();
            }
            string uRole = "";

            foreach (int item in userRole)
            {
                uRole = uRole + "," + item;
            }
            string reUR = "";

            if (uRole != "")
            {
                reUR = uRole.Substring(1);
            }
            return(Json(new { UserRole = reUR, Dep = Depid }, "appliction/json", JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public ActionResult Index(FormCollection form)
        {
            //0.接收参数 page=1&rows=5
            int pageIndex = int.Parse(form["page"]);
            int pageSize  = int.Parse(form["rows"]);

            string strWorkCode = form["WorkCode"];
            string strName     = form["Name"];

            #region 拼接查询条件
            Expression <Func <P_User, bool> > where = p => p.IsActive == true;
            if (strWorkCode != null && strWorkCode.Length > 0)
            {
                where = where.And(r => r.WorkCode == strWorkCode);
            }
            if (strName != null && strName.Length > 0)
            {
                where = where.And(s => s.Name.Contains(strName));
            }
            #endregion

            //1.读取数据
            var rowCount = 0;
            var list     = new P_UserBLL().GetPagedList(pageIndex, pageSize, ref rowCount, where, u => u.ID, true).Select(u => u.ToExtModle());
            //2.返回数据
            return(Json(new Model.EasyUIModel.DataGridModel()
            {
                total = rowCount, rows = list
            }));
        }
        //获取病历信息
        public void GetPatientRecordInfo(string TaskCode, string WorkID, out M_PatientRecord info, out M_PatientRecordAppend pra, out M_PatientRecordCPR prCPR)
        {
            M_PatientRecordBLL prBLL = new M_PatientRecordBLL();
            M_AttemperData result = prBLL.GetAttemperData(TaskCode,"");//根据任务编码获取调度信息

            info = new M_PatientRecord();//病历主表信息
            info.TaskCode = TaskCode;
            info.PatientOrder = 1;
            info.CallOrder = result.CallOrder;
            info.Name = result.Name;
            info.Sex = result.Sex;
            info.AgeType = "岁";
            info.ForHelpTelephone = result.ForHelpPhone;
            info.ContactTelephone = result.ContactTelephone;
            info.PatientVersion = result.AlarmType;
            info.OriginalTaskType = result.AlarmType;
            info.ForArea = result.Area;
            info.LocalAddress = result.LocalAddress;
            info.OutStationCode = result.StationCode;
            info.Station = result.Station;
            info.SendAddress = result.SendAddress;
            info.DrivingTime = result.DrivingTime;
            info.ArriveSceneTime = result.ArriveSceneTime;
            info.LeaveSceneTime = result.LeaveSceneTime;
            info.ArriveDestinationTime = result.ArriveDestinationTime;
            info.Driver = result.Driver;
            info.StretcherBearersI = result.StretcherBearers;
            info.DoctorAndNurse = result.Doctor + result.Nurse;
            P_UserBLL bll = new P_UserBLL();
            P_User user = bll.GetListBy(u => u.WorkCode == WorkID).Select(u => u.ToExtModle()).FirstOrDefault(); //查找用户名 密码
            info.AgentCode = user.ID.ToString();
            info.AgentWorkID = WorkID;
            info.AgentName = user.Name;
            info.BeginFillPatientTime = DateTime.Now;
            info.MedicalRecordGenerationTime = DateTime.Now;
            info.FormCompleteLogo = false;
            //obj.FormCompleteTime = null;
            info.ChargeOrder = 0;
            info.SubCenterIFSpotChecks = false;
            info.CenterIFSpotChecks = false;
            info.SubmitLogo = false;
            info.SubmitTime = null;
            info.MedicalStateCode = 0;
            info.LastUpdatePerson = user.Name;//填写病历的人员
            info.LastUpdateTime = DateTime.Now;
            info.CPRIFSuccess = "";//心肺复苏选择
            info.IFRefuseTreatment = "治疗记录";//是否拒绝治疗(救治记录)
            info.RescueType = "";//抢救类型(救治记录)
            info.IMEI = "PAD";//从PAD填写

            pra = new M_PatientRecordAppend();//
            pra.TaskCode = TaskCode;
            pra.PatientOrder = 1;

            prCPR = new M_PatientRecordCPR();//
            prCPR.TaskCode = TaskCode;
            prCPR.PatientOrder = 1;
            prCPR.CenterIFAuditForXFFS = false;
        }
        //获取病历信息
        public void GetPatientRecordInfo(string TaskCode, string WorkID, out M_PatientRecord info, out M_PatientRecordAppend pra, out M_PatientRecordCPR prCPR)
        {
            M_PatientRecordBLL prBLL  = new M_PatientRecordBLL();
            M_AttemperData     result = prBLL.GetAttemperData(TaskCode, ""); //根据任务编码获取调度信息

            info                       = new M_PatientRecord();              //病历主表信息
            info.TaskCode              = TaskCode;
            info.PatientOrder          = 1;
            info.CallOrder             = result.CallOrder;
            info.Name                  = result.Name;
            info.Sex                   = result.Sex;
            info.AgeType               = "岁";
            info.ForHelpTelephone      = result.ForHelpPhone;
            info.ContactTelephone      = result.ContactTelephone;
            info.PatientVersion        = result.AlarmType;
            info.OriginalTaskType      = result.AlarmType;
            info.ForArea               = result.Area;
            info.LocalAddress          = result.LocalAddress;
            info.OutStationCode        = result.StationCode;
            info.Station               = result.Station;
            info.SendAddress           = result.SendAddress;
            info.DrivingTime           = result.DrivingTime;
            info.ArriveSceneTime       = result.ArriveSceneTime;
            info.LeaveSceneTime        = result.LeaveSceneTime;
            info.ArriveDestinationTime = result.ArriveDestinationTime;
            info.Driver                = result.Driver;
            info.StretcherBearersI     = result.StretcherBearers;
            info.DoctorAndNurse        = result.Doctor + result.Nurse;
            P_UserBLL bll  = new P_UserBLL();
            P_User    user = bll.GetListBy(u => u.WorkCode == WorkID).Select(u => u.ToExtModle()).FirstOrDefault(); //查找用户名 密码

            info.AgentCode                   = user.ID.ToString();
            info.AgentWorkID                 = WorkID;
            info.AgentName                   = user.Name;
            info.BeginFillPatientTime        = DateTime.Now;
            info.MedicalRecordGenerationTime = DateTime.Now;
            info.FormCompleteLogo            = false;
            //obj.FormCompleteTime = null;
            info.ChargeOrder           = 0;
            info.SubCenterIFSpotChecks = false;
            info.CenterIFSpotChecks    = false;
            info.SubmitLogo            = false;
            info.SubmitTime            = null;
            info.MedicalStateCode      = 0;
            info.LastUpdatePerson      = user.Name; //填写病历的人员
            info.LastUpdateTime        = DateTime.Now;
            info.CPRIFSuccess          = "";        //心肺复苏选择
            info.IFRefuseTreatment     = "治疗记录";    //是否拒绝治疗(救治记录)
            info.RescueType            = "";        //抢救类型(救治记录)
            info.IMEI = "PAD";                      //从PAD填写


            pra              = new M_PatientRecordAppend();//
            pra.TaskCode     = TaskCode;
            pra.PatientOrder = 1;

            prCPR                      = new M_PatientRecordCPR();//
            prCPR.TaskCode             = TaskCode;
            prCPR.PatientOrder         = 1;
            prCPR.CenterIFAuditForXFFS = false;
        }