Example #1
0
        /// <summary>
        /// 医生模糊查询
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public ActionResult NurseCha(string name)
        {
            string list   = Hctp.GetApi("get", "Administrator/NurseShow?Name=" + name, null);
            var    result = JsonConvert.DeserializeObject <List <NurseModels> >(list);

            return(PartialView("_table", result));
        }
        public ActionResult JiaoHao(int id)
        {
            //获取当前医生下有没有人正在就诊
            var list1 = GetRegistrations().Where(m => m.Reg_Type == 1).ToList();
            var list2 = list1.Count();

            if (list2 > 0)
            {
                return(Content("叫号失败,应为有人正在就诊"));
            }
            //获取挂号表当前病人的挂号信息
            var list = GetTs(id);

            list.Reg_Type = 1;
            var i = Hctp.GetApi("post", "Doctor/UptRegistrations", list);

            if (Convert.ToInt32(i) > 0)
            {
                return(Content("叫号成功"));
            }
            else
            {
                return(Content("叫号失败"));
            }
        }
        public Registration GetTs(int id)
        {
            var list  = Hctp.GetApi("get", "Doctor/GetRegistrations");
            var list1 = JsonConvert.DeserializeObject <List <Registration> >(list).Where(m => m.Reg_Id == id).FirstOrDefault();

            return(list1);
        }
Example #4
0
        /// <summary>
        /// 管理员登录
        /// </summary>
        /// <param name="staff"></param>
        public void Login(StaffLoginModels staff)
        {
            var list  = Hctp.GetApi("get", "Administrator/Login", null);
            var list1 = JsonConvert.DeserializeObject <List <StaffLoginModels> >(list);
            var i     = list1.Where(m => m.Sl_Name == staff.Sl_Name && m.Sl_Pwd == staff.Sl_Pwd).Count();
            var list2 = list1.Where(m => m.Sl_Name == staff.Sl_Name && m.Sl_Pwd == staff.Sl_Pwd).FirstOrDefault();

            if (i > 0)
            {
                Response.Write("<script>alert('登录成功');</script>");
                if (list2.Sl_Type == 0)
                {
                    Response.Write("<script>location.href='/Administrator/Administratorpreants'</script>");
                }
                else if (list2.Sl_Type == 1)
                {
                    Response.Write("<script>location.href='/Administrator/DoctorShow'</script>");
                }
                else if (list2.Sl_Type == 2)
                {
                    Response.Write("<script>location.href='/Administrator/NurseShow'</script>");
                }
            }
            else
            {
                Response.Write("登录失败");
            }
        }
Example #5
0
        /// <summary>
        /// 添加登录人
        /// </summary>
        /// <param name="staff"></param>
        public void LoginAdd(StaffLoginModels staff)
        {
            string list = Hctp.GetApi("post", "Administrator/LoginAdd", staff);

            if (list == "1")
            {
                Session["name"] = staff.Sl_Name;
                Response.Write("<script>alert('添加成功');</script>");
                if (staff.Sl_Type == 0)
                {
                    Response.Write("<script>location.href='/Administrator/Administratorpreants'</script>");
                }
                else if (staff.Sl_Type == 1)
                {
                    Response.Write("<script>location.href='/Administrator/DoctorAdd'</script>");
                }
                else if (staff.Sl_Type == 2)
                {
                    Response.Write("<script>location.href='/Administrator/NurseAdd'</script>");
                }
            }
            else
            {
                Response.Write("<script>alert('添加失败');</script>");
            }
        }
        public ActionResult AddAndChangeZc(Doctorecord d)
        {
            var id   = d.Pat_Id;
            var list = GetTs(id);

            d.Adm_Id   = list.Adm_Id;
            d.Doc_Id   = list.Doc_Id;
            d.Dcr_Time = DateTime.Now.ToString("yyyy-MM-dd");
            var i = Hctp.GetApi("post", "Doctor/AddGetDoctorecord", d);

            if (Convert.ToInt32(i) > 0)
            {
                var Gt = GetTs(d.Reg_Id);
                Gt.Reg_Type = 2;
                var i1 = Hctp.GetApi("post", "Doctor/UptRegistrations", Gt);
                if (Convert.ToInt32(i) > 0)
                {
                    return(Content("成功"));
                }
                else
                {
                    return(Content("失败"));
                }
            }
            else
            {
                return(Content("添加就诊记录失败"));
            }
        }
