Beispiel #1
0
        public string GetReportTr(CustomChart cr)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(" <tr visible=\"false\">");
            sb.Append("   <td>");
            sb.Append("     <table width=\"100%\" border=\"0\" cellspacing=\"0\">");
            sb.Append("       <tr>");
            sb.Append("        <td width=\"54%\" height=\"28\" class=\"bp01 pl40\">");
            sb.Append("        " + cr.reportName + "");
            sb.Append("          <input id=\"hRepor" + cr.id + "\" type=\"hidden\" value=\"" + cr.id + "\" />");
            sb.Append("         </td>");
            sb.Append("          <td width=\"23%\" align=\"center\" class=\"bp01\">");
            sb.Append("           <a href=\"/CustomReport/Defined/" + cr.id + "\" id=\"aReporEdit" + cr.id + "\"  >");
            sb.Append("            <img src=\"/images/sub/edit.gif\" width=\"14\" height=\"14\" class=\"imga\" /></a>");
            sb.Append("          </td>");
            sb.Append("         <td align=\"center\" class=\"bp01\">");
            sb.Append("            <a href=\"#\" id=\"aReporDel" + cr.id + "\">");
            sb.Append("             <img src=\"/images/sub/del.gif\" width=\"14\" height=\"14\" class=\"imga\" /></a>");
            sb.Append("          </td>");
            sb.Append("          </tr>");
            sb.Append("          </table>");
            sb.Append("         </td>");
            sb.Append("       </tr>");

            return(sb.ToString());
        }
Beispiel #2
0
        public string GetReporAjax(CustomChart cr)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("   $('#aReporDel" + cr.id + "').click(function() {");
            sb.Append("       if (confirm(\"确定删除自定义报表'" + cr.reportName + "'?\") == \"0\") {");
            sb.Append("           return;");
            sb.Append("         } else {");
            sb.Append("         $.ajax({");
            sb.Append("            type: \"POST\",");
            sb.Append("             url: \"/CustomReport/DeleteReport\",");
            //sb.Append("             data: { id: $('#hRepor" + cr.id + "').val() },");
            sb.Append("             data: { id: \"" + cr.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("   $('#aReporEdit" + cr.id + "').click(function() {");
            //sb.Append("      $.ajax({");
            //sb.Append("      type: \"POST\",");
            //sb.Append("        url: \"/CustomReport/EditReport\",");
            ////sb.Append("         data: { id: $('#hRepor" + cr.id + "').val() },");
            //sb.Append("         data: { id:\"" + cr.id + "\"},");
            //sb.Append("       success: function(result) {");
            ////sb.Append("           $('#divGroup').empty();");
            ////sb.Append("           $('#divGroup').append(result);");
            //sb.Append("       }");
            //sb.Append("         });");
            //sb.Append("    });");
            return(sb.ToString());
        }
Beispiel #3
0
        public ActionResult DefinedPlantChartList(int id, string cid)
        {
            int temp = 0;

            int.TryParse(cid, out temp);
            Plant plant = PlantService.GetInstance().GetPlantInfoById(id);

            SetDeviceList(plant);
            SetMI(null);
            CustomChart cus = null;

            if (string.IsNullOrEmpty(cid))
            {
                cus         = new CustomChart();
                cus.groupId = 0;
                cus.plantId = plant.id;
            }
            else
            {
                cus = CustomChartService.GetInstance().Get(new CustomChart()
                {
                    id = temp
                });
                Analysis(ref cus);
            }
            ViewData["charts"] = CustomChartService.GetInstance().GetListByPlant(cus.plantId);
            return(View("CustomChartList", cus));
        }
Beispiel #4
0
        // Navega hacia una nueva página cuando haces click en un elemento
        private void LView_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            CustomChart selectedItem = lView.SelectedItem as CustomChart;

            selectedItem.ChartPage.NavigationPage = _master.GetNavigationPage;
            _master.GetNavigationPage.PushAsync(selectedItem.ChartPage);
        }
