Exemple #1
0
        protected override object[] LoadDataSource(int inclusive, int exclusive)
        {
            string strValue = this.drpRptId.SelectedValue;

            if (rptFacade == null)
            {
                rptFacade = new ReportViewFacade(this.DataProvider);
            }
            object objEntry = rptFacade.GetRptViewEntry(strValue);

            if (objEntry != null)
            {
                RptViewEntry entry = (RptViewEntry)objEntry;
                if (entry.EntryType == ReportEntryType.Report && entry.ReportID != "")
                {
                    RptViewUserDefault objDef = (RptViewUserDefault)rptFacade.GetRptViewUserDefault(this.GetUserCode());
                    this.chkReportAsDefault.Checked = false;
                    if (objDef != null && objDef.DefaultReportID == entry.ReportID)
                    {
                        this.chkReportAsDefault.Checked = true;
                    }

                    object[] objs = rptFacade.GetNeedInputByReportId(entry.ReportID, this.GetUserCode());
                    this.pagerToolBar.RowCount = objs.Length;
                    return(objs);
                }
            }
            this.chkReportAsDefault.Checked = false;
            this.pagerToolBar.RowCount      = 0;
            return(null);
        }
Exemple #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (this.IsPostBack == false)
            {
                // 初始化页面语言
                this.InitPageLanguage(this.languageComponent1, false);
                string strRptId = this.GetRequestParam("reportid");
                if (strRptId == "")
                {
                    throw new Exception("$Error_RequestUrlParameter_Lost");
                }

                ReportViewFacade rptFacade = new ReportViewFacade(this.DataProvider);

                InitSecurityList(strRptId);

                object[] objTmps = rptFacade.GetRptViewEntryFolder();
                if (objTmps != null)
                {
                    RptViewEntry[] entityList = new RptViewEntry[objTmps.Length];
                    objTmps.CopyTo(entityList, 0);
                    InitReportFolderList(entityList);
                }
                if (strRptId != "")
                {
                    RptViewDesignMain rptMain = (RptViewDesignMain)rptFacade.GetRptViewDesignMain(strRptId);
                    this.txtReportName.Text = rptMain.ReportName;
                    if (rptMain != null && rptMain.ParentReportFolder != "")
                    {
                        this.drpReportFolder.SelectedValue = rptMain.ParentReportFolder;
                    }
                }
            }
        }
Exemple #3
0
        protected override void AddDomainObject(object domainObject)
        {
            if (this._facade == null)
            {
                this._facade = new ReportViewFacade(this.DataProvider);
            }
            RptViewEntry entry = (RptViewEntry)domainObject;

            entry.EntryType       = ReportEntryType.Folder;
            entry.ParentEntryCode = this.txtEntryCodeQuery.Text;
            this._facade.AddRptViewEntry(entry);
        }
Exemple #4
0
 private void AppendParentParameter(RptViewEntry entity, RptViewEntry[] entityList, string prefix)
 {
     drpReportFolder.Items.Add(new ListItem(prefix + entity.EntryName, entity.EntryCode));
     for (int i = 0; i < entityList.Length; i++)
     {
         if (entityList[i].ParentEntryCode == entity.EntryCode)
         {
             char nbsp = (char)0xA0;
             AppendParentParameter(entityList[i], entityList, prefix + (new string(nbsp, 4)));
         }
     }
 }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (this.IsPostBack == false)
            {
                // 初始化页面语言
                this.InitPageLanguage(this.languageComponent1, false);
                string strFileName = this.designView.UploadFileName;
                strFileName             = strFileName.Substring(strFileName.LastIndexOf("\\") + 1);
                this.txtReportFile.Text = strFileName;
                this.txtReportName.Text = this.designView.DesignMain.ReportName;

                ////Modified by allen on 20081104 for change to FunctionGroup
                //BenQGuru.eMES.BaseSetting.UserFacade userFacade = new BenQGuru.eMES.BaseSetting.UserFacade(this.DataProvider);
                //object[] objGroup = userFacade.GetAllUserGroup();
                BenQGuru.eMES.BaseSetting.SystemSettingFacade systemSetFacade = new BenQGuru.eMES.BaseSetting.SystemSettingFacade(this.DataProvider);
                object[] objGroup = systemSetFacade.GetAllFunctionGroup();
                ////End Modified by allen on 20081104 for change to FunctionGroup

                ReportViewFacade        rptFacade   = new ReportViewFacade(this.DataProvider);
                RptViewReportSecurity[] rptSecurity = null;
                if (this.designView.DesignMain.ReportID != "")
                {
                    rptSecurity = rptFacade.GetRptViewReportSecurityByReportId(this.designView.DesignMain.ReportID);
                }

                ////Modified by allen on 20081104 for change to FunctionGroup
                //this.rptSecuritySelect.InitData(objGroup, rptSecurity);
                this.rptSecuritySelect.InitFunctionGroupData(objGroup, rptSecurity);
                ////End Modified by allen on 20081104 for change to FunctionGroup

                object[] objTmps = rptFacade.GetRptViewEntryFolder();
                if (objTmps != null)
                {
                    RptViewEntry[] entityList = new RptViewEntry[objTmps.Length];
                    objTmps.CopyTo(entityList, 0);
                    InitReportFolderList(entityList);
                }
                RptViewDesignMain rptMain = this.designView.DesignMain;
                if (rptMain != null && rptMain.ParentReportFolder != "")
                {
                    this.drpReportFolder.SelectedValue = rptMain.ParentReportFolder;
                }

                if (this.drpReportFolder.Items.Count == 0)
                {
                    this.cmdPublish.Disabled = true;
                    this.cmdPublish.Attributes.Add("disabled", "disabled");
                }
            }
        }