Example #7
0
        public ActionResult EidtorNurse(int id)
        {
            string             result  = Hctp.GetApi("get", "Administrator/UpdNurse?id=" + id, null);
            List <NurseModels> doctors = JsonConvert.DeserializeObject <List <NurseModels> >(result);
            var doc = doctors.Where(s => s.N_Id == id).FirstOrDefault();

            return(View(doc));
        }
        //第二三级菜单
        public string GetErSanJI(int id)
        {
            var list  = Hctp.GetApi("get", "getList");
            var list1 = JsonConvert.DeserializeObject <List <AddressInfo> >(list);
            var list2 = list1.Where(m => m.Pid == id).ToList();

            return(JsonConvert.SerializeObject(list2));
        }
        public ActionResult ReturnCode()
        {
            var id    = GetDocId();
            var list  = Hctp.GetApi("get", "Doctor/GetReturnrecords");
            var list1 = JsonConvert.DeserializeObject <List <Returnrecord> >(list).Where(m => m.Doc_Id == id).ToList();

            return(View(list1));
        }
        /// <summary>
        /// 查询病人个人信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string GetPatientInfo(int id)
        {
            var info = Hctp.GetApi("get", "Patient/GetPatients");
            var user = JsonConvert.DeserializeObject <List <Patient> >(info).Where(n => n.PatLog_Id == id).FirstOrDefault();
            var json = JsonConvert.SerializeObject(user);

            return(json);
        }
Example #11
0
        public ActionResult Patient(int id)
        {
            //获取用户信息表数据
            var list  = Hctp.GetApi("get", "Patient/GetPatients");
            var list1 = JsonConvert.DeserializeObject <List <Patient> >(list).ToList();
            //筛选
            var list2 = list1.Where(m => m.Pat_Id == id).FirstOrDefault();

            return(View(list2));
        }
Example #12
0
        public ActionResult NurseShow(string Name = "", int pageIndex = 1)
        {
            string list     = Hctp.GetApi("get", "Administrator/NurseShow" + Name, null);
            var    result   = JsonConvert.DeserializeObject <List <NurseModels> >(list);
            int    pageSize = 3;
            int    count    = result.Count();
            IPagedList <NurseModels> pageList = result.ToPagedList(pageIndex, pageSize);

            return(View(pageList));
        }
Example #13
0
        /// <summary>
        /// 医生修改
        /// </summary>
        /// <param name="doctor"></param>
        public void EidtorNurse(NurseModels n)
        {
            string result = Hctp.GetApi("put", "Administrator/EditNurse", n);

            if (result != "0")
            {
                Response.Write("<script>alert('修改成功');location.href='/Administrator/NurseShow';</script>");
            }
            else
            {
                Response.Write("修改失败");
            }
        }
Example #14
0
        public void DeleteNurse(int id)
        {
            string result = Hctp.GetApi("del", "Administrator/DeleteNurse?id=" + id, null);

            if (result != "0")
            {
                Response.Write("<script>alert('删除成功');location.href='/Administrator/NurseShow';</script>");
            }
            else
            {
                Response.Write("删除失败");
            }
        }
Example #15
0
        /// <summary>
        /// 医生修改
        /// </summary>
        /// <param name="doctor"></param>
        public void EidtorDoctor(Doctor doctor)
        {
            string result = Hctp.GetApi("put", "Administrator/EditDoctor", doctor);

            if (result != "0")
            {
                Response.Write("<script>alert('修改成功');location.href='/Administrator/DoctorShow';</script>");
            }
            else
            {
                Response.Write("修改失败");
            }
        }
        public ActionResult LoginDoctor(string title, string password)
        {
            var i = Hctp.GetApi("get", "Doctor/LoginDoctor?name=" + title + "&pwd=" + password);

            if (Convert.ToInt32(i) > 0)
            {
                kc = new HttpCookie("name", title);
                return(Content("成功"));
            }
            else
            {
                return(Content("失败"));
            }
        }
