Esempio n. 1
0
        /// <summary>
        /// 修改报表格式
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="list"></param>
        /// <returns></returns>
        public int Update(ReportsEntity entity, List <ReportParamsEntity> list)
        {
            int line = 0;

            using (TransactionScope ts = new TransactionScope())
            {
                ReportParamsEntity param = new ReportParamsEntity();
                param.Where(a => a.ReportNum == entity.ReportNum);
                line += this.ReportParams.Delete(param);

                entity.Include(a => new { a.ReportName, a.ReportType, a.Remark, a.DataSource, a.DsType, a.FileName });
                entity.Where(a => a.ReportNum == entity.ReportNum);
                line += this.Reports.Update(entity);

                if (!list.IsNullOrEmpty())
                {
                    foreach (ReportParamsEntity item in list)
                    {
                        item.ParamNum  = item.ParamNum.IsEmpty() ? SequenceProvider.GetSequence(typeof(ReportParamsEntity)) : item.ParamNum;
                        item.ReportNum = entity.ReportNum;
                        item.IncludeAll();
                    }
                    this.ReportParams.Add(list);
                }
                ts.Complete();
            }

            return(line);
        }
Esempio n. 2
0
        public ActionResult EditMetadata()
        {
            List <ReportParamsEntity> list = WebUtil.GetFormObject <List <ReportParamsEntity> >("list", null);

            list = list.IsNull() ? new List <ReportParamsEntity>() : list;
            List <ReportParamsEntity> listSource = Session[CacheKey.JOOSHOW_REPORTPARAM_CACHE] as List <ReportParamsEntity>;

            listSource = listSource.IsNull() ? new List <ReportParamsEntity>() : listSource;

            foreach (ReportParamsEntity item in list)
            {
                if (listSource.Exists(a => a.ParamNum == item.ParamNum))
                {
                    ReportParamsEntity entity = listSource.First(a => a.ParamNum == item.ParamNum);
                    entity.ParamData    = item.ParamData;
                    entity.DefaultValue = item.DefaultValue;
                    entity.ParamElement = item.ParamElement;
                    entity.ShowName     = item.ShowName;
                }
            }
            Session[CacheKey.JOOSHOW_REPORTPARAM_CACHE] = listSource;
            this.ReturnJson.AddProperty("Key", "1000");
            this.ReturnJson.AddProperty("Value", "编辑成功");
            return(Content(this.ReturnJson.ToString()));
        }
Esempio n. 3
0
        /// <summary>
        /// 根据报表格式编号查询参数信息
        /// </summary>
        /// <param name="reportNum"></param>
        /// <returns></returns>
        public List <ReportParamsEntity> GetParams(string reportNum)
        {
            ReportParamsEntity entity = new ReportParamsEntity();

            entity.IncludeAll();
            entity.Where(a => a.ReportNum == reportNum);
            List <ReportParamsEntity> list = this.ReportParams.GetList(entity);

            return(list);
        }
Esempio n. 4
0
        public ActionResult AddParam()
        {
            string SnNum        = WebUtil.GetFormValue <string>("SnNum");
            string ParamName    = WebUtil.GetFormValue <string>("ParamName");
            string ShowName     = WebUtil.GetFormValue <string>("ShowName");
            string ParamType    = WebUtil.GetFormValue <string>("ParamType");
            string ParamData    = WebUtil.GetFormValue <string>("ParamData");
            string DefaultValue = WebUtil.GetFormValue <string>("DefaultValue");
            string ParamElement = WebUtil.GetFormValue <string>("ParamElement");
            string Remark       = WebUtil.GetFormValue <string>("Remark");

            List <ReportParamsEntity> listSource = Session[SessionKey.SESSION_REPORT_DETAIL] as List <ReportParamsEntity>;

            listSource = listSource.IsNull() ? new List <ReportParamsEntity>() : listSource;
            if (SnNum.IsNotEmpty() && listSource.Exists(a => a.SnNum == SnNum))
            {
                ReportParamsEntity entity = listSource.First(a => a.SnNum == SnNum);
                entity.ParamName    = ParamName;
                entity.ShowName     = ShowName;
                entity.ParamType    = ParamType;
                entity.ParamData    = ParamData;
                entity.DefaultValue = DefaultValue;
                entity.ParamElement = ParamElement;
                entity.Remark       = Remark;
                entity.CompanyID    = this.CompanyID;
            }
            else
            {
                ReportParamsEntity entity = new ReportParamsEntity();
                entity.SnNum        = ConvertHelper.NewGuid();
                entity.ParamName    = ParamName;
                entity.ShowName     = ShowName;
                entity.ParamType    = ParamType;
                entity.ParamData    = ParamData;
                entity.DefaultValue = DefaultValue;
                entity.ParamElement = ParamElement;
                entity.Remark       = Remark;
                entity.CompanyID    = this.CompanyID;
                listSource.Add(entity);
            }
            Session[SessionKey.SESSION_REPORT_DETAIL] = listSource;
            DataResult dataResult = new DataResult()
            {
                Code = (int)EResponseCode.Success, Message = "新增成功"
            };

            return(Content(JsonHelper.SerializeObject(dataResult)));
        }