Beispiel #5
0
    public object GetTopUseItem(string duration)
    {
        try
        {
            if (Session["CompanyId"] == null)
            {
                return(new
                {
                    Error = "You sessin has expired"
                });
            }
            int companyId     = int.Parse(Session["CompanyId"].ToString());
            var reportList    = new List <StockHistory>();
            var inventoryList = _db.Inventories.Where(m => m.CompanyId == companyId);



            var chartObjList = new List <CustomChart>();
            foreach (var useItem in inventoryList)
            {
                if (duration == "month")
                {
                    var monthDate = DateTime.Now.Month;

                    reportList = _db.StockHistories.OrderByDescending(m => m.Quantity).Where(m => m.DateCreated.Month == monthDate && m.CompanyId == companyId && m.InventoryId == useItem.InventoryId).ToList();
                }
                else if (duration == "year")
                {
                    var yearDate = DateTime.Now.Year;
                    reportList = _db.StockHistories.OrderByDescending(m => m.Quantity).Where(m => m.DateCreated.Year == yearDate && m.CompanyId == companyId && m.InventoryId == useItem.InventoryId).ToList();
                }
                else
                {
                    reportList = _db.StockHistories.OrderByDescending(m => m.Quantity).Where(m => m.CompanyId == companyId && m.InventoryId == useItem.InventoryId).ToList();
                }

                var chartObj = new CustomChart
                {
                    name = useItem.Stock.Name,
                    z    = reportList.Count()
                };

                chartObjList.Add(chartObj);
            }


            return(new
            {
                ReportList = chartObjList.OrderByDescending(m => m.z).Take(5)
            });
        }
        catch (Exception ex)
        {
            return(new
            {
                Error = "An error occurred , Please contact administrator"
            });
        }
    }
Beispiel #6
0
        /// <summary>
        /// 取得用户的所有配置
        /// </summary>
        /// <returns>设备表ID</returns>
        public IList <CustomChart> Getlist(int userId, int groupid)
        {
            CustomChart CustomChart = new CustomChart();

            CustomChart.userId  = userId;
            CustomChart.groupId = groupid;
            return(_CustomReportDao.Getlist(CustomChart));
        }
Beispiel #7
0
        public ActionResult DeleteChart(int id)
        {
            CustomChart mode = new CustomChart();

            mode.id = id;
            CustomChartService.GetInstance().Remove(mode);
            return(Content("success"));
        }
Beispiel #8
0
 public CustomChartView(CustomChart chart, CustomNavigationPage navPage)
 {
     this.Content  = chart.ChartView;
     this.Title    = chart.Name;
     this._chart   = chart;
     this._navPage = navPage;
     this._customChartSettingsPage = new CustomChartSettingsPage(_chart, _navPage);
     InitializeToolbarItems();
 }
Beispiel #9
0
    public object StockByCategoryPie(string duration)
    {
        try
        {
            if (Session["CompanyId"] == null)
            {
                return(new
                {
                    Error = "You sessin has expired"
                });
            }
            int companyId        = int.Parse(Session["CompanyId"].ToString());
            var customPgharmList = new List <CustomChart>();

            foreach (var categoryObj in _db.Categories)
            {
                var stockList = new List <Stock>();


                if (duration == "month")
                {
                    var monthDate = DateTime.Now.Month;

                    stockList = _db.Stocks.Where(m => m.DateCreated.Month == monthDate && m.CompanyId == companyId && m.CategoryId == categoryObj.CategoryId).ToList();
                }
                else if (duration == "year")
                {
                    var yearDate = DateTime.Now.Year;
                    stockList = _db.Stocks.Where(m => m.DateCreated.Year == yearDate && m.CompanyId == companyId && m.CategoryId == categoryObj.CategoryId).ToList();
                }
                else
                {
                    stockList = _db.Stocks.Where(m => m.CompanyId == companyId && m.CategoryId == categoryObj.CategoryId).ToList();
                }


                var customStd1 = new CustomChart();
                customStd1.name = categoryObj.Name.ToString();
                customStd1.x    = stockList.Count();
                customPgharmList.Add(customStd1);
            }
            var js = new JavaScriptSerializer();
            return(new
            {
                catJson = js.Serialize(customPgharmList)
            });
        }

        catch (Exception ex)
        {
            return(new
            {
                Error = "An error occurred , Please contact administrator"
            });
        }
    }
Beispiel #10
0
        public ActionResult Delete(int id, string returnUrl)
        {
            CustomChart mode = new CustomChart();

            UpdateModel(mode, Request.Form.AllKeys);

            int flag = CustomChartService.GetInstance().Remove(mode);

            return(new RedirectResult(returnUrl));
        }