Example #17
0
        public ActionResult DoctorAdd()
        {
            string result = Hctp.GetApi("get", "Administrator/administrativesShow", null);
            List <AdministrativeModel> administratives = JsonConvert.DeserializeObject <List <AdministrativeModel> >(result);
            var selectitem = from a in administratives
                             select new SelectListItem
            {
                Text  = a.Adm_Name,
                Value = a.Adm_Id.ToString(),
            };

            ViewBag.KS = selectitem;
            return(View());
        }
        public ActionResult GetOldRegistration(int pageIndex = 1)
        {
            var id = GetDocId();
            //获取挂号表的数据
            var list = Hctp.GetApi("get", "Doctor/GetRegistrations");
            //获取当前日期
            DateTime data = DateTime.Now;
            //查询当前医生下的说有挂号信息
            var list1 = JsonConvert.DeserializeObject <List <Registration> >(list).Where(m => m.Doc_Id == id).ToList();
            var list2 = list1.Where(m => m.Reg_Type == 2 || m.Reg_Type == 3).ToList();

            //查询当天的就诊信息
            return(View(list1.ToPagedList(pageIndex, 5)));
        }
        public int GetDocId()
        {
            //等级医生姓名获取id值
            var i = kc.Value;
            //查询所有的登陆表信息
            var getDocSid = Hctp.GetApi("get", "Doctor/GetLoginTable");
            //根据姓名查询医生登录表S-Id值
            var getDocSid01 = JsonConvert.DeserializeObject <List <StaffLoginModels> >(getDocSid).Where(m => m.Sl_Name == i).FirstOrDefault().Sl_Id;
            //获取医生表的所有信息
            var getDoc = Hctp.GetApi("get", "Doctor/GetDoctors");
            //获取医生Id
            var getDocid = JsonConvert.DeserializeObject <List <Doctor> >(getDoc).Where(m => m.Sl_Id == getDocSid01).FirstOrDefault().Doc_Id;

            return(getDocid);
        }
Example #20
0
        /// <summary>
        /// 添加界面
        /// </summary>
        /// <param name="d"></param>
        public void NurseAdd(NurseModels n)
        {
            var name      = Session["name"].ToString();
            var getstaff  = Hctp.GetApi("get", "Administrator/Login");
            var getstaff1 = JsonConvert.DeserializeObject <List <StaffLoginModels> >(getstaff).Where(m => m.Sl_Name == name).FirstOrDefault().Sl_Id;

            var list = Hctp.GetApi("post", "Administrator/NurseAdd", n);

            if (list == "1")
            {
                Response.Write("<script>alert('添加成功');location.href='/Administrator/Login';</script>");
            }
            else
            {
                Response.Write("添加失败");
            }
        }
Example #21
0
        //病人登陆
        public void LoginPatient(string title, string password)
        {
            var i = Hctp.GetApi("get", "PatientLogin/PatientLogin?PatientName=" + title + "&PatientPwd=" + password);

            if (Convert.ToInt32(i) > 0)
            {
                Session["UserName"] = title;
                var table = Hctp.GetApi("get", "PatientLogin/GetPatient");
                var json  = JsonConvert.DeserializeObject <List <PatientLogin> >(table).Where(n => n.PatLog_LogName == title && n.PatLog_LogPwd == password).FirstOrDefault();
                Session["UserLogId"] = json.PatLog_Id;
                Response.Write("<script>alert('欢迎您,登陆成功');var index = parent.layer.getFrameIndex(window.name);parent.layer.close(index);parent.window.location.href = '/PatientLogin/ShowIndex';</script>");
            }
            else
            {
                Content("失败");
            }
        }
Example #22
0
        public ActionResult EidtorDoctor(int id)
        {
            string        result  = Hctp.GetApi("get", "Administrator/UpdDoctor?id=" + id, null);
            List <Doctor> doctors = JsonConvert.DeserializeObject <List <Doctor> >(result);
            var           doc     = doctors.Where(s => s.Doc_Id == id).FirstOrDefault();

            string table = Hctp.GetApi("get", "Administrator/administrativesShow", null);
            List <AdministrativeModel> administratives = JsonConvert.DeserializeObject <List <AdministrativeModel> >(table);
            var selectitem = from a in administratives
                             select new SelectListItem
            {
                Text  = a.Adm_Name,
                Value = a.Adm_Id.ToString(),
            };

            ViewBag.KS = selectitem;
            return(View(doc));
        }
