Пример #1
0
        protected void grdCKISData_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                Guid        myRow_Id = Guid.Parse(e.CommandArgument.ToString());
                GridViewRow row      = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
                int         index    = row.RowIndex;
                if (e.CommandName == "Manage")
                {
                    dvMsg.Style.Add("display", "none");
                    List <MDMSVC.DC_Activity> res = new List <MDMSVC.DC_Activity>();
                    searchactivity("BYID", myRow_Id, out res);
                    frmCKISMasterData.ChangeMode(FormViewMode.Edit);
                    frmCKISMasterData.DataSource = res;
                    frmCKISMasterData.DataBind();

                    List <MDMSVC.DC_Activity_Content> result = mastersvc.GetActivityContentMaster(new MDMSVC.DC_Activity_Content()
                    {
                        Activity_Id = myRow_Id
                    });
                    if (result != null)
                    {
                        Repeater rptInclusions = (Repeater)frmCKISMasterData.FindControl("rptInclusions");
                        if (rptInclusions != null)
                        {
                            rptInclusions.DataSource = (from a in result where a.Content_Type.ToUpper() == "INCLUSION" select a);
                            rptInclusions.DataBind();
                        }
                        Repeater rptExclusion = (Repeater)frmCKISMasterData.FindControl("rptExclusion");
                        if (rptExclusion != null)
                        {
                            rptExclusion.DataSource = (from a in result where a.Content_Type.ToUpper() == "EXCLUSION" select a);
                            rptExclusion.DataBind();
                        }
                        Repeater rptNotes = (Repeater)frmCKISMasterData.FindControl("rptNotes");
                        if (rptNotes != null)
                        {
                            rptNotes.DataSource = (from a in result where a.Content_Type.ToUpper() == "NOTES" select a);
                            rptNotes.DataBind();
                        }
                    }
                    hdnFlag.Value = "false";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "javascript:showManageModal();", true);
                }
            }
            catch
            {
            }
        }