Exemple #6
0
        protected override DataRow GetGridRow(object obj)
        {
            RptViewEntry      entry            = (RptViewEntry)obj;
            string            strEntryTypeDesc = "";
            RptViewDesignMain rptMain          = null;

            if (entry.EntryType == ReportEntryType.Folder)
            {
                strEntryTypeDesc = this.languageComponent1.GetString(ReportEntryType.Folder);
            }
            else
            {
                if (this._facade == null)
                {
                    this._facade = new ReportViewFacade(this.DataProvider);
                }
                rptMain = (RptViewDesignMain)this._facade.GetRptViewDesignMain(entry.ReportID);
                if (rptMain != null)
                {
                    entry.EntryName   = rptMain.ReportName;
                    entry.Description = rptMain.Description;
                    if (rptMain.ReportBuilder == ReportBuilder.OnLine)
                    {
                        strEntryTypeDesc = this.languageComponent1.GetString(ReportEntryType.Report + "_online");
                    }
                    else
                    {
                        strEntryTypeDesc = this.languageComponent1.GetString(ReportEntryType.Report + "_offline");
                    }
                }
            }

            DataRow row = DtSource.NewRow();

            row["RptEntrySequence"] = entry.Sequence;
            row["RptEntryCode"]     = entry.EntryCode;
            row["RptEntryName"]     = entry.EntryName;
            row["RptIsVisible"]     = entry.Visible;
            row["RptEntryType"]     = entry.EntryType;
            row["RptEntryTypeDesc"] = strEntryTypeDesc;
            row["ReportID"]         = entry.ReportID;
            row["RptAccessRight"]   = "";
            row["RptView"]          = "";
            row["RptDownloadFile"]  = "";
            row["RptDesign"]        = "";
            row["RptPublish"]       = "";
            return(row);
        }
Exemple #7
0
        private void drpRptId_SelectedIndexChanged(object sender, EventArgs e)
        {
            string           strValue  = this.drpRptId.SelectedValue;
            ReportViewFacade rptFacade = new ReportViewFacade(this.DataProvider);
            object           objEntry  = rptFacade.GetRptViewEntry(strValue);

            if (objEntry != null)
            {
                RptViewEntry entry = (RptViewEntry)objEntry;
                if (entry.EntryType == ReportEntryType.Report && entry.ReportID != "")
                {
                    this.gridHelper.RequestData();
                    return;
                }
            }
            this.gridWebGrid.Rows.Clear();
            this.pagerToolBar.RowCount      = 0;
            this.chkReportAsDefault.Checked = false;
        }
Exemple #8
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!this.IsPostBack)
            {
                // 初始化页面语言
                this.InitPageLanguage(this.languageComponent1, false);

                if (rptFacade == null)
                {
                    rptFacade = new ReportViewFacade(this.DataProvider);
                }
                object[] objTmps = rptFacade.GetAllRptViewEntry();
                if (objTmps != null)
                {
                    RptViewEntry[] entityList = new RptViewEntry[objTmps.Length];
                    objTmps.CopyTo(entityList, 0);
                    InitReportFolderList(entityList);
                }
            }
        }
