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); } } }
protected void btnSave_Click(object sender, EventArgs e) { RepeaterItemCollection Items = ItemGroupRepeater.Items; CheckBox chkSelected; Literal lblGroupID, lblDeptID; String RegisterNo = Request.Params["RegisterNo"]; int PackageID = Convert.ToInt32(Request.Params["PackageID"]); foreach (RepeaterItem Item in Items) { chkSelected = (CheckBox)Item.FindControl("chkSelected"); lblGroupID = (Literal)Item.FindControl("lblGroupID"); lblDeptID = (Literal)Item.FindControl("lblDeptID"); if (chkSelected.Checked) { GroupResultEntity GroupResult = new GroupResultEntity { ID = new GroupResultPK { RegisterNo = RegisterNo, GroupID = Convert.ToInt32(lblGroupID.Text) }, DeptID = Convert.ToInt32(lblDeptID.Text), IsOver = false, PackageID = PackageID }; using (RegistrationBusiness Business = new RegistrationBusiness()) { Business.SaveGroupResult(GroupResult); } } } ShowMessage("数据保存成功!"); }
public void SaveGroupResult(GroupResultEntity GroupResult) { using (GroupResultDataAccess Group = new GroupResultDataAccess()) { Group.SaveGroupResult(GroupResult); SaveCheckItems(GroupResult.ID.RegisterNo, GroupResult.ID.GroupID); } }
private void SaveCheckedGroups(String RegisterNo, List <int> Groups) { ItemGroupDataAccess ItemGroupDA = new ItemGroupDataAccess(); ItemGroupViewEntity ItemGroup; using (GroupResultDataAccess GroupDataAccess = new GroupResultDataAccess()) { foreach (int GroupID in Groups) { ItemGroup = ItemGroupDA.GetItemGroup(GroupID); GroupResultEntity GroupResult = new GroupResultEntity { ID = new GroupResultPK { GroupID = GroupID, RegisterNo = RegisterNo }, DeptID = ItemGroup.DeptID, IsOver = false, PackageID = -1 }; GroupDataAccess.SaveGroupResult(GroupResult); SaveCheckItems(RegisterNo, GroupID); } } }
protected void btnSave_Click(object Source, EventArgs e) { //RegisterNo = hRegisterNo.Value; //GroupId = hGroupID.Value; if (String.IsNullOrWhiteSpace(RegisterNo)) { ShowMessage("数据保存失败,请输入体检登记号。"); return; } Literal lblItemID; TextBox txtCheckResult; int GroupID = Convert.ToInt32(hGroupID.Value), ItemID; ItemResultEntity ItemResult; RepeaterItemCollection Items = ItemResultRepeater.Items; foreach (RepeaterItem Item in Items) { lblItemID = (Literal)Item.FindControl("lblItemID"); txtCheckResult = (TextBox)Item.FindControl("txtCheckResult"); ItemID = Convert.ToInt32(lblItemID.Text); //ItemResult = m_ItemResult.GetItemResult(RegisterNo, GroupID, ItemID); ItemResult = new ItemResultEntity { ID = new ItemResultPK { ItemID = ItemID, GroupID = GroupID, RegisterNo = RegisterNo }, DeptID = DepartNo, CheckDate = DateTime.Now.Date, CheckDoctor = UserName, CheckedResult = txtCheckResult.Text }; m_ItemResult.SaveItemResult(ItemResult); } GroupResultEntity Group = new GroupResultEntity { ID = new GroupResultPK { GroupID = GroupID, RegisterNo = RegisterNo }, DeptID = DepartNo, CheckDate = DateTime.Now.Date, CheckDoctor = UserName, IsOver = true, Summary = txtSummary.Text, PackageID = PackageID }; m_GroupResut.SaveGroupResult(Group); using (GroupSummaryBusiness GroupSummary = new GroupSummaryBusiness()) { String S = hGroupSummary.Value; if (!String.IsNullOrWhiteSpace(S)) { GroupSummary.DeleteGroupSummary(RegisterNo, GroupID); String[] Summarys = S.Split(','); foreach (String Summary in Summarys) { GroupSummaryEntity Entity = new GroupSummaryEntity { RegisterNo = RegisterNo, GroupID = GroupID, SummaryID = Convert.ToInt32(Summary) }; GroupSummary.SaveGroupSummary(Entity); } } } ShowMessage("数据保存成功!"); }
public void DeleteGroupResult(GroupResultEntity GroupResult) { DataAccess.DeleteGroupResult(GroupResult); }
public void SaveGroupResult(GroupResultEntity GroupResult) { DataAccess.SaveGroupResult(GroupResult); }
public void DeleteGroupResult(GroupResultEntity GroupResult) { using (GroupResultDataAccess Group = new GroupResultDataAccess()) { Group.DeleteGroupResult(GroupResult); } }