//构造函数
 public PatientController(Hospital_BLL _BLL, Department_BLL _department_BLL, Grade_BLL _grade_BLL, DoctorLog_BLL _doctorLog_BLL, Disease_records_BLL _disease_Records_BLL, Patient_BLL _patient_BLL)
 {
     hospital_BLL        = _BLL;
     department_BLL      = _department_BLL;
     grade_BLL           = _grade_BLL;
     doctorLog_BLL       = _doctorLog_BLL;
     disease_Records_BLL = _disease_Records_BLL;
     patient_BLL         = _patient_BLL;
 }
예제 #2
0
        public JsonResult getDepartments()
        {
            objDepartmentSetups = new Department_BLL();
            DataTable Department      = objDepartmentSetups.ViewAll();
            var       DepartmentsJson = JsonConvert.SerializeObject(Department);
            var       deserilize      = JsonConvert.DeserializeObject(DepartmentsJson);

            return(Json(new { Department = DepartmentsJson }, JsonRequestBehavior.AllowGet));
        }
 //构造函数
 public BackstageController(Hospital_BLL _BLL, Department_BLL _department_BLL, Grade_BLL _grade_BLL, DoctorLog_BLL _doctorLog_BLL, Disease_records_BLL _disease_Records_BLL, Patient_BLL _patient_BLL, IWebHostEnvironment web)
 {
     hospital_BLL        = _BLL;
     department_BLL      = _department_BLL;
     grade_BLL           = _grade_BLL;
     doctorLog_BLL       = _doctorLog_BLL;
     disease_Records_BLL = _disease_Records_BLL;
     patient_BLL         = _patient_BLL;
     webHost             = web;
 }
예제 #4
0
        public ActionResult ShowDepartment(int id)
        {
            objDeptProp = new Department_Property();
            objDeptProp.Department_Id = id;
            objDeptProp.TableName     = "tblDepartment";
            objDepartmentSetups       = new Department_BLL(objDeptProp);
            DataTable dt = objDepartmentSetups.SelectOne();

            ViewBag.Department = dt;
            return(View("AddDepartment", objDeptProp));
        }
 //构造函数
 //构造函数
 public DoctorLogController(Hospital_BLL _BLL, Department_BLL _department_BLL, Grade_BLL _grade_BLL, DoctorLog_BLL _doctorLog_BLL, Disease_records_BLL _disease_Records_BLL, Patient_BLL _patient_BLL, Doctor_detailed_BLL _doctor_Detailed_Bll, Doctor_money_BLL _doctor_Money_BLL, Live_TV_BLL _live_TV_BLL)
 {
     hospital_BLL        = _BLL;
     department_BLL      = _department_BLL;
     grade_BLL           = _grade_BLL;
     doctorLog_BLL       = _doctorLog_BLL;
     disease_Records_BLL = _disease_Records_BLL;
     patient_BLL         = _patient_BLL;
     doctor_Detailed_Bll = _doctor_Detailed_Bll;
     doctor_Money_BLL    = _doctor_Money_BLL;
     live_TV_BLL         = _live_TV_BLL;
 }
