Beispiel #1
0
    protected void btnCopyCoreTeam_Click(object sender, EventArgs e)
    {
        try
        {
            GridTableView          grdTableVw     = grdCopyCoreTeam.MasterTableView;
            GridDataItemCollection itemCollection = grdTableVw.Items;
            foreach (GridItem gridItem in itemCollection)
            {
                if (!(gridItem is GridEditableItem))
                {
                    continue;
                }
                GridEditableItem item = gridItem as GridEditableItem;

                CheckBox chkSelected = item["SelectProjectCol"].FindControl("chkSelectProject") as CheckBox;
                if (chkSelected == null)
                {
                    continue;
                }
                if (!chkSelected.Checked)
                {
                    continue;
                }
                int idTargetProject = ApplicationConstants.INT_NULL_VALUE;
                int.TryParse(item["IdProject"].Text, out idTargetProject);

                ProjectCopyCoreTeam copyCoreTeam = new ProjectCopyCoreTeam(SessionManager.GetSessionValueNoRedirect(this, SessionStrings.CONNECTION_MANAGER));
                copyCoreTeam.IdProject       = currentProject.Id;
                copyCoreTeam.IdTargetProject = idTargetProject;
                int result = copyCoreTeam.CopyProjectCoreTeam();
            }

            LoadGrid();
            lblStatus.Text = "Core team successfully copied";
        }
        catch (IndException ex)
        {
            ShowError(ex);
            return;
        }
        catch (Exception ex)
        {
            ShowError(new IndException(ex));
            return;
        }
    }