Beispiel #11
0
        public CustomChartSettingsPage(CustomChart myChart, CustomNavigationPage navBar)
        {
            this.Title   = "Chart Settings";
            _navPage     = navBar;
            _customChart = myChart;
            Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetToolbarPlacement(this, Xamarin.Forms.PlatformConfiguration.AndroidSpecific.ToolbarPlacement.Top);
            Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetIsSwipePagingEnabled(this, false);

            BuildView();
        }
Beispiel #12
0
 /// <summary>
 /// 解析
 /// </summary>
 /// <param name="cr"></param>
 public void TextTo(ref CustomChart customReport)
 {
     if (!string.IsNullOrEmpty(customReport.product))
     {
         string[] strText = customReport.product.Split(';');
         foreach (string str in strText)
         {
             string[] sss = str.Split(',');
         }
     }
 }
Beispiel #13
0
        public ActionResult DeleteReport(int id)
        {
            CustomChart mode = new CustomChart();

            mode.id = id;
            int  flag = CustomChartService.GetInstance().Remove(mode);
            User user = UserUtil.getCurUser();

            string ret = GetHtml(user.id);

            return(RedirectToAction("ReportGroup", ret));
        }
Beispiel #14
0
        public ActionResult DefinedUserChart()
        {
            User user = UserUtil.getCurUser();

            SetDeviceList(user.plants);
            SetMI(null);
            CustomChart cus = new CustomChart();

            cus.groupId        = 0;
            cus.userId         = user.id;
            ViewData["charts"] = CustomChartService.GetInstance().GetListByGroup(user.id, 0);
            return(View("CustomChart", cus));
        }
Beispiel #15
0
        public ActionResult Preview(CustomChart customReport)
        {
            string      ret = "";
            CustomChart crt = new CustomChart();

            if (customReport != null)
            {
                crt = customReport;
            }
            ret = GetCustomReport(crt);

            return(Content(ret));
        }
Beispiel #16
0
        public ActionResult CustomChartPage2()
        {
            int id = int.Parse(Session["customID"].ToString());

            ViewData["cid"] = id;
            CustomChart cc = CustomChartService.GetInstance().Get(new CustomChart()
            {
                id = id
            });

            ViewData["gid"]         = cc.groupId;
            ViewData["customChart"] = cc;
            FillYearsList();
            return(View("CustomChartPage"));
        }
        /// <summary>
        /// Восстановить сохранненые значения.
        /// </summary>
        public void RestoreSettings(CustomChart chart)
        {
            chart.ClipGauges = ClipGauges;
            chart.Depth = Depth;
            chart.ExplodedSliceAmount = ExplodedSliceAmount;
            chart.DefaultSeries.GaugeType = GaugeType;
            chart.PaletteName = PaletteName;
            chart.PieLabelMode = PieLabelMode;
            chart.DefaultSeries.Type = SeriesType;
            chart.ShadingEffectMode = ShadingEffectMode;
            chart.DefaultSeries.Line.Width = GraphLineWidth;
            chart.Use3D = Use3D;

            ChartArea.RestoreSettings(chart.ChartArea);
            Background.RestoreSettings(chart.Background);
            DefaultElement.RestoreSettings(chart.ChartArea.DefaultElement);
        }
Beispiel #18
0
    public object StockByCategoryPie(string type)
    {
        try
        {
            var customPgharmList = new List <CustomChart>();

            foreach (var categoryObj in _db.Categories)
            {
                var pharmacies = new List <Stock>();

                //if (type == "1")
                //{
                //    pharmacies = _db.Tickets.Where(m => m.Status == (int)status).ToList();
                //}
                //else if (type == "2")
                //{
                //    pharmacies = _db.Tickets.Where(m => m.Status == (int)status).ToList();
                //}
                //else if (type == "3")
                //{
                //    pharmacies = _db.Tickets.Where(m => m.Status == (int)status).ToList();
                //}
                //else
                //{
                pharmacies = _db.Stocks.Where(m => m.CategoryId == categoryObj.CategoryId).ToList();
                // }
                var customStd1 = new CustomChart();
                customStd1.name = categoryObj.Name.ToString();
                customStd1.x    = pharmacies.Count();
                customPgharmList.Add(customStd1);
            }
            var js = new JavaScriptSerializer();
            return(new
            {
                catJson = js.Serialize(customPgharmList)
            });
        }

        catch (Exception ex)
        {
            return(new
            {
                Error = "An error occurred , Please contact administrator"
            });
        }
    }
        public ChartSettingsWrapper(CustomChart chart) 
        {
            ClipGauges = chart.ClipGauges;
            Depth = chart.Depth;
            ExplodedSliceAmount = chart.ExplodedSliceAmount;
            GaugeType = chart.DefaultSeries.GaugeType;
            PaletteName = chart.PaletteName;
            PieLabelMode = chart.PieLabelMode;
            SeriesType = (SeriesType)chart.DefaultSeries.Type;
            ShadingEffectMode = chart.ShadingEffectMode;
            GraphLineWidth = chart.DefaultSeries.Line.Width;
            Use3D = chart.Use3D;

            ChartArea = new ChartAreaSettingsWrapper(chart.ChartArea);

            Background = new BackgroundSettingsWrapper(chart.Background);
            DefaultElement = new DefaultElementSettingsWrapper(chart.ChartArea.DefaultElement);
        }
