Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ClientScriptManager cs = Page.ClientScript;
                if (!cs.IsStartupScriptRegistered("viewImage"))
                {
                    cs.RegisterStartupScript(this.GetType(), "viewImage",
                                             "<script type=\"text/javascript\" src=\"" + ResolveClientUrl("~/Scripts/Modules/Diagrams/view.js") + "\" ></script>", false);
                }


                // open the attach history in search menu
                if (!string.IsNullOrEmpty(Request.Params["historyId"]))
                {
                    var diagram = service.FindByHistoryID(int.Parse(Request.Params["historyId"]));
                    Response.Write(diagram.Graph);
                    Response.Flush();
                }
                // open original in history menu
                else if (!string.IsNullOrEmpty(Request.Params["id"]) && !string.IsNullOrEmpty(Request.Params["storyId"]))
                {
                    var diagram = service.FindByIDAndUserStory(int.Parse(Request.Params["id"]), int.Parse(Request.Params["storyId"]));
                    Response.Write(diagram.SVG);
                    Response.Flush();
                }
            }
        }
Example #2
0
 private void LoadDiagram(string id, string userStoryId)
 {
     if (!string.IsNullOrEmpty(id))
     {
         var diagram = service.FindByIDAndUserStory(int.Parse(id), int.Parse(userStoryId));
         diagramID.Value          = diagram.attachId.ToString();
         diagramName.Text         = diagram.Attachment.name;
         diagramGraph.Value       = diagram.activties;
         UserStoryID.Value        = userStoryId;
         UserStoriesList.Visible  = false;
         UserStoriesLabel.Visible = false;
     }
 }