예제 #1
0
    private async Task GetReport()
    {
        PowerBIMaintainUCO        UCO    = new PowerBIMaintainUCO();
        TB_EAI_PowerBIApplication App    = UCO.GetTB_EAI_PowerBIApplication();
        TB_EAI_PowerBIReport      Report = UCO.GetTB_EAI_PowerBIReportOne(new TB_EAI_PowerBIReport()
        {
            ApplicationID = App.ApplicationID,
            ReportNO      = Request["Report"]
        });

        await this._embedService.EmbedReport(
            "",
            Report.WorkSpaceID,
            Report.ReportID,
            App.AuthorityUrl,
            App.ResourceUrl,
            Report.ApplicationID,
            App.ApiUrl,
            App.UserName,
            App.Password);

        ScriptManager.RegisterStartupScript(
            this.Page
            , this.Page.GetType()
            , Guid.NewGuid().ToString()
            , string.Format("onSuccess('{0}','{1}','{2}');"
                            , this._embedService.EmbedConfig.EmbedToken.Token
                            , this._embedService.EmbedConfig.EmbedUrl
                            , this._embedService.EmbedConfig.Id)
            , true);
    }
예제 #2
0
    /// <summary>
    /// 檢查資料是否重複
    /// </summary>
    /// <param name="workSpaceId"></param>
    /// <param name="reportId"></param>
    /// <returns></returns>
    private bool CheckDuplicate(TB_EAI_PowerBIReport Data)
    {
        TB_EAI_PowerBIReport checkData = UCO.GetTB_EAI_PowerBIReportOne(
            new TB_EAI_PowerBIReport()
        {
            ApplicationID = Data.ApplicationID,
            WorkSpaceID   = Data.WorkSpaceID,
            ReportID      = Data.ReportID
        });

        cvData.IsValid = checkData == null;
        return(cvData.IsValid);
    }
예제 #3
0
    private void CDS_PowerBI_Setting_ModifyPowerBI_Button1OnClick()
    {
        TB_EAI_PowerBIReport Data = new TB_EAI_PowerBIReport()
        {
            ApplicationID = hfApplicationID.Value,
            WorkSpaceID   = txtWorkSpaceID.Text.Trim(),
            ReportID      = txtReportID.Text.Trim(),
            ReportDesc    = txtReportDesc.Text.Trim(),
            ReportNO      = txtReportNO.Text.Trim()
        };


        if (Request["Mode"].ToString() == "Insert")
        {
            if (CheckDuplicate(Data))
            {
                if (UCO.InsertTB_EAI_PowerBIReport(Data))
                {
                    Dialog.SetReturnValue2("true");
                }
            }
        }
        else
        {
            if ((txtWorkSpaceID.Text == hfWorkSpaceID.Value &&
                 txtReportID.Text == hfReportID.Value) ||
                CheckDuplicate(Data))
            {
                if (UCO.DeleteTB_EAI_PowerBIReportOne(new TB_EAI_PowerBIReport()
                {
                    ApplicationID = hfApplicationID.Value,
                    WorkSpaceID = hfWorkSpaceID.Value,
                    ReportID = hfReportID.Value
                }))
                {
                    if (UCO.InsertTB_EAI_PowerBIReport(Data))
                    {
                        Dialog.SetReturnValue2("true");
                    }
                }
            }
        }
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ((Master_DialogMasterPage)this.Master).Button1OnClick += CDS_PowerBI_Setting_ModifyPowerBI_Button1OnClick;
        ((Master_DialogMasterPage)this.Master).Button2Text     = "";

        if (!IsPostBack)
        {
            hfApplicationID.Value = Request["ApplicationID"].ToString();

            if (Request["Mode"].ToString() == "Insert")
            {
                txtReportID.Text    = "";
                txtReportDesc.Text  = "";
                txtReportNO.Text    = "";
                txtWorkSpaceID.Text = "";
            }


            if (Request["Mode"].ToString() == "Update")
            {
                txtReportID.Text    = Request["ReportID"].ToString();
                txtReportDesc.Text  = "";
                txtReportNO.Text    = "";
                txtWorkSpaceID.Text = Request["WorkSpaceID"].ToString();

                TB_EAI_PowerBIReport Data = UCO.GetTB_EAI_PowerBIReportOne(
                    new TB_EAI_PowerBIReport()
                {
                    ApplicationID = hfApplicationID.Value,
                    ReportID      = txtReportID.Text,
                    WorkSpaceID   = txtWorkSpaceID.Text
                });

                if (Data != null)
                {
                    txtReportDesc.Text  = Data.ReportDesc;
                    txtReportNO.Text    = Data.ReportNO;
                    hfReportID.Value    = Data.ReportID;
                    hfWorkSpaceID.Value = Data.WorkSpaceID;
                }
            }
        }
    }
예제 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            // 系統管理者 PowerBI查閱者
            if (!new BaseUCO().IsUserInRoles(new[] { "SystemAdmin", "PowerBIUser" }))
            {
                Response.Redirect("~/Default.aspx");
            }

            PowerBIMaintainUCO   UCO    = new PowerBIMaintainUCO();
            TB_EAI_PowerBIReport Report = UCO.GetTB_EAI_PowerBIReportOne(new TB_EAI_PowerBIReport()
            {
                ReportNO = Request["Report"]
            });
            AddSiteMapNode("我的首頁", "~/Homepage.aspx");
            AddSiteMapNode("大數據分析");
            AddSiteMapNode("大數據分析");
            AddSiteMapNode(Report.ReportDesc, "~/CDS/PowerBI/Setting/PowerBIReport.aspx?Report=" + Report.ReportNO);

            Page.RegisterAsyncTask(new PageAsyncTask(GetReport));
        }
    }