Exemple #1
0
    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("数据保存成功!");
    }