예제 #6
0
        public JsonResult AddDepartment(Department_Property department)
        {
            //customer.CustomerCode = ViewBag.CustomerCode;


            if (ModelState.IsValid)
            {
                if (department.Department_Id <= 0)
                {
                    department.CreatedDate = DateTime.Now;
                    department.Status      = "Active";
                    department.ISActive    = true;
                    department.UserId      = SessionManager.CurrentUser.ID;
                    objDepartmentSetups    = new Department_BLL(department);
                    var flag = objDepartmentSetups.Insert();
                    if (flag)
                    {
                        return(Json(new { success = true, statuscode = 200, msg = "Successfully inserted" }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { success = false, statuscode = 500, msg = "Failed" }, JsonRequestBehavior.AllowGet));
                    }
                }

                else
                {
                    department.CreatedDate = DateTime.Now;
                    department.Status      = "Active";
                    department.ISActive    = true;
                    department.UserId      = SessionManager.CurrentUser.ID;
                    objDepartmentSetups    = new Department_BLL(department);
                    var flag = objDepartmentSetups.Update();
                    if (flag)
                    {
                        return(Json(new { success = true, statuscode = 200, msg = "Successfully Updated" }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { success = false, statuscode = 500, msg = "Failed" }, JsonRequestBehavior.AllowGet));
                    }
                }
            }

            else
            {
                return(Json(new { success = false, statuscode = 500, msg = "Please Enter According To Instructions" }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #7
0
        public void GetDepartments()
        {
            Department_BLL             Department_BLL = new Department_BLL();
            DataTable                  dt             = Department_BLL.ViewAll();
            List <Department_Property> Department_PropertylistItems = new List <Department_Property>();

            foreach (DataRow dr in dt.Rows)
            {
                Department_Property objdepartment = new Department_Property();
                objdepartment.DepartmentName = dr["Department_Name"].ToString();
                objdepartment.Department_Id  = Convert.ToInt32(dr["DepartmentID"].ToString());
                Department_PropertylistItems.Add(objdepartment);
            }
            ViewBag.DepartmentlistItems = Department_PropertylistItems;
        }
 public static void BindDepartmentEntitytoCombobox(ComboBox comboBox)
 {
     try
     {
         Department_BLL D_Dal          = new Department_BLL();
         var            DepartmentList = D_Dal.GetAllEntityFromDAL();
         CommonUIDataBindMethod.BindComboBox(comboBox, DepartmentList, "DeptName", "DeptID", "--所有部门--");
         //comboBox.SelectedValue = DepartmentList.Find(d => d.DeptID == "0").DeptID;
         D_Dal = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show("程序发生错误,信息: " + ex.Message);
     }
 }
예제 #9
0
        public JsonResult DeleteDepartment(int id)
        {
            objDeptProp = new Department_Property();
            objDeptProp.Department_Id = id;
            objDeptProp.TableName     = "tblDepartment";
            objDeptProp.Status        = "Deleted";
            // objDeptProp.U_id = SessionManager.CurrentUser.ID;
            objDepartmentSetups = new Department_BLL(objDeptProp);
            var flag = objDepartmentSetups.UpdateStatus();

            if (flag)
            {
                return(Json(new { success = true, statuscode = 200, msg = "Successfull" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { success = false, statuscode = 500, msg = "Failed" }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #10
0
        public static bool MakeTeacherKCBShowinBrowers(int AtyID, int PSID, string writefilename)
        {
            if (AtyID <= 0)
            {
                return(false);
            }
            StringBuilder filecontent  = new StringBuilder();
            string        filefullname = System.Environment.CurrentDirectory + @"\ShowKCBForTeacher.html";

            if (File.Exists(filefullname))
            {
                try
                {
                    filecontent = FileHelper.ReadFile(filefullname);
                }
                catch (Exception)
                {
                    System.Windows.Forms.MessageBox.Show("读取模板失败");
                    return(false);
                }


                List <ReplaceTagModel> RTMList = new List <ReplaceTagModel>();
                Cschedule_BLL          C_BLL   = new Cschedule_BLL();
                ActiveYear_BLL         A_BLL   = new ActiveYear_BLL();
                var            actyearname     = A_BLL.GetAllEntityFromDAL().Find(d => d.ATID == AtyID).ATName;
                Vw_Teacher_BLL VT_BLL          = new Vw_Teacher_BLL();
                Teacher_BLL    T_BLL           = new Teacher_BLL();
                var            Teacher         = T_BLL.GetAllEntityFromDAL().Find(d => d.PSID == PSID);
                Department_BLL D_BLL           = new Department_BLL();
                var            KCBList         = C_BLL.GetKCBFormvw_Cschedule_ForAtyIandPSID(AtyID, PSID);
                RTMList.Add(new ReplaceTagModel {
                    TagName = KCBForTeaecherHTMLTag.ActYear(), TagValue = actyearname
                });
                RTMList.Add(new ReplaceTagModel {
                    TagName = KCBForTeaecherHTMLTag.TeacherName(), TagValue = Teacher.PsName
                });
                RTMList.Add(new ReplaceTagModel {
                    TagName = KCBForTeaecherHTMLTag.TeacherCoder(), TagValue = Teacher.StandCode
                });
                RTMList.Add(new ReplaceTagModel {
                    TagName = KCBForTeaecherHTMLTag.DeptName(), TagValue = D_BLL.GetAllEntityFromDAL().Find(d => d.DeptID == Teacher.DeptId).DeptName
                });
                RTMList.Add(new ReplaceTagModel {
                    TagName = KCBForTeaecherHTMLTag.TITLE(), TagValue = actyearname + Teacher.PsName + "的课程表"
                });
                var kcblist = KCBList.OrderBy(d => d.Week).ThenBy(d => d.Section).ThenBy(d => d.StartWeek);
                if (kcblist != null)
                {
                    foreach (var kCB in kcblist)
                    {
                        var rtm = RTMList.Find(d => d.TagName == KCBForTeaecherHTMLTag.KCBDayAndSection(kCB.Week, kCB.Section));
                        if (rtm != null)
                        {
                            if (!string.IsNullOrWhiteSpace(rtm.TagValue))
                            {
                                rtm.TagValue = rtm.TagValue + "<br>" + kCB.CourseName + "→" + kCB.TCName + "&nbsp第" + kCB.StartWeek.ToString() + "-" + kCB.EndWeek.ToString() + "周&nbsp" + kCB.RoomName;
                            }
                        }
                        else
                        {
                            RTMList.Add(new ReplaceTagModel {
                                TagName = KCBForTeaecherHTMLTag.KCBDayAndSection(kCB.Week, kCB.Section), TagValue = kCB.CourseName + "→" + kCB.TCName + "&nbsp第" + kCB.StartWeek.ToString() + "-" + kCB.EndWeek.ToString() + "周&nbsp" + kCB.RoomName
                            });
                        }
                    }
                }
                foreach (var item in RTMList)
                {
                    filecontent.Replace(item.TagName, item.TagValue);
                }

                foreach (var item in KCBForTeaecherHTMLTag.KCBDayAndSection())
                {
                    filecontent.Replace(item, string.Empty);
                }
                try
                {
                    FileHelper.WriteFile(writefilename, filecontent);
                }
                catch (Exception)
                {
                    System.Windows.Forms.MessageBox.Show("写入文件失败");
                    return(false);
                }
                return(true);
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("模板文件" + filefullname + "不存在");
                return(false);
            }
        }
예제 #11
0
        public void ProcessRequest(HttpContext context)
        {
            //context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");

            Department_BLL dep   = new Department_BLL();
            Role_BLL       role  = new Role_BLL();
            string         state = context.Request["state"];

            if (state == "select")
            {
                string DepartmentName = context.Request["DepartmentName"];
                int    offset         = Convert.ToInt32(context.Request["offset"]);
                int    pageSize       = Convert.ToInt32(context.Request["pageSize"]);

                string count;

                List <MODEL.Department> list = new List <MODEL.Department>();
                list = dep.selectDepartment(DepartmentName, pageSize, offset, out count);
                var    rs = new { total = count, rows = list };
                string r  = JsonConvert.SerializeObject(rs);
                context.Response.Write(r);
            }
            else if (state == "add")
            {
                string           DepartmentName = context.Request["DepartmentName"];
                MODEL.Department department     = new MODEL.Department();
                department.DepartmentName = DepartmentName;

                if (dep.selectRepeatDepartment(DepartmentName))
                {
                    context.Response.Write('0');
                    return;
                }

                if (dep.AddDepartment(department))
                {
                    context.Response.Write('1');
                }
            }
            else if (state == "del")
            {
                string    jsonStr       = context.Request["jsonStr"];
                string [] departmentsId = JsonConvert.DeserializeObject <string[]>(jsonStr);
                if (dep.DelDepartment(departmentsId))
                {
                    context.Response.Write("1");
                }
                else
                {
                    context.Response.Write("0");
                }
            }
            else if (state == "delO")
            {
                string departmentsId = context.Request["DepartmentID"];
                if (dep.DelDepartment(departmentsId))
                {
                    context.Response.Write("1");
                }
                else
                {
                    context.Response.Write("0");
                }
            }
            else if (state == "updata")
            {
                string           jsonStr    = context.Request["jsonStr"];
                MODEL.Department department = JsonConvert.DeserializeObject <MODEL.Department>(jsonStr);

                if (dep.selectRepeatDepartment(department.DepartmentName, department.DepartmentID))
                {
                    context.Response.Write('0');
                    return;
                }

                if (dep.updataDepartment(department))
                {
                    context.Response.Write("1");
                }
            }
            else if (state == "sel")
            {
                var    rs      = new { Department = dep.selectDepartment(), Role = role.selectRole() };
                string jsonStr = JsonConvert.SerializeObject(rs);
                context.Response.Write(jsonStr);
            }
        }
예제 #12
0
        public static bool MakeTeacherKCBShowinBrowers(int AtyID, int PSID,string writefilename)
        {   if (AtyID<=0)
            {
                return false;
            }
            StringBuilder filecontent = new StringBuilder();
            string filefullname = System.Environment.CurrentDirectory + @"\ShowKCBForTeacher.html";            
            if (File.Exists(filefullname))
            {
                try
                {
                    filecontent = FileHelper.ReadFile(filefullname);
                }
                catch (Exception)
                {
                    System.Windows.Forms.MessageBox.Show("读取模板失败");
                    return false;
                }
                
            
            List<ReplaceTagModel> RTMList = new List<ReplaceTagModel>();
            Cschedule_BLL C_BLL = new Cschedule_BLL();
            ActiveYear_BLL A_BLL = new ActiveYear_BLL();
            var actyearname = A_BLL.GetAllEntityFromDAL().Find(d => d.ATID == AtyID).ATName;
            Vw_Teacher_BLL VT_BLL = new Vw_Teacher_BLL();
            Teacher_BLL T_BLL = new Teacher_BLL();
            var Teacher = T_BLL.GetAllEntityFromDAL().Find(d=>d.PSID==PSID);
            Department_BLL D_BLL = new Department_BLL();
            var KCBList = C_BLL.GetKCBFormvw_Cschedule_ForAtyIandPSID(AtyID, PSID);
            RTMList.Add(new ReplaceTagModel { TagName =KCBForTeaecherHTMLTag.ActYear(),TagValue =  actyearname});
            RTMList.Add(new ReplaceTagModel { TagName = KCBForTeaecherHTMLTag.TeacherName(), TagValue = Teacher.PsName }    );
            RTMList.Add(new ReplaceTagModel { TagName = KCBForTeaecherHTMLTag.TeacherCoder(), TagValue = Teacher.StandCode});
            RTMList.Add(new ReplaceTagModel { TagName = KCBForTeaecherHTMLTag.DeptName(), TagValue = D_BLL.GetAllEntityFromDAL().Find(d => d.DeptID ==Teacher.DeptId).DeptName });
            RTMList.Add(new ReplaceTagModel { TagName = KCBForTeaecherHTMLTag.TITLE(), TagValue = actyearname + Teacher.PsName + "的课程表" });
                var kcblist = KCBList.OrderBy(d => d.Week).ThenBy(d => d.Section).ThenBy(d => d.StartWeek);
                if (kcblist!=null)
                { 
                    foreach (var kCB in kcblist)
                    {
                         var rtm=RTMList.Find(d => d.TagName == KCBForTeaecherHTMLTag.KCBDayAndSection(kCB.Week, kCB.Section));
                         if (rtm!=null)
                            {
                                if (!string.IsNullOrWhiteSpace(rtm.TagValue))
                                    {
                                        rtm.TagValue = rtm.TagValue + "<br>" + kCB.CourseName + "→" + kCB.TCName + "&nbsp第" + kCB.StartWeek.ToString() + "-" + kCB.EndWeek.ToString() + "周&nbsp" + kCB.RoomName;
                                     }
                            }
                            else
                            {
                                RTMList.Add(new ReplaceTagModel { TagName = KCBForTeaecherHTMLTag.KCBDayAndSection(kCB.Week, kCB.Section), TagValue = kCB.CourseName + "→" + kCB.TCName + "&nbsp第" + kCB.StartWeek.ToString() + "-" + kCB.EndWeek.ToString() + "周&nbsp" +kCB.RoomName } )  ; 
                             }
                       }
                }       
                foreach (var item in RTMList)
            {
                    filecontent.Replace(item.TagName, item.TagValue);
                    
                    
             }
             
            foreach (var item in KCBForTeaecherHTMLTag.KCBDayAndSection())
                {
                    filecontent.Replace(item, string.Empty);
                }
            try
            {
                FileHelper.WriteFile(writefilename , filecontent);
            }
            catch (Exception)
            {
                System.Windows.Forms.MessageBox.Show("写入文件失败");
                return false;
            }
            return true;
            }
            else {
                System.Windows.Forms.MessageBox.Show("模板文件"+ filefullname + "不存在");
                return false;
            }
            


        }