Beispiel #20
0
        public ActionResult modifyDefined(string id)
        {
            CustomChart cus = null;

            if (!string.IsNullOrEmpty(id))
            {
                cus    = new CustomChart();
                cus.id = int.Parse(id);
                cus    = CustomChartService.GetInstance().Get(cus);
            }
            Plant plant = PlantService.GetInstance().GetPlantInfoById(cus.plantId);

            SetDeviceList(plant);

            Analysis(ref cus);

            ViewData["charts"] = CustomChartService.GetInstance().GetListByPlant(cus.plantId);
            return(View("CustomChart", cus));
        }
Beispiel #21
0
        /// <summary>
        /// 生成自定义图表
        /// </summary>
        /// <returns>自定义报表页面</returns>
        public ActionResult ChartView(int id, string startTime, string endTime)
        {
            string report = "";

            DateTime dt = DateTime.Now;

            switch (id)
            {
            default:    ///自定义
                CustomChart crt = new CustomChart();
                crt.id        = id;
                crt           = CustomChartService.GetInstance().Get(crt);
                crt.startTime = startTime;
                crt.endTime   = endTime;
                report        = GetCustomReport(crt);
                break;
            }
            return(Content(report));
        }
Beispiel #22
0
        public ActionResult Save(CustomChart customReport, string cid)
        {
            int temp = 0;

            int.TryParse(cid, out temp);
            customReport.id      = temp;
            customReport.groupId = 0;
            string ret = Resources.SunResource.CUSTOM_SAVE_SUCCESSFULLY;

            if (customReport != null)
            {
                if (!customReport.customType.Equals("2") && string.IsNullOrEmpty(customReport.product))
                {
                    customReport.product = customReport.ProIdType;
                }
            }
            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.reportName))
            {
                ret = Resources.SunResource.CUSTOMREPORT_SAVE_FAILED_NAME;
                return(Content(ret));
            }
            else if (customReport.customType.Trim().Equals("2") && string.IsNullOrEmpty(customReport.product))
            {
                ret = Resources.SunResource.CUSTOMREPORT_SAVE_FAILED_EQUIPMENT;
                return(Content(ret));
            }
            else if (customReport.customType.Trim().Equals("3") && string.IsNullOrEmpty(customReport.times))
            {
                ret = Resources.SunResource.CUSTOMREPORT_SAVE_FAILED_TIME;
                return(Content(ret));
            }

            int flag = 0;

            try
            {
                if (customReport.id <= 0)
                {
                    flag = CustomChartService.GetInstance().Insert(customReport);
                }
                else if (CustomChartService.GetInstance().Get(customReport) != null)
                {
                    flag = CustomChartService.GetInstance().Update(customReport);
                }
                else
                {
                    flag = CustomChartService.GetInstance().Insert(customReport);
                }
            }
            catch (Exception ee)
            {
                ret = "Save failed!" + ee.Message;
                return(Content(ret));
            }
            return(Content(ret));
        }
Beispiel #23
0
 /// <summary>
 /// Permet eliminar un chart
 /// </summary>
 /// <param name="chart">CustomChart que es vol eliminar</param>
 public void Remove(CustomChart chart)
 {
     try { _customCharts.Remove(chart); }
     catch (Exception exception) { throw new Exception(exception.Message); }
 }
Beispiel #24
0
 /// <summary>
 /// 修改自定义报表
 /// </summary>
 /// <returns>设备表ID</returns>
 public CustomChart Get(CustomChart customReport)
 {
     return(_CustomReportDao.Get(customReport));
 }
