Beispiel #1
0
        /// <summary>
        /// 产生分组列表
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public string GetHtml(int userid)
        {
            StringBuilder strAjax  = new StringBuilder();
            StringBuilder strTable = new StringBuilder();

            IList <ChartGroup> list = ChartGroupService.GetInstance().GetReportGroupList(userid);

            if (list != null && list.Count > 0)
            {
                strAjax.Append(GetAjaxHead());
                strTable.Append(GetTableHead());

                foreach (ChartGroup rgp in list)
                {
                    strAjax.Append(GetGroupAjax(rgp));
                    strTable.Append(GetGroupTr(rgp));
                    foreach (CustomChart cr in rgp.CustomReports)
                    {
                        strAjax.Append(GetReporAjax(cr));
                        strTable.Append(GetReportTr(cr));
                    }
                }
                strAjax.Append(GetAjaxTail());
                strTable.Append(GetTableTail());
            }
            return(strAjax.ToString() + strTable.ToString());
        }
Beispiel #2
0
        public ActionResult SaveGroup(ChartGroup customReport)
        {
            int    flag = 0;
            string ret  = Resources.SunResource.CUSTOM_SAVE_SUCCESSFULLY;
            User   user = UserUtil.getCurUser();

            if (null != user && UserUtil.demousername.Equals(user.username))
            {
                ret = "Sorry,exampleuser prohibit to save";
                return(Content(ret));
            }
            else if (string.IsNullOrEmpty(customReport.groupName))
            {
                ret = Resources.SunResource.CUSTOMREPORT_PLEASE_ENTER_GROUP;
                return(Content(ret));
            }
            try
            {
                if (ChartGroupService.GetInstance().Get(customReport) != null)
                {
                    flag = ChartGroupService.GetInstance().Update(customReport);
                }
                else
                {
                    flag = ChartGroupService.GetInstance().Insert(customReport);
                }
            }
            catch (Exception ee)
            { }
            return(Content(ret));
        }
Beispiel #3
0
        /// <summary>
        /// 废弃
        /// </summary>
        /// <param name="userid"></param>
        public void SetReportGroups(int userid)
        {
            IList <ChartGroup> reportGroup = ChartGroupService.GetInstance().GetReportGroupList(userid);

            Session[ComConst.ChartGroup] = reportGroup;

            IList <CustomChart> outlist = CustomChartService.GetInstance().GetListOutGroup(userid);

            Session[ComConst.ChartOutGroup] = outlist;
        }
Beispiel #4
0
        /// <summary>
        /// 删除分组
        /// </summary>
        /// <param name="customReport"></param>
        /// <returns></returns>
        public ActionResult DeleteGroup(string id, string returnUrl)
        {
            User       user = UserUtil.getCurUser();
            ChartGroup mode = new ChartGroup();

            mode.id = int.Parse(id);
            ChartGroupService.GetInstance().Remove(mode);
            CustomChartService.GetInstance().Delete(mode.id);

            //  string ret = GetHtml(user.id);
            return(new RedirectResult(returnUrl));
        }
Beispiel #5
0
        public ActionResult CreateGroup(string id)
        {
            ChartGroup group = new ChartGroup();
            User       user  = UserUtil.getCurUser();

            IList <CustomChart> ilistcc = CustomChartService.GetInstance().GetListByGroup(user.id, 0);

            Session[ComConst.ChartGroupDefault] = ilistcc;

            if (user != null && group != null)
            {
                group.userId = user.id;
                SetReportGroups(user.id);
            }
            if (!string.IsNullOrEmpty(id))
            {
                group.id = int.Parse(id);
                group    = ChartGroupService.GetInstance().Get(group);
            }
            return(View("ReportGroup", group));
        }