Exemple #1
0
        public ActionResult Login(FormCollection fc)
        {
            string account  = fc["account"].ToString();
            string password = fc["password"].ToString();

            P_User user = SugarFactory.GetInstance().Queryable <P_User>().Where(it => it.User_Accounts == account).AddJoinInfo("P_SystemRoles", "s2", "User_Roles_Code=Role_Code").Select("P_User.*,s2.Role_Name").Single();
            string pass = Encryption.GetMd5(password);

            if (user != null)
            {
                if (user.User_Pwd.Equals(Encryption.GetMd5(password)))
                {
                    ContextConfig.SetUser(user);
                    return(Content("toastr.success('登陆成功!');", "application/x-javascript"));
                }
                else
                {
                    return(Content("toastr.success('密码错误!');", "application/x-javascript"));
                }
            }
            else
            {
                return(Content("toastr.success('用户不存在!');", "application/x-javascript"));
            }
        }
Exemple #2
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);
        }
Exemple #3
0
        /// <summary>
        /// 登陆超时查询,如果超时则退回到登陆界面
        /// </summary>
        /// <param name="filterContext"></param>
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            P_User user = ContextConfig.GetUser();

            if (ContextConfig.GetUser() == null)
            {
                filterContext.Result = RedirectToRoute("Default", new { Controller = "Login", Action = "RedirectTo" });
            }

            base.OnActionExecuting(filterContext);
        }
Exemple #4
0
 private void updateEpisodes(P_User user)
 {
     if (user == null)
     {
         episodes = new P_Episode[0];
     }
     else
     {
         episodes = api.ListEpisodes(user);
     }
     episodesListGrid.DataSource = episodes;
 }
Exemple #5
0
 private void userListGrid_SelectionChanged(object sender, EventArgs e)
 {
     if (userListGrid.SelectedRows.Count == 0)
     {
         updateEpisodes(null);
     }
     else
     {
         DataGridViewRow row          = userListGrid.SelectedRows[0];
         P_User          selectedUser = users[row.Index];
         updateEpisodes(selectedUser);
     }
 }
        public ActionResult Save(FormCollection fc, P_User cm)
        {
            int rcount = 0;

            if (!String.IsNullOrEmpty(cm.User_Pwd))
            {
                cm.User_Pwd = Encryption.GetMd5(cm.User_Pwd);
            }
            else
            {
                P_User pu = SugarFactory.GetInstance().Queryable <P_User>().InSingle(cm.User_Code);
                cm.User_Pwd = pu.User_Pwd;
            }
            if (Convert.ToInt32(fc["Id"]) > 0)
            {
                rcount = SugarFactory.GetInstance().Updateable <P_User>(cm).ExecuteCommand();
            }
            else
            {
                rcount = SugarFactory.GetInstance().Insertable <P_User>(cm).ExecuteCommand();
            }
            string formOperateType = fc["formOperateType"].ToString().ToLower();

            if (formOperateType == "saveandnewnext")
            {
                if (rcount > 0)
                {
                    return(Json(TipHelper.JsonData("新增用户信息成功", "", IsAlertTip.Yes, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.RefreshThisPage)));
                }
                else
                {
                    return(Json(TipHelper.JsonData("新增用户信息失败!", "", IsAlertTip.Yes, TipType.Error, AlertTipPageType.ThisPage, OperateTypeAfterTip.NoAction)));
                }
            }
            else
            {
                if (rcount > 0)
                {
                    return(Json(TipHelper.JsonData("保存用户信息成功!", "/UserInfo/UserList", IsAlertTip.Yes, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.ThisPageGoAnotherPage)));
                }
                else
                {
                    //表单提交失败固定写法
                    return(Json(TipHelper.JsonData("保存用户信息失败!", "", IsAlertTip.Yes, TipType.Error, AlertTipPageType.ThisPage, OperateTypeAfterTip.NoAction)));
                }
            }
        }
        //获取combobox工号
        public object GetWorkCodeList()
        {
            List <P_User> list   = new List <P_User>();
            StringBuilder strSQL = new StringBuilder();

            strSQL.Append(@"select ID,WorkCode from P_User where IsActive = 1");
            DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.MainConnectionString, CommandType.Text, strSQL.ToString(), null);

            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    P_User info = new P_User();
                    info.ID   = Convert.ToInt32(dr["ID"]);
                    info.Name = dr["WorkCode"].ToString();
                    list.Add(info);
                }
            }
            return(list);
        }
        public ActionResult AddUser(string code, string type)
        {
            ViewBag.MerchantInfo = SugarFactory.GetInstance().Queryable <P_MerchantInfo>().ToList();
            ViewBag.SystemRoles  = SugarFactory.GetInstance().Queryable <P_SystemRoles>().ToList();
            P_User CommInfo = new P_User();

            if (code != null)
            {
                CommInfo          = SugarFactory.GetInstance().Queryable <P_User>().InSingle(Guid.Parse(code));
                CommInfo.User_Pwd = "";
            }
            else
            {
                CommInfo.User_Code = Guid.NewGuid();
                //CommInfo.Creator = ContextConfig.GetUser().User_Code.ToString();
                CommInfo.Creator       = "admin";
                CommInfo.Creation_Time = DateTime.Now;
            }
            ViewBag.type = type;
            return(View(CommInfo));
        }