Beispiel #25
0
        /// <summary>
        /// 15&Plant,Power&valueType,KW&Unit,Max&cVal;
        /// 解析定义图表规则
        /// </summary>
        /// <param name="cc"></param>
        private void Analysis(ref CustomChart cc)
        {
            if (cc != null && !string.IsNullOrEmpty(cc.product))
            {
                if (cc.customType.Trim().Equals("1"))
                {
                    string   ss  = cc.product.Replace(";", string.Empty);
                    string[] ssa = ss.Split(',');

                    foreach (string s in ssa)
                    {
                        string[] ss0 = s.Split('&');

                        if (ss0.Length == 2)
                        {
                            switch (ss0[1])
                            {
                            case "cVal":
                                cc.cVal = ss0[0];
                                break;

                            case "Unit":
                                cc.units = ss0[0];
                                break;

                            case "valueType":
                                cc.valueType = ss0[0];
                                break;

                            case "subType":
                                cc.subType = ss0[0];
                                break;

                            default:
                                cc.productList = s;
                                cc.ProIdType   = s;
                                break;
                            }
                        }
                    }
                    SetMI(cc.ProIdType);
                }

                else if (cc.customType.Trim().Equals("3"))
                {
                    if (!string.IsNullOrEmpty(cc.times))
                    {
                        List <string> slist = new List <string>();
                        string[]      splis = cc.times.Split(';');
                        foreach (string ss in splis)
                        {
                            if (!string.IsNullOrEmpty(ss))
                            {
                                slist.Add(ss);
                            }
                        }
                        ViewData["TimesList"] = slist;
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(cc.product))
                    {
                        List <SelectListItem> slist = new List <SelectListItem>();
                        string[] splis        = cc.product.Split(';');
                        string[] sproductName = cc.productName.Split(';');

                        for (int i = 0; i < splis.Length; i++)
                        {
                            SelectListItem sel = new SelectListItem();
                            if (!string.IsNullOrEmpty(splis[i]))
                            {
                                sel.Value = splis[i];
                                sel.Text  = sproductName[i];
                                slist.Add(sel);
                            }
                        }
                        ViewData["ProductList"] = slist;
                    }
                }
            }
            SetMI(cc.ProIdType);
        }
Beispiel #26
0
        /// <summary>
        /// 取得自定义图表的数据
        /// </summary>
        /// <param name="crt"></param>
        /// <returns></returns>
        private string GetCustomReport(CustomChart crt)
        {
            User     user = UserUtil.getCurUser();
            DateTime dt   = CalenderUtil.curDateWithTimeZone(user.timezone);

            string ret = "sorry:" + Resources.SunResource.NODATA;

            if (crt != null)
            {
                Analysis(ref crt);
                ///多设备多测点单时间报表
                List <DeviceStuct> list = new List <DeviceStuct>();
                list = GetDeviceStucts(crt);
                string reportName = crt.reportName;
                switch (crt.timeInterval.Trim().ToUpper())
                {
                case "YEAR":

                    //if (crt.timeSlot.Trim().ToUpper().Equals("YEAR"))
                    //{
                    ChartData chartData = CompareChartService.GetInstance().compareYearsMultiDeviceMultiMonitor(crt.reportName, list, getWorkYears(list));
                    ret = JsonUtil.convertToJson(chartData, typeof(ChartData));
                    //}
                    break;

                case "MONTH":
                    //if (crt.timeSlot.Trim().ToUpper().Equals("YEAR"))
                    //{
                    //dtstart = dt.AddYears(-crt.tcounter.Value);
                    //}
                    //else if (crt.timeSlot.Trim().ToUpper().Equals("MONTH"))
                    // {
                    //dtstart = dt.AddMonths(-crt.tcounter.Value);
                    //}

                    chartData = CompareChartService.GetInstance().compareYearMMMultiDeviceMultiMonitor(crt.reportName, GetDeviceStucts(crt), crt.startTime, crt.endTime);
                    ret       = JsonUtil.convertToJson(chartData, typeof(ChartData));
                    break;

                case "DAY":
                    //if (crt.timeSlot.Trim().ToUpper().Equals("DAY"))
                    //{
                    //dtstart = dt.AddDays(-crt.tcounter.Value);
                    // }
                    //else if (crt.timeSlot.Trim().ToUpper().Equals("MONTH"))
                    //{
                    //dtstart = dt.AddMonths(-crt.tcounter.Value);
                    // }
                    chartData = CompareChartService.GetInstance().compareMMDDMultiDeviceMultiMonitor(crt.reportName, GetDeviceStucts(crt), crt.startTime, crt.endTime);
                    ret       = JsonUtil.convertToJson(chartData, typeof(ChartData));
                    break;

                case "HOUR":
                    //if (crt.timeSlot.Trim().ToUpper().Equals("DAY"))
                    //{
                    //    dtstart = dt.AddDays(-crt.tcounter.Value);
                    //}
                    //else if (crt.timeSlot.Trim().ToUpper().Equals("HOUR"))
                    //{
                    //    dtstart = dt.AddHours(-crt.tcounter.Value);
                    //}
                    int intervalMins = 5;
                    chartData = CompareChartService.GetInstance().compareDayHHMultiDeviceMultiMonitor(crt.reportName, GetDeviceStucts(crt), crt.startTime, crt.endTime, intervalMins);
                    ret       = JsonUtil.convertToJson(chartData, typeof(ChartData));
                    break;

                default:
                    break;
                }
            }
            return(ret);
        }
