protected void InitializePage() { Fascicolo fascicolo = null; HttpContext.Current.Session.Remove("PageSizeStructure"); //Back if (this.Request.QueryString["back"] != null && this.Request.QueryString["back"].Equals("1")) { List <Navigation.NavigationObject> navigationList = Navigation.NavigationUtils.GetNavigationList(); Navigation.NavigationObject obj = navigationList.Last(); if (!obj.CodePage.Equals(Navigation.NavigationUtils.NamePage.PROJECT_STRUCTURE.ToString())) { obj = new Navigation.NavigationObject(); obj = navigationList.ElementAt(navigationList.Count - 2); } fascicolo = UIManager.ProjectManager.getFascicoloById(obj.idProject); } else { fascicolo = UIManager.ProjectManager.getProjectInSession(); } fascicolo.folderSelezionato = ProjectManager.getFolder(this, fascicolo); fascicolo.template = fascicolo.template = ProfilerProjectManager.getTemplateFascDettagli(fascicolo.systemID); UIManager.ProjectManager.setProjectInSession(fascicolo); this.InitializeLabel(); this.InitInitiallyOpenTree(); this.InitializeAddressBooks(); }
//private logedUser = null; protected void Page_Load(object sender, EventArgs e) { this.strFrom = this.Request.QueryString["from"]; this.docNumber = this.Request.QueryString["docNumber"]; this.idProfile = this.Request.QueryString["idProfile"]; this.groupId = this.Request.QueryString["groupId"]; this.numVersion = string.IsNullOrEmpty(this.Request.QueryString["numVersion"]) ? "1" : this.Request.QueryString["numVersion"]; string tknVCAP = this.Request.QueryString["tknVCAP"]; this.idAmministrazione = this.Request.QueryString["idAmministrazione"]; this.idObj = this.Request.QueryString["idObj"]; this.tipoProto = this.Request.QueryString["tipoProto"]; //verifico utente loggato Utente loggedUser = UIManager.UserManager.GetUserInSession(); //UIManager.UserManager.SetUserLanguage("English"); UIManager.LoginManager.IniInitializesLanguages(); string login = Utils.utils.getHttpFullPath() + "/Login.aspx?from=" + this.strFrom + "&idProfile=" + this.idProfile + "&groupId=" + this.groupId + "&numVersion=" + this.numVersion + "&idAmministrazione=" + this.idAmministrazione + "&idObj=" + this.idObj + "&tipoProto=" + this.tipoProto; if (loggedUser == null && !string.IsNullOrEmpty(tknVCAP)) { string authInfo = Decrypt(tknVCAP); string[] authInfoArray = authInfo.Split('|'); DocsPaWR.UserLogin userLogin = new DocsPaWR.UserLogin(); userLogin.UserName = authInfoArray[5]; NttDataWA.Utils.CryptoString crypto = new NttDataWA.Utils.CryptoString(authInfoArray[5]); string encodedValue = crypto.Encrypt(string.Format("UID={0};SESSIONID={1};DATETIME={2}", authInfoArray[5], Guid.NewGuid().ToString(), DateTime.Now)); string passTkn = string.Format("{0}{1}", "SSO=", encodedValue); userLogin.Password = passTkn; userLogin.IdAmministrazione = authInfoArray[4]; userLogin.IPAddress = this.Request.UserHostAddress; userLogin.SessionId = this.Session.SessionID; createBrowserInfo(userLogin); bool result = false; DocsPaWR.LoginResult loginResult; DocsPaWR.Utente user = UIManager.LoginManager.ForcedLogin(this, userLogin, out loginResult); bool result2 = false; if (loginResult == DocsPaWR.LoginResult.OK) { result2 = true; UIManager.UserManager.SetUserInSession(user); UIManager.RoleManager.SetRoleInSession(user.ruoli[0]); UIManager.RegistryManager.SetRFListInSession(UIManager.UserManager.getListaRegistriWithRF(user.ruoli[0].systemId, "1", "")); UIManager.RegistryManager.SetRegAndRFListInSession(UIManager.UserManager.getListaRegistriWithRF(user.ruoli[0].systemId, "", "")); UIManager.DocumentManager.GetLettereProtocolli(); loggedUser = UIManager.UserManager.GetUserInSession(); } } if (loggedUser == null) { HttpContext.Current.Session["directLink"] = Utils.utils.GetHttpRootPath() + this.Request.Url.PathAndQuery; this.ResetSession(); Response.Redirect(login); } else { if (!string.IsNullOrEmpty(groupId)) { Ruolo[] roles = UIManager.UserManager.GetUserInSession().ruoli; Ruolo role = (from r in roles where r.idGruppo.Equals(groupId) select r).FirstOrDefault(); if (role != null) { UIManager.RoleManager.SetRoleInSession(role); UIManager.RegistryManager.SetRegAndRFListInSession(UIManager.UserManager.getListaRegistriWithRF(role.systemId, "", "")); UIManager.RegistryManager.SetRFListInSession(UIManager.UserManager.getListaRegistriWithRF(role.systemId, "1", "")); } } HttpContext.Current.Session["directLink"] = null; switch (strFrom) { case "file": SchedaDocumento schedaDocumento = UIManager.DocumentManager.getDocumentDetails(this, idProfile, docNumber); if (schedaDocumento != null) { UIManager.DocumentManager.setSelectedRecord(schedaDocumento); FileRequest fileToView = schedaDocumento.documenti[int.Parse(this.numVersion) - 1]; FileDocumento fileDoc = UIManager.FileManager.getInstance(schedaDocumento.systemId).GetFile(this.Page, fileToView, false); UIManager.FileManager.setSelectedFile(fileToView); HttpContext.Current.Session["fileDoc"] = fileDoc; HttpContext.Current.Session["OpenDirectLink"] = "true"; this.IsZoom = true; //this.fra_main.Attributes["src"] = ResolveUrl("~/Popup/DocumentViewer.aspx"); //this.fra_main.Attributes["src"] = Utils.utils.getHttpFullPath() + "/Popup/DocumentViewer.aspx"; DocumentViewer.OpenDocumentViewer = true; Response.Redirect(Utils.utils.getHttpFullPath() + "/Popup/DocumentViewer.aspx"); } else { this.fra_main.Visible = false; this.Link1.Visible = true; this.messager.Visible = true; this.lblTxt.Text = Utils.Languages.GetMessageFromCode("ErrorOpenDirectLinkNotAllowed", UIManager.UserManager.GetUserLanguage()); } break; case "record": SchedaDocumento schedaDoc = UIManager.DocumentManager.getDocumentDetails(this, idObj, idObj); if (schedaDoc != null) { UIManager.DocumentManager.setSelectedRecord(schedaDoc); HttpContext.Current.Session["isZoom"] = null; HttpContext.Current.Session["OpenDirectLink"] = "true"; //this.fra_main.Attributes["src"] = ResolveUrl("~/Document/Document.aspx"); //this.fra_main.Attributes["src"] = Utils.utils.getHttpFullPath() + "/Document/Document.aspx"; Response.Redirect(Utils.utils.getHttpFullPath() + "/Document/Document.aspx"); } else { this.fra_main.Visible = false; this.Link1.Visible = true; this.messager.Visible = true; this.lblTxt.Text = Utils.Languages.GetMessageFromCode("ErrorOpenDirectLinkNotAllowed", UIManager.UserManager.GetUserLanguage()); } break; case "project": Fascicolo proj = UIManager.ProjectManager.getFascicoloDaCodice(this, idObj); if (proj != null) { proj.template = ProfilerProjectManager.getTemplateFascDettagli(proj.systemID); UIManager.ProjectManager.setProjectInSession(proj); HttpContext.Current.Session["isZoom"] = null; HttpContext.Current.Session["OpenDirectLink"] = "true"; // this.fra_main.Attributes["src"] = ResolveUrl("~/Project/Project.aspx"); //this.fra_main.Attributes["src"] = Utils.utils.getHttpFullPath() + "/Project/Project.aspx"; Response.Redirect(Utils.utils.getHttpFullPath() + "/Project/Project.aspx"); } else { this.fra_main.Visible = false; this.Link1.Visible = true; this.messager.Visible = true; this.lblTxt.Text = Utils.Languages.GetMessageFromCode("ErrorOpenDirectLinkNotAllowed", UIManager.UserManager.GetUserLanguage()); } break; } } }
protected void RepListTask_ItemCommand(object source, RepeaterCommandEventArgs e) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "function", "<script>reallowOp();</script>", false); string idTask = (e.Item.FindControl("idTask") as HiddenField).Value; DocsPaWR.Task task = (from t in this.TaskDayInTimetable where t.ID_TASK.Equals(idTask) select t).FirstOrDefault(); string idObject = string.Empty; switch (e.CommandName) { case "ViewContributo": string idReview = task.ID_PROFILE_REVIEW; #region navigation List <Navigation.NavigationObject> navigationList2 = Navigation.NavigationUtils.GetNavigationList(); Navigation.NavigationObject actualPage2 = new Navigation.NavigationObject(); actualPage2.IdObject = idReview; actualPage2.OriginalObjectId = idReview; actualPage2.NamePage = Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(), string.Empty); actualPage2.Link = Navigation.NavigationUtils.GetLink(Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(), true, this.Page); actualPage2.CodePage = Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(); actualPage2.Page = "TASK.ASPX"; navigationList2.Add(actualPage2); Navigation.NavigationUtils.SetNavigationList(navigationList2); #endregion SchedaDocumento schedaDocumento = UIManager.DocumentManager.getDocumentDetails(this.Page, idReview, idReview); UIManager.DocumentManager.setSelectedRecord(schedaDocumento); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "closeAJM", "parent.closeAjaxModal('DayInTimetable','document');", true); return; case "ViewObjectTask": idTask = task.ID_TASK; idObject = task.ID_PROFILE; if (!string.IsNullOrEmpty(idObject)) { #region navigation List <Navigation.NavigationObject> navigationList = Navigation.NavigationUtils.GetNavigationList(); Navigation.NavigationObject actualPage = new Navigation.NavigationObject(); actualPage.IdObject = idObject; actualPage.OriginalObjectId = idObject; actualPage.NamePage = Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(), string.Empty); actualPage.Link = Navigation.NavigationUtils.GetLink(Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(), true, this.Page); actualPage.CodePage = Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(); actualPage.Page = "TASK.ASPX"; navigationList.Add(actualPage); Navigation.NavigationUtils.SetNavigationList(navigationList); #endregion SchedaDocumento schedaDoc = UIManager.DocumentManager.getDocumentDetails(this.Page, idObject, idObject); UIManager.DocumentManager.setSelectedRecord(schedaDoc); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "closeAJM", "parent.closeAjaxModal('DayInTimetable','document');", true); return; } else { idObject = task.ID_PROJECT; #region navigation List <Navigation.NavigationObject> navigationList = Navigation.NavigationUtils.GetNavigationList(); Navigation.NavigationObject actualPage = new Navigation.NavigationObject(); actualPage.IdObject = idObject; actualPage.OriginalObjectId = idObject; actualPage.NamePage = Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(), string.Empty); actualPage.Link = Navigation.NavigationUtils.GetLink(Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(), true, this.Page); actualPage.CodePage = Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(); actualPage.Page = "TASK.ASPX"; navigationList.Add(actualPage); Navigation.NavigationUtils.SetNavigationList(navigationList); #endregion Fascicolo fascicolo = UIManager.ProjectManager.getFascicoloById(idObject); if (fascicolo != null) { fascicolo.template = ProfilerProjectManager.getTemplateFascDettagli(fascicolo.systemID); } UIManager.ProjectManager.setProjectInSession(fascicolo); if (fascicolo == null || ProjectManager.CheckRevocationAcl()) { ProjectManager.setProjectInSession(null); ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "parent.fra_main.ajaxDialogModal('RevocationAclIndex', 'warning', '','',null,null,'')", true); return; } ScriptManager.RegisterStartupScript(Page, Page.GetType(), "closeAJM", "parent.closeAjaxModal('DayInTimetable','project');", true); return; } case "RemoveTask": this.TaskSelectedInDay = task; ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxConfirmModal", "ajaxConfirmModal('ConfirmRemoveTask', 'HiddenRemoveTask1', '');", true); break; case "AnnullaTask": this.TaskSelectedInDay = task; ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxConfirmModal", "ajaxConfirmModal('ConfirmCancelTask', 'HiddenCancelTask1', '');", true); break; case "CloseTask": this.TaskSelectedInDay = task; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "CompleteTask", "parent.ajaxModalPopupCompleteTaskFromDay();", true); break; case "RiapriLavorazione": this.TaskSelectedInDay = task; ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ReopenTask", "ajaxModalPopupReopenTask();", true); break; case "CreaContributo": idTask = task.ID_TASK; idObject = !string.IsNullOrEmpty(task.ID_PROFILE) ? task.ID_PROFILE : task.ID_PROJECT; string error = this.CreaContributo(task); if (string.IsNullOrEmpty(error)) { #region navigation List <Navigation.NavigationObject> navigationList1 = Navigation.NavigationUtils.GetNavigationList(); Navigation.NavigationObject actualPage1 = new Navigation.NavigationObject(); actualPage1.IdObject = idObject; actualPage1.OriginalObjectId = idObject; actualPage1.NamePage = Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(), string.Empty); actualPage1.Link = Navigation.NavigationUtils.GetLink(Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(), true, this.Page); actualPage1.CodePage = Navigation.NavigationUtils.NamePage.HOME_TASK.ToString(); actualPage1.Page = "TASK.ASPX"; navigationList1.Add(actualPage1); Navigation.NavigationUtils.SetNavigationList(navigationList1); #endregion HttpContext.Current.Session["Task"] = task; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "closeAJM", "parent.closeAjaxModal('DayInTimetable','document');", true); } else if (error == "AnswerChooseRecipient") { ScriptManager.RegisterStartupScript(this, this.GetType(), "AnswerChooseRecipient", "ajaxModalPopupAnswerChooseRecipient();", true); } else { HttpContext.Current.Session["Task"] = null; ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "parent.fra_main.ajaxDialogModal('" + error.Replace("'", @"\'") + "', 'warning', '','',null,null,'')", true); } break; } }
protected void hpl_Link_Click(Object sender, EventArgs e) { string idDocFasc = this.hf_IdValue.Value; if (IsEsterno) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "redExternal", "window.open('" + this.txt_Link.Text + "','');", true); } else { if (!string.IsNullOrEmpty(idDocFasc)) { List <Navigation.NavigationObject> navigationList = Navigation.NavigationUtils.GetNavigationList(); Navigation.NavigationObject actualPage = new Navigation.NavigationObject(); if (IsFascicolo) { Fascicolo fascicolo = UIManager.ProjectManager.getFascicoloById(idDocFasc); fascicolo.template = ProfilerProjectManager.getTemplateFascDettagli(fascicolo.systemID); if (!string.IsNullOrEmpty(this.From) && this.From.Equals("D")) { actualPage.IdObject = UIManager.DocumentManager.getSelectedRecord().systemId; actualPage.NamePage = Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.DOCUMENT.ToString(), string.Empty); actualPage.Link = Navigation.NavigationUtils.GetLink(Navigation.NavigationUtils.NamePage.DOCUMENT.ToString(), true, this.Page); actualPage.CodePage = Navigation.NavigationUtils.NamePage.DOCUMENT.ToString(); actualPage.Page = "DOCUMENT.ASPX"; } else { actualPage.IdObject = UIManager.ProjectManager.getProjectInSession().systemID; actualPage.NamePage = Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.PROJECT.ToString(), string.Empty); actualPage.Link = Navigation.NavigationUtils.GetLink(Navigation.NavigationUtils.NamePage.PROJECT.ToString(), true, this.Page); actualPage.CodePage = Navigation.NavigationUtils.NamePage.PROJECT.ToString(); actualPage.Page = "PROJECT.ASPX"; } UIManager.ProjectManager.setProjectInSession(fascicolo); Response.Redirect("~/Project/project.aspx"); } else { if (!string.IsNullOrEmpty(this.From) && this.From.Equals("D")) { actualPage.IdObject = UIManager.DocumentManager.getSelectedRecord().systemId; actualPage.NamePage = Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.DOCUMENT.ToString(), string.Empty); actualPage.Link = Navigation.NavigationUtils.GetLink(Navigation.NavigationUtils.NamePage.DOCUMENT.ToString(), true, this.Page); actualPage.CodePage = Navigation.NavigationUtils.NamePage.DOCUMENT.ToString(); actualPage.Page = "DOCUMENT.ASPX"; } else { actualPage.IdObject = UIManager.ProjectManager.getProjectInSession().systemID; actualPage.NamePage = Navigation.NavigationUtils.GetNamePage(Navigation.NavigationUtils.NamePage.PROJECT.ToString(), string.Empty); actualPage.Link = Navigation.NavigationUtils.GetLink(Navigation.NavigationUtils.NamePage.PROJECT.ToString(), true, this.Page); actualPage.CodePage = Navigation.NavigationUtils.NamePage.PROJECT.ToString(); actualPage.Page = "PROJECT.ASPX"; } navigationList.Add(actualPage); Navigation.NavigationUtils.SetNavigationList(navigationList); SchedaDocumento schedaDocumento = UIManager.DocumentManager.getDocumentDetails(this.Page, idDocFasc, idDocFasc); UIManager.DocumentManager.setSelectedRecord(schedaDocumento); Response.Redirect("~/Document/Document.aspx"); } } } }