protected void Page_Load(object sender, EventArgs e) { Security.Theme theme = ((Security.ComputableWorkflowReference)Session["wfr"]).GetTheme(); System.IO.MemoryStream ms = new System.IO.MemoryStream(); theme.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); Response.ClearContent(); Response.ContentType = "image/Bmp"; Response.BinaryWrite(ms.ToArray()); }
private void loadWf(string wfId, string crId, string user, string serv, string tokMail) { Trace.Warn("Begin load workflow"); Security.ComputableWorkflowReference cref = Security.Token.GetWorkflow(wfId, crId, user, serv, tokMail); if (cref == null) { contentAll.Style.Add("background", "#A7A7A7 url('../lib/image/lock2.png') no-repeat center"); contentAll.Style.Add("-moz-opacity", "0.35"); contentAll.Visible = true; Page.Controls.Add(new LiteralControl("<script>setType(-2);</script>")); Session["wf"] = null; } else { Session["wfr"] = cref; workflow = cref.GetWorkflow(); Session["wf"] = workflow; //si fa la prima visualizzazione renderNode(workflow.GetState()); #region caricamento del tema 2° versione pro Security.Theme theme = ((Security.ComputableWorkflowReference)Session["wfr"]).GetTheme(); Page.Header.Controls.Add(new LiteralControl(@"<style type='text/css'>" + theme.CSS + "</style" + ">")); if (theme.Title == "") { formTitle.InnerText = "Testo di prova"; } else { formTitle.InnerText = theme.Title; formTitle.Style.Add("font-family", "Verdana"); formTitle.Style.Add("font-size", "30px"); } #endregion } Trace.Warn("End load workflow"); }
protected void Page_Init(object sender, EventArgs e) { //presenPanel.Controls.Add(nodePlaceHolder); //presenPanel.Controls.Add(); if (!Page.IsPostBack) { Trace.Warn("Begin retrieving env variabiles from db"); Page.Controls.Add(new LiteralControl("<script>headerDivRed('none');</script>")); String crId = Request.Params.Get("CompilationRequestID"); String wfId = Request.Params.Get("WorkflowID"); String user = Request.Params.Get("Username"); String serv = Request.Params.Get("Service"); String tokMail = Request.Params.Get("Token"); Trace.Warn("End retrieving env variabiles from db"); if (crId != null) { if (!crId.Equals("-1")) {//Abbiamo tutto loadWf(wfId, crId, user, serv, tokMail); } else { //Manca qualcosa crID ==-1 if (Session["LoginContactUserID"] == null) { //E' la prima volta che viene richieta la pagina con crId == -1 int serviceid = -1; try { serviceid = int.Parse(serv); } catch (Exception e2) { serviceid = -1; } if (serviceid == -1) {//Va fatto scegliere il servizio contentAll.Style.Add("background", "#A7A7A7 url('../lib/image/lock2.png') no-repeat center"); contentAll.Style.Add("-moz-opacity", "0.35"); contentAll.Visible = true; List <Security.Service> listaServizi = Security.ExternalService.List(); string temp = ""; foreach (Security.Service s in listaServizi) { temp = temp + s.ServiceName + "|"; } Page.Controls.Add(new LiteralControl("<script>setType(-1, '" + temp + "');</script>")); } //Si presume che serv sia valido o scelto dall'utente Session["LoginContact"] = true; Session["LoginContactServiceID"] = serviceid; Session["LoginContactReturnURL"] = "http://" + Security.EnvironmentManagement.getEnvValue("webServerAddress") + Request.Url.AbsolutePath + Request.Url.Query; if (serviceid != -1) { Response.Redirect("http://" + Security.EnvironmentManagement.getEnvValue("webServerAddress") + "/Auth/login.aspx"); } } else {//Vuol dire che Session["LoginContactUserID"] != null, e' la seconda volta e ho tutte le info // Si ma le hai nella sessione! serv = "" + (int)Session["LoginContactServiceID"]; user = (string)Session["LoginContactUserID"]; // Pulisco la sessione, nn mi servono piu' Session["LoginContactServiceID"] = null; Session["LoginContactUserID"] = null; loadWf(wfId, crId, user, serv, tokMail); } } } else { workflow = (IComputableWorkflow)Session["wf"]; WFnode currentNode = workflow.GetState(); renderNode(currentNode); UpdateHistory(currentNode, new ActionResult(true)); } } else { Page.Controls.Add(new LiteralControl("<script>headerDivRed('filling');</script>")); workflow = ((IComputableWorkflow)Session["wf"]); if (workflow != null) { if (!workflow.IsEndComputationState) { renderNode(workflow.GetState()); } Security.Theme theme = ((Security.ComputableWorkflowReference)Session["wfr"]).GetTheme(); Page.Header.Controls.Add(new LiteralControl(@"<style type='text/css'>" + theme.CSS + "</style" + ">")); if (theme.Title == "") { formTitle.InnerText = "NO TITLE"; formTitle.Style.Add("font-family", "Verdana"); formTitle.Style.Add("font-size", "30px"); } else { formTitle.InnerText = theme.Title; } } } }