// Token: 0x060007B1 RID: 1969 RVA: 0x00037204 File Offset: 0x00035404
        public Dictionary <int, string> GetNetworkDeviceNamesForPage(CorePageType pageType, List <int> limitationIDs, bool includeBasic)
        {
            switch (pageType)
            {
            case 1:
                return(AlertDAL.GetNodeData(limitationIDs, includeBasic));

            case 2:
            {
                INetworkDeviceDal networkDeviceDal = this.syslogDal;
                return(((networkDeviceDal != null) ? networkDeviceDal.GetNodeData(limitationIDs) : null) ?? new Dictionary <int, string>(0));
            }

            case 3:
            {
                INetworkDeviceDal networkDeviceDal2 = this.trapDal;
                return(((networkDeviceDal2 != null) ? networkDeviceDal2.GetNodeData(limitationIDs) : null) ?? new Dictionary <int, string>(0));
            }

            case 4:
                return(EventsDAL.GetNodeData(limitationIDs));

            default:
                throw new NotImplementedException("Unsupported page type");
            }
        }
Exemple #2
0
        //单品明细数据进行批号排序,返回list  4/7
        static public string QueryIndetail(int stockID, out string msg, ref int totalPage, ref int currentPage)
        {
            List <Dictionary <string, string> > list = IndetailDAL.QueryByStockID(stockID, out msg);
            List <Alert> alerts = AlertDAL.QueryAll(out msg);

            if (list == null)
            {
                msg         = "不能出库过期产品";
                totalPage   = 0;
                currentPage = -1;
                return(null);
            }
            //排序+过滤过期药品
            List <Dictionary <string, string> > sortList = SortDate(list);

            if (sortList == null)
            {
                msg         = "暂无未过期的单品明细";
                totalPage   = 0;
                currentPage = -1;
                return(null);
            }
            if (alerts != null && alerts.Count != 0)
            {
                alerts = alerts.OrderBy(o => o.days).ToList();//升序
                for (int i = 0; i < sortList.Count; i++)
                {
                    int nowColor = AlertManage.GetInterval(sortList[i]["batchNum"], alerts);
                    if (nowColor != -1)
                    {
                        sortList[i].Add("color", alerts[nowColor].color.ToString());
                    }
                    else
                    {
                        sortList[i].Add("color", "");
                    }
                }
            }

            totalPage = (int)System.Math.Floor((decimal)(sortList.Count / 10));
            if (list.Count != 0 && list.Count % 10 == 0)
            {
                --totalPage;
            }
            if (currentPage < totalPage)
            {
                ++currentPage;
            }
            try
            {
                return(JsonConvert.SerializeObject(sortList.GetRange(currentPage * 10, 10)));
            }
            catch
            {
                return(JsonConvert.SerializeObject(sortList.GetRange(currentPage * 10, sortList.Count - currentPage * 10)));
            }
        }
        public static List <Alert> getRejectionTasksByCreator(decimal id)
        {
            try {
                List <Alert> list   = new List <Alert>();
                var          dTasks = TaskDAL.getCreationTasksByUser(id).ToList();

                foreach (tasks item in dTasks)
                {
                    var dAlert = AlertDAL.fetchByTaskId(long.Parse(item.id + ""));
                    if (dAlert != null)
                    {
                        Task task = new Task();
                        task.id          = long.Parse(item.id + "");
                        task.name        = item.name;
                        task.description = item.description;
                        task.dateEnd     = item.date_end;
                        task.sDateEnd    = ((DateTime)item.date_end).ToString("dd/MM/yyyy").Replace("-", "/");

                        if (item.process_id != null)
                        {
                            var     process  = ProcessDAL.getById(Decimal.Parse(item.process_id + ""));
                            Process dProcess = new Process();
                            dProcess.name        = process.name;
                            dProcess.description = process.description;
                            dProcess.id          = long.Parse(process.id + "");
                            task.process         = dProcess;
                        }

                        var user = UserDAL.fetchAll().Where(x => x.id == item.assing_id).FirstOrDefault();

                        User mUser = new User();
                        mUser.id   = long.Parse(user.id + "");
                        mUser.name = user.name;

                        task.creatorUser = mUser;

                        Alert alert = new Alert();

                        alert.id      = dAlert.id;
                        alert.message = dAlert.message;
                        alert.state   = int.Parse(dAlert.state + "");
                        alert.task    = task;

                        list.Add(alert);
                    }
                }


                return(list);
            } catch (Exception e) {
                throw e;
            }
        }
 static public bool Destory(List <int> alerts, out string msg)
 {
     if (alerts == null || alerts.Count == 0)
     {
         msg = "没有记录需要销毁";
         return(false);
     }
     for (int i = 0; i < alerts.Count; i++)
     {
         if (!AlertDAL.Delete(alerts[i], out msg))
         {
             return(false);
         }
     }
     msg = "";
     return(true);
 }
        public List <SolarWinds.Orion.Core.Common.Models.Node> GetNetworkDevices(
            CorePageType pageType,
            List <int> limitationIDs)
        {
            switch (pageType - 1)
            {
            case 0:
                return(AlertDAL.GetAlertNetObjects(limitationIDs));

            case 1:
                return(this.syslogDal?.GetNetObjects(limitationIDs) ?? new List <SolarWinds.Orion.Core.Common.Models.Node>(0));

            case 2:
                return(this.trapDal?.GetNetObjects(limitationIDs) ?? new List <SolarWinds.Orion.Core.Common.Models.Node>(0));

            default:
                throw new NotImplementedException("Unsupported page type");
            }
        }
        // Token: 0x060007B0 RID: 1968 RVA: 0x00037194 File Offset: 0x00035394
        public List <Node> GetNetworkDevices(CorePageType pageType, List <int> limitationIDs)
        {
            switch (pageType)
            {
            case 1:
                return(AlertDAL.GetAlertNetObjects(limitationIDs));

            case 2:
            {
                INetworkDeviceDal networkDeviceDal = this.syslogDal;
                return(((networkDeviceDal != null) ? networkDeviceDal.GetNetObjects(limitationIDs) : null) ?? new List <Node>(0));
            }

            case 3:
            {
                INetworkDeviceDal networkDeviceDal2 = this.trapDal;
                return(((networkDeviceDal2 != null) ? networkDeviceDal2.GetNetObjects(limitationIDs) : null) ?? new List <Node>(0));
            }

            default:
                throw new NotImplementedException("Unsupported page type");
            }
        }