Exemple #9
0
        protected override string[] FormatExportRecord(object obj)
        {
            RptViewEntry      entry            = (RptViewEntry)obj;
            string            strEntryTypeDesc = "";
            RptViewDesignMain rptMain          = null;

            if (entry.EntryType == ReportEntryType.Folder)
            {
                strEntryTypeDesc = this.languageComponent1.GetString(ReportEntryType.Folder);
            }
            else
            {
                if (this._facade == null)
                {
                    this._facade = new ReportViewFacade(this.DataProvider);
                }
                rptMain = (RptViewDesignMain)this._facade.GetRptViewDesignMain(entry.ReportID);
                if (rptMain != null)
                {
                    entry.EntryName   = rptMain.ReportName;
                    entry.Description = rptMain.Description;
                    if (rptMain.ReportBuilder == ReportBuilder.OnLine)
                    {
                        strEntryTypeDesc = this.languageComponent1.GetString(ReportEntryType.Report + "_online");
                    }
                    else
                    {
                        strEntryTypeDesc = this.languageComponent1.GetString(ReportEntryType.Report + "_offline");
                    }
                }
            }

            string[] objRow = new string[] {
                entry.Sequence.ToString(),
                     entry.EntryCode,
                     entry.EntryName,
                     entry.Visible,
                     strEntryTypeDesc
            };
            return(objRow);
        }
Exemple #10
0
        protected override void SetEditObject(object obj)
        {
            if (obj == null)
            {
                this.txtRptEntrySequence.Text = "0";
                this.txtRptEntryCode.Text     = "";
                this.txtRptEntryName.Text     = "";
                this.txtRptEntryDesc.Text     = "";
                this.chkRptIsVisible.Checked  = true;

                return;
            }

            RptViewEntry entry = (RptViewEntry)obj;

            this.txtRptEntrySequence.Text = entry.Sequence.ToString();
            this.txtRptEntryCode.Text     = entry.EntryCode;
            this.txtRptEntryName.Text     = entry.EntryName;
            this.txtRptEntryDesc.Text     = entry.Description;
            this.chkRptIsVisible.Checked  = FormatHelper.StringToBoolean(entry.Visible);
        }
Exemple #11
0
        protected override object GetEditObject()
        {
            if (this._facade == null)
            {
                this._facade = new ReportViewFacade(this.DataProvider);
            }
            RptViewEntry entry = this._facade.CreateNewRptViewEntry();

            if (this.txtRptEntryCode.ReadOnly == true)
            {
                entry = (RptViewEntry)this._facade.GetRptViewEntry(this.txtRptEntryCode.Text);
            }

            entry.Sequence     = decimal.Parse(this.txtRptEntrySequence.Text);
            entry.EntryCode    = this.txtRptEntryCode.Text.Trim().ToUpper();
            entry.EntryName    = this.txtRptEntryName.Text.Trim().ToUpper();
            entry.Description  = this.txtRptEntryDesc.Text;
            entry.Visible      = FormatHelper.BooleanToString(this.chkRptIsVisible.Checked);
            entry.MaintainUser = this.GetUserCode();

            return(entry);
        }
Exemple #12
0
        /// <summary>
        /// 构建Menu树
        /// </summary>
        private void BuildMenuTree()
        {
            this.treeMenu.Nodes.Clear();

            if (this._facade == null)
            {
                this._facade = new ReportViewFacade(this.DataProvider);
            }
            object[] objs = this._facade.GetAllRptViewEntry();
            if (objs == null || objs.Length == 0)
            {
                return;
            }
            RptViewEntry[] entryList = new RptViewEntry[objs.Length];
            objs.CopyTo(entryList, 0);
            Node node = new Node();

            node.Text = this.languageComponent1.GetString("ReportFolderRootNode");
            this.treeMenu.Nodes.Add(node);
            BuildTreeSubNode(entryList, node, "");

            this.treeMenu.ExpandAll();
        }
Exemple #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (this.IsPostBack == false)
            {
                // 初始化页面语言
                this.InitPageLanguage(this.languageComponent1, false);
                InitReportList();

                string strRptId = this.GetRequestParam("reportid");

                ReportViewFacade rptFacade = new ReportViewFacade(this.DataProvider);
                InitSecurityList(strRptId);

                object[] objTmps = rptFacade.GetRptViewEntryFolder();
                if (objTmps != null)
                {
                    RptViewEntry[] entityList = new RptViewEntry[objTmps.Length];
                    objTmps.CopyTo(entityList, 0);
                    InitReportFolderList(entityList);
                }
                if (strRptId != "")
                {
                    RptViewDesignMain rptMain = (RptViewDesignMain)rptFacade.GetRptViewDesignMain(strRptId);
                    this.drpReportName.SelectedValue = strRptId;
                    this.drpReportName.Enabled       = false;
                    if (rptMain != null && rptMain.ParentReportFolder != "")
                    {
                        this.drpReportFolder.SelectedValue = rptMain.ParentReportFolder;
                    }
                }
                if (this.drpReportFolder.Items.Count == 0 || this.drpReportName.Items.Count == 0)
                {
                    this.cmdPublish.Disabled = true;
                    this.cmdPublish.Attributes.Add("disabled", "disabled");
                }
            }
        }