コード例 #1
0
ファイル: ReportBLL.cs プロジェクト: XiaoQiJun/BPS
        public virtual ReportDomain CreateReportDomain()
        {
            ReportEntity entity = new ReportEntity();
            entity.Id = Guid.NewGuid().ToString();

            return new ReportDomain(entity);
        }
コード例 #2
0
ファイル: ReportBLL.cs プロジェクト: XiaoQiJun/BPS
 public virtual void UpdateReportEntity(ReportEntity entity, DataAccessBroker broker)
 {
     DataAccess.Update(entity, broker);
 }
コード例 #3
0
ファイル: ReportBLL.cs プロジェクト: XiaoQiJun/BPS
 public virtual void InsertReportEntity(ReportEntity entity, DataAccessBroker broker)
 {
     DataAccess.Insert(entity, broker);
 }
コード例 #4
0
ファイル: ReportBLL.cs プロジェクト: XiaoQiJun/BPS
        //保存报表
        public virtual bool SaveReport(DataTable dtReport, string reportName, string remark, string user, string reportID)
        {
            //1. 生成菜单项
            SecPageEntity objPage;
            if (reportID != "")
            {
                objPage = DataAccess.SelectSingle<SecPageEntity>(reportID);
                objPage.PageId = reportID;
            }
            else
            {
                objPage = new SecPageEntity();
                objPage.PageId = Guid.NewGuid().ToString();
                objPage.MenuOrder = GetLastReportOrder();
            }
            
            objPage.PageName = reportName;
            objPage.ParentId = "11";
            objPage.PageUrl = "~/Search/DynamicReportDisplay.aspx?ReportID=" + objPage.PageId;
            objPage.IsMenu = 1;
            objPage.MenuLevel = 1;
            
            objPage.Remark = remark;
            objPage.LastModifiedBy = user;
            objPage.LastModifiedTime = DateTime.Now;
            objPage.IcoCssclass = "Report";

            using (DataAccessBroker broker = DataAccessFactory.Instance())
            {
                broker.BeginTransaction();
                try
                {
                    if (reportID != "")
                    {
                        DataAccess.Update(objPage, broker);
                    }
                    else
                    {
                        DataAccess.Insert(objPage, broker);
                    }


                    if (dtReport != null && dtReport.Rows.Count > 0)
                    {
                        string strSql = @"delete " + ReportTable.C_TableName + "  where " + ReportTable.C_Report_ID + "='" + objPage.PageId + "'";
                        broker.ExecuteNonQuery(strSql, null, CommandType.Text);

                        ReportEntity objEntity;
                        foreach (DataRow drReport in dtReport.Rows)
                        {
                            objEntity = new ReportEntity();
                            objEntity.Id = Guid.NewGuid().ToString();
                            objEntity.ReportId = objPage.PageId;
                            objEntity.Type = drReport["Type"].ToString();
                            objEntity.ColumnName = drReport["Column_Name"].ToString();
                            objEntity.DisplayName = drReport["Display_Name"].ToString();
                            objEntity.DisplayOrder = drReport["Display_Order"].ToString();

                            objEntity.IsQuery = drReport["Is_Query"].ToString();
                            objEntity.IsDeleted = "0";
                            objEntity.ModifyDate = DateTime.Now;
                            objEntity.ModifyUser = user;
                            objEntity.Datatype = drReport["DataType"].ToString();

                            DataAccess.Insert(objEntity, broker);
                        }
                    }
                    BPSC.Common.WebUtils.WebCaching.PageCaching = null;
                    broker.Commit();
                    return true;
                }
                catch
                {
                    broker.RollBack();
                    return false;
                }
            }
        }
コード例 #5
0
ファイル: ReportDomain.cs プロジェクト: XiaoQiJun/BPS
 public ReportDomain(ReportEntity entity)
     : base(entity)
 {
     masterEntity = entity;
 }