Beispiel #27
0
 /// <summary>
 /// 插入自定义报表
 /// </summary>
 /// <returns>设备表ID</returns>
 public int Insert(CustomChart customReport)
 {
     return(_CustomReportDao.Insert(customReport));
 }
Beispiel #28
0
 /// <summary>
 /// 插入自定义报表
 /// </summary>
 /// <returns>设备表ID</returns>
 public int Remove(CustomChart customReport)
 {
     return(_CustomReportDao.Remove(customReport));
 }
Beispiel #29
0
 /// <summary>
 /// 修改自定义报表
 /// </summary>
 /// <returns>设备表ID</returns>
 public int Update(CustomChart customReport)
 {
     return(_CustomReportDao.Update(customReport));
 }
Beispiel #30
0
 public int Add(CustomChart.ChartItem value)
 {
     return base.List.Add(value);
 }
Beispiel #31
0
 public bool Contains(CustomChart.ChartItem value)
 {
     return base.List.Contains(value);
 }
Beispiel #32
0
        /// <summary>
        /// 根据自定义图表,构造设备比较结构
        /// </summary>
        /// <param name="crt"></param>
        /// <returns></returns>
        private List <DeviceStuct> GetDeviceStucts(CustomChart crt)
        {
            List <DeviceStuct> list = new List <DeviceStuct>();

            string[] ss = crt.product.Split(';');

            foreach (string ssssss in ss)
            {
                if (string.IsNullOrEmpty(ssssss))
                {
                    continue;
                }
                string[]    ssa = ssssss.Split(',');
                DeviceStuct dev = new DeviceStuct();
                dev.chartType    = crt.subType;
                dev.intervalMins = 5;
                dev.rate         = 1F;

                foreach (string s in ssa)
                {
                    string[] ss0 = s.Split('&');
                    if (ss0.Length == 2)
                    {
                        switch (ss0[1])
                        {
                        case "subType":
                            dev.chartType = ss0[0];
                            break;

                        case "cVal":
                            dev.cVal = int.Parse(ss0[0]);
                            break;

                        case "Unit":
                            dev.unit = ss0[0];
                            break;

                        case "valueType":
                            dev.monitorType = MonitorType.getMonitorTypeByCode(int.Parse(ss0[0]));
                            break;

                        case "0":    ///DeviceData.PLANT_CODE.ToString()
                            dev.deviceType = ChartDeviceType.PLANT;
                            dev.deviceId   = ss0[0];
                            Plant plant = PlantService.GetInstance().GetPlantInfoById(int.Parse(dev.deviceId));
                            dev.comareObj = plant.name;
                            break;

                        default:
                            dev.deviceType = ChartDeviceType.DEVICE;
                            dev.deviceId   = ss0[0];
                            Device device = DeviceService.GetInstance().get(int.Parse(dev.deviceId));
                            dev.comareObj = device.fullName;
                            break;
                        }
                    }
                }
                if (!(dev.monitorType.code != MonitorType.PLANT_MONITORITEM_ENERGY_CODE && !crt.timeInterval.Equals("Hour")))
                {
                    list.Add(dev);
                }
            }
            return(list);
        }
Beispiel #33
0
 public int IndexOf(CustomChart.ChartItem value)
 {
     return base.List.IndexOf(value);
 }
Beispiel #34
0
 public void Remove(CustomChart.ChartItem value)
 {
     base.List.Remove(value);
 }