// private ApplicationDbContext db = new ApplicationDbContext(); public ActionResult Index(string sortOrder, string searchString) { var students = from s in department_Service.GetDepartments() select s; if (!String.IsNullOrEmpty(searchString)) { students = students.Where(s => s.Department_Name.Contains(searchString) || s.Description.Contains(searchString)); return(View(students.ToList())); } return(View(department_Service.GetDepartments())); }
public List <Package> GetPackageItems(String RegisterNo, int PackageID) { //0 检查科室 1 检验科室 2 功能科室 String[] Names = new String[] { "医生检查项目", "抽血及其它化验项目", "功能检查项目" }; GroupResultBusiness GroupResult = new GroupResultBusiness(); DepartmentBusiness Department = new DepartmentBusiness(); var q = from a in GroupResult.GetGroupResults(RegisterNo) join b in Department.GetDepartments() on a.DeptID equals b.DeptID group b by b.DeptKind into g select new Package { RegisterNo = RegisterNo, GroupID = Convert.ToInt32(g.Key), PackageName = Names[Convert.ToInt32(g.Key)] + g.Count() + "项" }; //return q.ToList(); //Added by pyf 2015-02-26 按23医院要求排序(化验项目 医生检查项目 功能项目) List <Package> Groups = q.ToList(); List <Package> Result = new List <Package>(); List <Package> Temps = Groups.Where(p => p.GroupID == 1).ToList(); if (Temps.Count > 0) { Result.AddRange(Temps); } Temps = Groups.Where(p => (p.GroupID == 0 || p.GroupID == 2)).ToList(); Result.AddRange(Temps); //End of added return(Result); }
private List <Package> GetPackageItems(String RegisterNo, int PackageID) { //0 检查科室 1 检验科室 2 功能科室 String[] Names = new String[] { "抽血及其它化验项目", "医生检查项目", "功能检查项目" }; List <Package> List = new List <Package>(); List <DepartmentEntity> Departments; List <PackageGroupViewEntity> Groups; using (PackageBusiness Business = new PackageBusiness()) { Groups = Business.GetPackageGroups(PackageID); } using (DepartmentBusiness Depart = new DepartmentBusiness()) { Departments = Depart.GetDepartments(); } var q = from a in Groups join b in Departments on a.DeptID equals b.DeptID group b by b.DeptKind into g select new Package { RegisterNo = RegisterNo, GroupID = Convert.ToInt32(g.Key), PackageName = Names[Convert.ToInt32(g.Key)] + g.Count() + "项" }; return(q.ToList()); }
/// <summary> /// 检查科室数据绑定 /// </summary> public override void DataBind() { int RecordCount = 0; DepartmentRepeater.DataSource = m_Dept.GetDepartments(Pager.CurrentPageIndex, Pager.PageSize, out RecordCount); Pager.RecordCount = RecordCount; base.DataBind(); }
public override void DataBind() { using (DepartmentBusiness Department = new DepartmentBusiness()) { int RecordCount = 0; DepartmentRepeater.DataSource = Department.GetDepartments(Pager.CurrentPageIndex, Pager.PageSize, out RecordCount); Pager.RecordCount = RecordCount; base.DataBind(); } }
private void ClientInitial() { using (DepartmentBusiness Department = new DepartmentBusiness()) { int RecordCount = 0; drpDepts.DataSource = Department.GetDepartments(1, 100, out RecordCount); drpDepts.DataValueField = "DeptID"; drpDepts.DataTextField = "DeptName"; drpDepts.DataBind(); } }
/// <summary> /// 系统用户数据绑定 /// </summary> public override void DataBind() { int recordCount = 0; UserRepeater.DataSource = m_User.GetSysUsers(Pager.CurrentPageIndex, Pager.PageSize, out recordCount); Pager.RecordCount = recordCount; using (DepartmentBusiness Dept = new DepartmentBusiness()) { drpDeparts.DataSource = Dept.GetDepartments(); drpDeparts.DataTextField = "DeptName"; drpDeparts.DataValueField = "DeptNo"; } base.DataBind(); }
/// <summary> /// 系统用户数据绑定 /// </summary> public override void DataBind() { int recordCount = 0; UserRepeater.DataSource = m_User.GetSysUsers(Pager.CurrentPageIndex, Pager.PageSize, out recordCount); using (DepartmentBusiness Dept = new DepartmentBusiness()) { drpDeparts.DataSource = Dept.GetDepartments(); drpDeparts.DataTextField = "DeptName"; drpDeparts.DataValueField = "DeptID"; } Pager.RecordCount = recordCount; base.DataBind(); }
private void loadData() { List <Department> list = DB.GetDepartments(false); ddlDepartment.Items.Clear(); ddlDepartment.Items.Add("Select department"); foreach (Department dep in list) { ListItem item = new ListItem(); item.Text = dep.Department_Name; item.Value = dep.Department_Id.ToString(); ddlDepartment.Items.Add(item); } }
private void loadData() { try { Employee employee = EB.GetEmployee(employeeId); imgAvatar.ImageUrl = WebHelper.Instance.GetImageURL(employee.Employee_Avatar, 128, 128, false); txtFName.Text = employee.Employee_FirtName; txtLName.Text = employee.Employee_LastName; if (employee.Employee_Gender) { radGender.SelectedIndex = 0; } else { radGender.SelectedIndex = 1; } txtDOB.Text = employee.Employee_DateOfBirth.ToShortDateString(); txtAddress.Text = employee.Employee_Address; txtPhoneNumber.Text = employee.Employee_PhoneNumber; txtEmail.Text = employee.Employee_Email; List <Department> list = DB.GetDepartments(false); ddlDepartment.Items.Add("Select department"); foreach (Department dp in list) { ListItem item = new ListItem(); item.Text = dp.Department_Name; item.Value = dp.Department_Id.ToString(); ddlDepartment.Items.Add(item); } Department department = DB.GetDepartment(employee.Department_Id); ddlDepartment.SelectedValue = department.Department_Id.ToString(); } catch (Exception ex) { if (Session["return"] == null) { Session.Add("return", "null"); } else { Session["return"] = "null"; } Response.Redirect(WebHelper.Instance.GetURL() + "ManageSystem/Employee/Manage"); } }
public List <GroupItem> GetGroupItems(String RegisterNo, int PackageID) { ItemGroupBusiness ItemGroup = new ItemGroupBusiness(); GroupResultBusiness GroupResult = new GroupResultBusiness(); DepartmentBusiness Department = new DepartmentBusiness(); var q = from a in GroupResult.GetGroupResults(RegisterNo) join b in ItemGroup.GetItemGroups() on a.ID.GroupID equals b.GroupID join c in Department.GetDepartments() on a.DeptID equals c.DeptID select new GroupItem { RegisterNo = RegisterNo, GroupID = Convert.ToInt32(c.DeptKind), GroupName = a.GroupName, Clinical = b.Clinical, Notice = b.Notice, Price = b.Price.Value }; q = q.OrderBy(p => p.GroupID); return(q.ToList()); }
private List <GroupItem> GetGroupItems(String RegisterNo, int PackageID) { List <DepartmentEntity> Departments; List <PackageGroupViewEntity> Groups; using (PackageBusiness Business = new PackageBusiness()) { Groups = Business.GetPackageGroups(PackageID); } using (DepartmentBusiness Depart = new DepartmentBusiness()) { Departments = Depart.GetDepartments(); } var q = from a in Groups join b in Departments on a.DeptID equals b.DeptID select new GroupItem { RegisterNo = RegisterNo, GroupID = Convert.ToInt32(b.DeptKind), GroupName = a.GroupName, Clinical = a.Clinical, Notice = a.Notice }; return(q.ToList()); }
public ActionResult Create() { ViewBag.Department_ID = new SelectList(category_Service.GetDepartments(), "Department_ID", "Department_Name"); return(View()); }