Exemple #9
0
        public ActionResult DataLoad(int page, int rows, string order, string sort, DateTime startTime, DateTime endTime
                                     , string linkPhone, int alarmEventType, string localAddr, string taskResult, int taskAbendReason
                                     , string centerCode, string stationCode, string ambCode, string driver, string doctor, string litter, string isCharge
                                     , string isFill, string nurse, string patientName, string searchBound, string isTest, string CPRIFSuccess, string PatientState)
        {
            try
            {
                P_User pUser = new P_User();
                pUser = UserOperateContext.Current.Session_UsrInfo;//获取登录人信息
                //bool t= UserOperateContext.Current.Session_UsrRole.Contains(10);//判断登录人是否为司机

                M_UserLoginInfo loginInfo = new M_UserLoginInfo();
                loginInfo.LoginName           = pUser.LoginName;
                loginInfo.Name                = pUser.Name;                             //姓名
                loginInfo.WorkCode            = pUser.WorkCode;                         //工号
                loginInfo.DispatchSubCenterID = pUser.P_Department.DispatchSubCenterID; //所属分中心
                loginInfo.DispatchSationID    = pUser.P_Department.DispatchSationID;    //所属分站
                //loginInfo.RoleID = pUser.P_UserRole.RoleID;

                M_PatientRecordBLL M_PateintRecord = new M_PatientRecordBLL();

                var list = M_PateintRecord.GetTasks(page, rows, order, sort, startTime, endTime, linkPhone, alarmEventType, localAddr
                                                    , taskResult, taskAbendReason, centerCode, stationCode, ambCode, driver, doctor, litter, isCharge, isFill
                                                    , nurse, patientName, searchBound, isTest, loginInfo, CPRIFSuccess, PatientState);
                //if (list != null)
                //{
                //return this.Json(new { total = list, rows = list }, "appliction/json", JsonRequestBehavior.AllowGet);
                return(this.Json(list, "appliction/json", JsonRequestBehavior.AllowGet));
                //}
                //else
                //{
                //   return this.Json(new { total = 0, rows = 0 }, "appliction/json", JsonRequestBehavior.AllowGet);
                //}
            }
            catch
            {
                return(this.Json(""));
            }
        }
