Esempio n. 1
0
        public virtual ReportDomain CreateReportDomain()
        {
            ReportEntity entity = new ReportEntity();
            entity.Id = Guid.NewGuid().ToString();

            return new ReportDomain(entity);
        }
Esempio n. 2
0
 public virtual void UpdateReportEntity(ReportEntity entity, DataAccessBroker broker)
 {
     DataAccess.Update(entity, broker);
 }
Esempio n. 3
0
 public virtual void InsertReportEntity(ReportEntity entity, DataAccessBroker broker)
 {
     DataAccess.Insert(entity, broker);
 }
Esempio n. 4
0
        //保存报表
        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;
                }
            }
        }
Esempio n. 5
0
 public ReportDomain(ReportEntity entity)
     : base(entity)
 {
     masterEntity = entity;
 }