protected void btnSave_Click(object sender, EventArgs e) { PackageBusiness Package = new PackageBusiness(); RepeaterItemCollection Items = ItemGroupRepeater.Items; CheckBox chkSelected; Literal lblGroupID; PackageGroupEntity PackageGroup; foreach (RepeaterItem Item in Items) { chkSelected = (CheckBox)Item.FindControl("chkSelected"); lblGroupID = (Literal)Item.FindControl("lblGroupID"); PackageGroup = new PackageGroupEntity(); PackageGroup.ID = new PackageGroupPK { PackageID = PackageID, GroupID = Convert.ToInt32(lblGroupID.Text) }; if (chkSelected.Checked) { Package.SavePackageGroup(PackageGroup); } if (!chkSelected.Checked) { Package.DeletePackageGroup(PackageGroup); } } decimal PackageCharge = Package.GetPackagePrice(PackageID); hValue.Value = PackageCharge + ""; Package.UpdatePackagePrice(PackageID, PackageCharge); ShowMessage("套餐组合项保存成功!"); }