Exemple #10
0
        /// <summary>
        /// 病历页面初始化
        /// </summary>
        /// <param name="TaskCode">任务编码</param>
        /// <param name="PatientOrder">序号</param>
        /// <param name="state">填写状态</param>
        /// <returns></returns>
        public ActionResult AddPatientRecord(string TaskCode, int PatientOrder, string state)
        {
            //, int PatientOrder//测试
            M_PatientRecordBLL prBLL = new M_PatientRecordBLL();
            M_DictionaryBLL    dBLL  = new M_DictionaryBLL();
            //int PatientOrder = 1;//测试

            M_AttemperData result = prBLL.GetAttemperData(TaskCode, state);//根据任务编码获取调度信息

            ViewBag.Attemper = result;

            ViewData["TaskCode"] = TaskCode == null ? "2012102023555200020101" : TaskCode;
            M_PatientRecord       prInfo; //病历主表信息
            M_PatientRecordAppend pra;    //病历附表--体检等信息
            M_PatientRecordCPR    prCPR;  //病历附表--心肺复苏

            if (state == "new")
            {
                int AddPatientOrder = prBLL.GetPatientMaxOrder(TaskCode);
                ViewData["PatientOrder"] = AddPatientOrder;
                prInfo               = new M_PatientRecord();
                pra                  = new M_PatientRecordAppend();
                prCPR                = new M_PatientRecordCPR();
                ViewBag.PRInfo       = prInfo; //病历主表信息--传到页面
                ViewBag.PRAppendInfo = pra;    //病历附表--体检等信息--传到页面
                ViewBag.PRCPRInfo    = prCPR;  //病历附表--心肺复苏--传到页面
            }
            else
            {
                object oPatientInfo;//病历主表
                prBLL.GetPatientInfo(TaskCode, PatientOrder, out oPatientInfo, out pra, out prCPR);
                if (PatientOrder > 0)
                {
                    prInfo                   = (M_PatientRecord)oPatientInfo;
                    ViewBag.PRInfo           = prInfo; //病历主表信息--传到页面
                    ViewBag.PRAppendInfo     = pra;    //病历附表--体检等信息--传到页面
                    ViewBag.PRCPRInfo        = prCPR;  //病历附表--心肺复苏--传到页面
                    ViewData["PatientOrder"] = PatientOrder;
                    if (SuperRole("SuperRole"))
                    {
                        this.ViewData["SuperRole"] = "SuperRole";//登录人有超级权限
                    }
                    else
                    {
                        this.ViewData["SuperRole"] = "";
                    }

                    string role = UserOperateContext.Current.getMaxPerForRole(); //获取登录人角色(医生、护士、司机)
                    this.ViewData["PatientRole"] = role;                         //
                }
            }
            ViewData["state"] = state == null ? "new" : state;

            if (SuperRole("PRAuditCPR"))
            {
                this.ViewData["PRAuditCPR"] = "PRAuditCPR";//登录人有“心肺复苏审核”权限
            }
            else
            {
                this.ViewData["PRAuditCPR"] = "";
            }

            if (SuperRole("SubCenterSpotChecks"))
            {
                this.ViewData["SubCenterSpotChecks"] = "SubCenterSpotChecks";//登录人有"分中心抽查"权限
            }
            else
            {
                this.ViewData["SubCenterSpotChecks"] = "";
            }

            if (SuperRole("CenterSpotChecks"))
            {
                this.ViewData["CenterSpotChecks"] = "CenterSpotChecks";//登录人有"中心抽查"权限
            }
            else
            {
                this.ViewData["CenterSpotChecks"] = "";
            }

            P_User pUser = new P_User();

            pUser = UserOperateContext.Current.Session_UsrInfo;//获取登录人信息
            ViewData["AgentCode"]            = pUser.ID;
            ViewData["AgentWorkID"]          = pUser.WorkCode;
            ViewData["AgentName"]            = pUser.Name;
            ViewData["BeginFillPatientTime"] = DateTime.Now.ToString();//开始填写病历时间


            #region 为病历页面的CheckBoxList项目赋值
            CheckViewModel model = new CheckViewModel();
            //model.DiseasesClassification = dBLL.GetCheckBoxModelByTableName("M_ZCaseTemplate");//病种分类
            //model.GongShiRen = dBLL.GetCheckBoxModel("GongShiRen");//供史人
            //model.AnamnesisllnessHistory = dBLL.GetCheckBoxModel("PastMedicalHistory");//既往病史
            model.BodyFigure = dBLL.GetCheckBoxModel("PiFu");     //皮肤
            model.Head       = dBLL.GetCheckBoxModel("Head");     //头部
            model.Neck       = dBLL.GetCheckBoxModel("Neck");     //颈部
            model.Chest      = dBLL.GetCheckBoxModel("Chest");    //胸部
            model.Lung       = dBLL.GetCheckBoxModel("Lung");     //肺脏
            model.LungLeft   = dBLL.GetCheckBoxModel("LungLeft"); //左肺
            model.LungRight  = dBLL.GetCheckBoxModel("LungLeft"); //右肺
            model.FuBu       = dBLL.GetCheckBoxModel("FuBu");     //腹部
            model.JiZhu      = dBLL.GetCheckBoxModel("JiZhu");    //脊柱
            model.Limb       = dBLL.GetCheckBoxModel("Limb");     //四肢
            #endregion

            #region 为病历页面的RadioButtonList从数据库传值

            var ProvideMedicalHistoryPeople = new object(); //供史人
            var DiseasesClassification      = new object(); //病种分类
            var PastMedicalHistory          = new object(); //既往病史
            var BabinskiSign        = new object();         //神经系统--巴氏征
            var ChestExtrusionTest  = new object();         //胸廓挤压试验
            var PelvicExtrusionTest = new object();         //骨盆挤压试验

            lock (m_SyncRoot)
            {
                ProvideMedicalHistoryPeople = CacheHelper.GetCache("ProvideMedicalHistoryPeople");
                DiseasesClassification      = CacheHelper.GetCache("DiseasesClassification");
                PastMedicalHistory          = CacheHelper.GetCache("PastMedicalHistory");
                BabinskiSign        = CacheHelper.GetCache("BabinskiSign");
                ChestExtrusionTest  = CacheHelper.GetCache("ChestExtrusionTest");
                PelvicExtrusionTest = CacheHelper.GetCache("PelvicExtrusionTest");
                if (ProvideMedicalHistoryPeople == null)
                {
                    ProvideMedicalHistoryPeople = dBLL.GetCheckBoxOrRadioButtonList("Checkbox", "ProvideMedicalHistoryPeople", "checkbox");
                    CacheHelper.SetCache("ProvideMedicalHistoryPeople", ProvideMedicalHistoryPeople);
                }
                if (DiseasesClassification == null)
                {
                    DiseasesClassification = dBLL.GetCheckBoxListByTableName("M_ZCaseTemplate", "DiseasesClassification", "checkbox");
                    CacheHelper.SetCache("DiseasesClassification", DiseasesClassification);
                }
                if (PastMedicalHistory == null)
                {
                    PastMedicalHistory = dBLL.GetCheckBoxOrRadioButtonList("Checkbox", "PastMedicalHistory", "checkbox");
                    CacheHelper.SetCache("PastMedicalHistory", PastMedicalHistory);
                }
                if (BabinskiSign == null)
                {
                    BabinskiSign = dBLL.GetCheckBoxOrRadioButtonList("Checkbox", "BabinskiSign", "checkbox");
                    CacheHelper.SetCache("BabinskiSign", BabinskiSign);
                }
                if (ChestExtrusionTest == null)
                {
                    ChestExtrusionTest = dBLL.GetCheckBoxOrRadioButtonList("Radio", "ChestExtrusionTest", "radio");
                    CacheHelper.SetCache("ChestExtrusionTest", ChestExtrusionTest);
                }
                if (PelvicExtrusionTest == null)
                {
                    PelvicExtrusionTest = dBLL.GetCheckBoxOrRadioButtonList("Radio", "PelvicExtrusionTest", "radio");
                    CacheHelper.SetCache("PelvicExtrusionTest", PelvicExtrusionTest);
                }
            }
            this.ViewData["ProvideMedicalHistoryPeople"] = ProvideMedicalHistoryPeople;
            this.ViewData["DiseasesClassification"]      = DiseasesClassification;
            this.ViewData["PastMedicalHistory"]          = PastMedicalHistory;
            this.ViewData["BabinskiSign"]        = BabinskiSign;
            this.ViewData["ChestExtrusionTest"]  = ChestExtrusionTest;
            this.ViewData["PelvicExtrusionTest"] = PelvicExtrusionTest;

            #endregion

            return(View(model));
        }
