Пример #1
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);
        }
Пример #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);
 }
Пример #3
0
 public string GetGroupAjax(ChartGroup rg)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append("    $('" + "#aGroupDel" + rg.id + "').click(function() {");
     sb.Append("            if (confirm(\"删除改组将会同时删除改组下的自定义报表; 确定删除'" + rg.groupName + "'?\") == \"0\") {");
     sb.Append("              return;");
     sb.Append("             } else {");
     sb.Append("             $.ajax({");
     sb.Append("              type: \"POST\",");
     sb.Append("              url: \"/CustomReport/DeleteGroup\",");
     //sb.Append("              data: { id: $('" + "#hGroup" + rg.id + "').val() },");
     sb.Append("              data: { id: \"" + rg.id + "\" },");
     sb.Append("            success: function(result) {");
     sb.Append("                 $('" + "#divGroup" + "').empty();");
     sb.Append("                 $('" + "#divGroup" + "').append(result);");
     sb.Append("              }");
     sb.Append("          });");
     sb.Append("       }");
     sb.Append("       });");
     //sb.Append("       $('" + "#aGroupEdit" + rg.id + "').click(function() {");
     //sb.Append("            $.ajax({");
     //sb.Append("                 type: \"GET\",");
     //sb.Append("                url: \"/CustomReport/CreateGroup\",");
     ////sb.Append("                data: { id: $('" + "#hGroup" + rg.id + "').val() },");
     //sb.Append("                data: { id: \"" + rg.id + "\" },");
     //sb.Append("               success: function(result) {");
     //// sb.Append("                   $('#divGroup').empty();");
     ////sb.Append("                    $('#divGroup').append(result);");
     //sb.Append("                }");
     //sb.Append("            });");
     //sb.Append("        });");
     return sb.ToString();
 }
Пример #4
0
 public string GetGroupTr(ChartGroup rg)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append("     <tr>");
     sb.Append("      <td width=\"100%\">");
     sb.Append("        <table width=\"100%\" border=\"0\" cellspacing=\"0\" class=\"cxtal\">");
     sb.Append("           <tr>");
     sb.Append("            <td width=\"54%\" height=\"40\" align=\"left\" class=\"pl40\">");
     sb.Append("              <strong>" + rg.groupName + "</strong>");
     sb.Append("              <input id=\"hGroup" + rg.id + "\" type=\"hidden\" value=\"" + rg.id + "\" />");
     sb.Append("             </td>");
     sb.Append("             <td width=\"23%\" align=\"center\">");
     sb.Append("              <a href=\"/CustomReport/CreateGroup/" + rg.id + "\" id=\"aGroupEdit" + rg.id + "\">");
     sb.Append("               <img src=\"/images/sub/hammer_screwdriver.gif\" width=\"16\" height=\"16\" class=\"imga\" /></a>");
     sb.Append("             </td>");
     sb.Append("             <td width=\"23%\" align=\"center\">");
     sb.Append("              <a href=\"#\" id=\"aGroupDel" + rg.id + "\">");
     sb.Append("                <img src=\"/images/sub/cross.png\" width=\"16\" height=\"16\" class=\"imga\" /></a>");
     sb.Append("              </td>");
     sb.Append("               </tr>");
     sb.Append("            </table>");
     sb.Append("         </td>");
     sb.Append("      </tr>");
     return sb.ToString();
 }
Пример #5
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);
        }
Пример #6
0
 /// <summary>
 /// 修改自定义报表
 /// </summary>
 /// <returns>设备表ID</returns>
 public int Update(ChartGroup customReport)
 {
     return _ReportGroupDao.Update(customReport);
 }
Пример #7
0
 /// <summary>
 /// 插入自定义报表
 /// </summary>
 /// <returns>设备表ID</returns>
 public int Remove(ChartGroup customReport)
 {
     return _ReportGroupDao.Remove(customReport);
 }
Пример #8
0
 /// <summary>
 /// 插入自定义报表
 /// </summary>
 /// <returns>设备表ID</returns>
 public int Insert(ChartGroup customReport)
 {
     return _ReportGroupDao.Insert(customReport);
 }
Пример #9
0
 /// <summary>
 /// 修改自定义报表
 /// </summary>
 /// <returns>设备表ID</returns>
 public ChartGroup Get(ChartGroup customReport)
 {
     return _ReportGroupDao.Get(customReport);
 }