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()); }
private void SaveCheckedGroups(String RegisterNo, int PackageID, List <int> ItemGroups) { //自定义套餐保存体检组合项 if ((ItemGroups != null) && (ItemGroups.Count > 0)) { SaveCheckedGroups(RegisterNo, ItemGroups); return; } GroupResultDataAccess GroupDataAccess = new GroupResultDataAccess(); using (PackageBusiness Package = new PackageBusiness()) { List <PackageGroupViewEntity> Groups = Package.GetPackageGroups(PackageID); foreach (PackageGroupViewEntity Group in Groups) { GroupResultEntity GroupResult = new GroupResultEntity { ID = new GroupResultPK { GroupID = Group.ID.GroupID, RegisterNo = RegisterNo }, DeptID = Group.DeptID, IsOver = false, PackageID = PackageID }; GroupDataAccess.SaveGroupResult(GroupResult); SaveCheckItems(RegisterNo, Group.ID.GroupID); } } }
private void BindItemGroup(int packageID) { int RecordCount = 0; ItemGroupRepeater.DataSource = m_Package.GetPackageGroups(Pager1.CurrentPageIndex, Pager1.PageSize, packageID, out RecordCount); Pager1.RecordCount = RecordCount; ItemGroupRepeater.DataBind(); }
private void InitialItemGroup() { PackageBusiness Package = new PackageBusiness(); int RecordCount = 0; List <PackageGroupViewEntity> List = Package.GetPackageGroups(1, 200, PackageID, out RecordCount); RepeaterItemCollection Items = ItemGroupRepeater.Items; CheckBox chkSelected; Literal lblGroupID; int GroupID, Count; foreach (RepeaterItem Item in Items) { chkSelected = (CheckBox)Item.FindControl("chkSelected"); lblGroupID = (Literal)Item.FindControl("lblGroupID"); GroupID = Convert.ToInt32(lblGroupID.Text); Count = List.Count(p => p.ID.PackageID == PackageID && p.ID.GroupID == GroupID); if (Count > 0) { chkSelected.Checked = true; } } }
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()); }