Esempio n. 5
0
        public ActionResult AddParam()
        {
            List <ReportParamsEntity> list = Session[CacheKey.JOOSHOW_REPORTPARAM_CACHE] as List <ReportParamsEntity>;

            list = list.IsNull() ? new List <ReportParamsEntity>() : list;

            ReportParamsEntity entity = WebUtil.GetFormObject <ReportParamsEntity>("entity", null);

            if (entity != null)
            {
                if (!list.Exists(a => a.ParamName == entity.ParamName))
                {
                    entity.ParamNum = SequenceProvider.GetSequence(typeof(ReportParamsEntity));
                    list.Add(entity);
                }
                Session[CacheKey.JOOSHOW_REPORTPARAM_CACHE] = list;
            }
            return(Content(this.ReturnJson.ToString()));
        }
Esempio n. 6
0
        public ActionResult AddParam()
        {
            string SnNum = WebUtil.GetQueryStringValue <string>("SnNum", string.Empty);
            List <ReportParamsEntity> listSource = Session[SessionKey.SESSION_REPORT_DETAIL] as List <ReportParamsEntity>;
            ReportParamsEntity        entity     = null;

            if (!listSource.IsNullOrEmpty())
            {
                entity = listSource.FirstOrDefault(a => a.SnNum == SnNum);
            }
            if (entity == null)
            {
                entity = new ReportParamsEntity();
            }
            ViewBag.ParamType    = DropDownHelper.GetDataType(entity.ParamType);
            entity.ParamElement  = entity.ParamElement.IsEmpty() ? ((int)EElementType.TextBox).ToString() : entity.ParamElement;
            ViewBag.ParamElement = EnumHelper.GetOptions <EElementType>(entity.ParamElement);
            ViewBag.Entity       = entity;
            return(View());
        }
Esempio n. 7
0
        /// <summary>
        /// 根据存储过程名称查询元数据信息
        /// </summary>
        /// <param name="argProceName"></param>
        /// <returns></returns>
        public List <ReportParamsEntity> GetProceMetadata(string argProceName)
        {
            List <ProceMetadata> list = this.Reports.GetMetadataList(argProceName);

            if (!list.IsNullOrEmpty())
            {
                List <ReportParamsEntity> listResult = new List <ReportParamsEntity>();
                foreach (ProceMetadata item in list)
                {
                    ReportParamsEntity entity = new ReportParamsEntity();
                    entity.ReportNum    = string.Empty;
                    entity.ParamNum     = SequenceProvider.GetSequence(typeof(ReportParamsEntity));
                    entity.InputNo      = item.ORDINAL_POSITION.ToString();
                    entity.ParamName    = item.PARAMETER_NAME;
                    entity.ShowName     = string.Empty;
                    entity.ParamType    = item.DATA_TYPE;
                    entity.ParamData    = "";
                    entity.DefaultValue = "";
                    listResult.Add(entity);
                }
                return(listResult);
            }
            return(null);
        }