Esempio n. 1
0
    //END: blog - SK
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        string fldid;
        m_refMsg = m_refAPI.EkMsgRef;
        m_sPage = Request.QueryString["page"];
        aprId = System.Convert.ToInt64(Request.QueryString["id"]);
        CurrentUserId = m_refAPI.UserId;
        SitePath = m_refAPI.SitePath;
        RegisterResources();

        if (!(Request.QueryString["LangType"] == null))
        {
            if (Request.QueryString["LangType"] != "")
            {
                ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                m_refAPI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            }
            else
            {
                if (m_refAPI.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = Convert.ToInt32(m_refAPI.GetCookieValue("LastValidLanguageID"));
                }
            }
        }
        else
        {
            if (m_refAPI.GetCookieValue("LastValidLanguageID") != "")
            {
                ContentLanguage = Convert.ToInt32(m_refAPI.GetCookieValue("LastValidLanguageID"));
            }
        }
        m_refAPI.ContentLanguage = ContentLanguage;
        m_refContent = m_refAPI.EkContentRef;

        if (Request.QueryString["content"] == "published")
        {
            m_cCont = m_refContent.GetContentByIDv2_0(aprId);
            toggle = "staged";
        }
        else
        {
            m_cCont = m_refContent.GetStagedContByIDv2_0(aprId);
            toggle = "published";
            if (m_cCont.Count == 0)
            {
                m_cCont = null;
                m_cCont = m_refContent.GetContentByIDv2_0(aprId);
                toggle = "staged";
                if (m_sPage == "workarea")
                {
                    Response.Redirect((string)("approval.aspx?action=viewApprovalList&id=" + Request.QueryString["fldid"]), false);
                }
                else
                {
                    Response.Write("<script language=\"Javascript\">" + "top.opener.location.reload(true);" + "top.close();" + "</script>");
                }
            }
        }
        m_meObj = m_refContent.CanIv2_0(aprId, "content");
        fldid = m_cCont["FolderID"].ToString();

        cApprovals = m_refContent.GetCurrentApprovalInfoByIDv1_1(aprId);

        m_TaskExists = m_refContent.DoesTaskExistForContent(Convert.ToInt64(m_cCont["ContentID"]));
        ViewContent();
    }