Exemple #7
0
 public static void DeleteAlert(string IDs)
 {
     AlertDAL.DeleteAlert(IDs);
 }
Exemple #8
0
 public static void UpdateAlert(string AlertID, int AlertType, int CaseID, decimal Num1, string Str1, string person, DateTime Date1, int CompanyID, string CaseOwnerID)
 {
     AlertDAL.InsertAlert(AlertType, CaseID, Num1, Str1, person, Date1, CompanyID, CaseOwnerID);
 }
Exemple #9
0
 public static DataSet GetCompanyAlertListByCompanyID(string CompanyID)
 {
     string where = "CompanyID={0}";
     return(AlertDAL.GetAlertList(string.Format(where, CompanyID)));
 }
Exemple #10
0
 public static DataSet GetAlertList(string where)
 {
     return(AlertDAL.GetAlertList(where));
 }
Exemple #11
0
 public static DataSet GetAlertList()
 {
     return(AlertDAL.GetAlertList());
 }
Exemple #12
0
 public static DataSet GetAlertByID(string id)
 {
     return(AlertDAL.GetAlertList("ID=" + id));
 }
        static public string QueryAll(out string msg)
        {
            List <Alert> list = AlertDAL.QueryAll(out msg);

            return(list != null?JsonConvert.SerializeObject(list) : null);
        }
 static public bool Update(Alert alert, out string msg)
 {
     return(AlertDAL.Update(alert, out msg));
 }
 static public bool Add(Alert alert, out string msg)
 {
     return(AlertDAL.Add(alert, out msg));
 }