Example #23
0
        //把信息添加进缓存里
        public int AddAdre(string one, string two, string three)
        {
            var city = Hctp.GetApi("get", "getList");
            //根据传过来的Id查询对应的城市
            var city1 = JsonConvert.DeserializeObject <List <AddressInfo> >(city);

            one   = city1.Where(m => m.Id == int.Parse(one)).FirstOrDefault().Name;
            two   = city1.Where(m => m.Id == int.Parse(two)).FirstOrDefault().Name;
            three = city1.Where(m => m.Id == int.Parse(three)).FirstOrDefault().Name;

            var      list     = one + two + three;
            var      date     = DateTime.MaxValue;
            TimeSpan timeSpan = new TimeSpan(1, 1, 1);

            //添加进去
            cache1.Add("userInfo1", list, null, date, timeSpan, CacheItemPriority.AboveNormal, null);
            var i = cache1.Count;

            //判断是否成功
            return(i);
        }
        public List <Registration> GetRegistrations()
        {
            //等级医生姓名获取id值
            var i = kc.Value;
            //查询所有的登陆表信息
            var getDocSid = Hctp.GetApi("get", "Doctor/GetLoginTable");
            //根据姓名查询医生登录表S-Id值
            var getDocSid01 = JsonConvert.DeserializeObject <List <StaffLoginModels> >(getDocSid).Where(m => m.Sl_Name == i).FirstOrDefault().Sl_Id;
            //获取医生表的所有信息
            var getDoc = Hctp.GetApi("get", "Doctor/GetDoctors");
            //获取医生Id
            var getDocid = JsonConvert.DeserializeObject <List <Doctor> >(getDoc).Where(m => m.Sl_Id == getDocSid01).FirstOrDefault().Doc_Id;
            //获取挂号表的数据
            var list = Hctp.GetApi("get", "Doctor/GetRegistrations");
            //获取当前日期
            DateTime data = DateTime.Now;
            //查询当前医生下的说有挂号信息
            var list1 = JsonConvert.DeserializeObject <List <Registration> >(list).Where(m => m.Doc_Id == getDocid).ToList();
            //查询当天的就诊信息
            var list2 = list1.Where(m => Convert.ToDateTime(m.Reg_Time).Day - data.Day == 0 && Convert.ToDateTime(m.Reg_Time).Month - data.Month == 0).ToList().Where(m => m.Reg_Type == 0 || m.Reg_Type == 1).ToList();

            return(list2);
        }
        public ActionResult SaveAddReturnrecord(Returnrecord r)
        {
            r.Rer_Time = DateTime.Now.ToString("yyyy-MM-dd");
            var i = Hctp.GetApi("post", "Doctor/AddReturnrecord", r);

            if (Convert.ToInt32(i) > 0)
            {
                var Gt = GetTs(r.Reg_Id);
                Gt.Reg_Type = 3;
                var i1 = Hctp.GetApi("post", "Doctor/UptRegistrations", Gt);
                if (Convert.ToInt32(i) > 0)
                {
                    return(Content("成功"));
                }
                else
                {
                    return(Content("失败"));
                }
            }
            else
            {
                return(Content("添加失败"));
            }
        }
        /// <summary>
        /// 获取医师 绑定下拉
        /// </summary>
        /// <returns></returns>
        public string GetDoctor(int id)
        {
            var list = Hctp.GetApi("get", "Administrative/ShowDoctor?id=" + id);

            return(JsonConvert.SerializeObject(JsonConvert.DeserializeObject <List <Doctor> >(list)));
        }
        /// <summary>
        /// 获取科室 绑定下拉
        /// </summary>
        /// <returns></returns>
        public string GetAdministrative()
        {
            var list = Hctp.GetApi("get", "Administrative/ShowAdministrative");

            return(JsonConvert.SerializeObject(JsonConvert.DeserializeObject <List <AdministrativeModel> >(list)));
        }