Exemple #11
0
        private static object m_SyncRoot = new Object();//互斥对象
        //
        // GET: /Medical/

        #region 任务列表
        /// <summary>
        /// 视图-任务列表
        /// </summary>
        public ActionResult MedicalManagement()
        {
            string menuName    = "";
            string startTime   = null;
            string endTime     = null;
            string searchBound = null;

            P_User pUser = new P_User();

            pUser = UserOperateContext.Current.Session_UsrInfo;//获取登录人信息

            ViewData["MenuName"] = menuName;
            ViewData["WorkCode"] = pUser.WorkCode;//登录人ID

            //this.ViewData["startTime"] = startTime == null ? "2012-10-20" : startTime;//测试
            //this.ViewData["endTime"] = endTime == null ? "2012-10-21" : endTime;//测试
            this.ViewData["startTime"] = startTime == null?DateTime.Now.AddDays(-AppConfig.GetConfigInt("PRSearchTime")).ToString("yyyy-MM-dd HH:mm:ss") : startTime;

            this.ViewData["endTime"] = endTime == null?DateTime.Now.AddHours(1).ToString("yyyy-MM-dd HH:mm:ss") : endTime;

            UserOperateContext userOperateContext = new UserOperateContext();
            bool SelectALL        = userOperateContext.getGongneng(38); //查看全部出车信息
            bool SelectOwnCenter  = userOperateContext.getGongneng(42); //查看本分中心
            bool SelectOwnStation = userOperateContext.getGongneng(43); //查看本分站
            bool SelectOwn        = userOperateContext.getGongneng(44); //查看本人出车信息
            bool Insert           = userOperateContext.getGongneng(45); //判断登录人有“新增”病历权限
            bool Edit             = userOperateContext.getGongneng(46); //判断登录人有“修改”病历权限
            bool Delete           = userOperateContext.getGongneng(55); //判断登录人有“删除”病历权限
            bool Look             = userOperateContext.getGongneng(56); //判断登录人有“查看”病历权限

            if (SuperRole("SuperRole"))
            {
                this.ViewData["SuperRole"] = "SuperRole";//登录人有超级权限
            }
            else
            {
                this.ViewData["SuperRole"] = "";
            }


            this.ViewData["SelectOwn"]   = ""; //
            this.ViewData["PatientRole"] = ""; //
            if (SelectALL)
            {
                searchBound = "1";
            }
            else
            {
                if (SelectOwnCenter)
                {
                    searchBound = "2";
                }
                else
                {
                    if (SelectOwnStation)
                    {
                        searchBound = "3";
                    }
                    else
                    {
                        if (SelectOwn)
                        {
                            searchBound = "4";
                            this.ViewData["SelectOwn"] = "SelectOwn";                    //
                            string role = UserOperateContext.Current.getMaxPerForRole(); //获取登录人角色(医生、护士、司机)
                            this.ViewData["PatientRole"] = role;                         //
                        }
                        else
                        {
                            searchBound = "4";
                            this.ViewData["SelectOwn"]   = ""; //
                            this.ViewData["PatientRole"] = ""; //
                        }
                    }
                }
            }
            if (Insert)
            {
                this.ViewData["RolePermissionInsert"] = "Insert";//登录人有新增病历权限
            }
            else
            {
                this.ViewData["RolePermissionInsert"] = "";//
            }
            if (Edit)
            {
                this.ViewData["RolePermissionEdit"] = "Edit";//登录人有修改病历权限
            }
            else
            {
                this.ViewData["RolePermissionEdit"] = "";//
            }
            if (Delete)
            {
                this.ViewData["RolePermissionDelete"] = "Delete";//登录人有删除病历权限
            }
            else
            {
                this.ViewData["RolePermissionDelete"] = "";//
            }
            if (Look)
            {
                this.ViewData["RolePermissionLook"] = "Look";//登录人有查看病历权限
            }
            else
            {
                this.ViewData["RolePermissionLook"] = "";                           //
            }
            this.ViewData["searchBound"] = searchBound == null ? "4" : searchBound; //权限

            return(View());
        }
 private void button4_Click(object sender, EventArgs e)
 {
     P_User.BringToFront();
 }
        //获取病历信息
        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;
        }