Esempio n. 1
0
 public static void UpdateUser(Users u, EntityState Modified)
 {
     DataLink.UpdateUser(u, Modified);
 }
Esempio n. 2
0
 public static void CreateUser(Users u)
 {
     DataLink.CreateUser(u);
 }
Esempio n. 3
0
 public static void DeleteUser(int?id)
 {
     DataLink.DeleteUser(id);
 }
Esempio n. 4
0
 public static Users GetUser(string email)
 {
     return(DataLink.GetUser(email));
 }
Esempio n. 5
0
 public static bool CheckForUser(string email)
 {
     return(DataLink.CheckForUser(email));
 }
Esempio n. 6
0
 public static List <Users> GetAllUsers()
 {
     return(DataLink.GetAllUsers());
 }
Esempio n. 7
0
 public static Users GetUser(int?id)
 {
     return(DataLink.GetUser(id));
 }
Esempio n. 8
0
 public static void CreateUserInputsDC(UserInputsDC ui)
 {
     DataLink.CreateUserInputsDC(ui);
 }
Esempio n. 9
0
 public static void DeleteUserInputsDC(int?id)
 {
     DataLink.DeleteUserInputsDC(id);
 }
Esempio n. 10
0
 public static List <UserInputsDC> GetAllUserInputsDC()
 {
     return(DataLink.GetAllUserInputsDC());
 }
Esempio n. 11
0
 public static void CreateUserInputs60Hz(UserInputs60Hz ui)
 {
     DataLink.CreateUserInputs60Hz(ui);
 }
Esempio n. 12
0
 public static List <UserInputs60Hz> GetAllUserInputs60Hz()
 {
     return(DataLink.GetAllUserInputs60Hz());
 }
Esempio n. 13
0
        public IEnumerable <UserIP> GetData(out int totalRecords, string globalSearch, int?limitOffset, int?limitRowCount, string orderBy, bool desc)
        {
            var inputs60Hz = DataLink.GetAllUserInputs60Hz();

            var inputsDC = DataLink.GetAllUserInputsDC();

            List <UserIP> userIPs = new List <UserIP>();


            foreach (UserInputs60Hz myInput in inputs60Hz)
            {
                UserIP myIP = new UserIP();
                myIP.IPAddress = myInput.IPAddress;
                myIP.DateAdded = myInput.date;

                userIPs.Add(myIP);
            }

            foreach (UserInputsDC myInput in inputsDC)
            {
                UserIP myIP = new UserIP();
                myIP.IPAddress = myInput.IPAddress;
                myIP.DateAdded = myInput.date;

                userIPs.Add(myIP);
            }

            var query = userIPs.AsQueryable();

            if (!String.IsNullOrWhiteSpace(globalSearch))
            {
                query = query.Where(p => (p.IPAddress + " " + p.DateAdded.ToString()).Contains(globalSearch));
            }

            totalRecords = query.Count();

            if (!String.IsNullOrWhiteSpace(orderBy))
            {
                switch (orderBy.ToLower())
                {
                case "ipaddress":
                    if (!desc)
                    {
                        query = query.OrderBy(p => p.IPAddress);
                    }
                    else
                    {
                        query = query.OrderByDescending(p => p.IPAddress);
                    }
                    break;

                case "dateadded":
                    if (!desc)
                    {
                        query = query.OrderBy(p => p.DateAdded);
                    }
                    else
                    {
                        query = query.OrderByDescending(p => p.DateAdded);
                    }
                    break;
                }
            }


            if (limitOffset.HasValue)
            {
                query = query.Skip(limitOffset.Value).Take(limitRowCount.Value);
            }

            return(query.ToList());
        }
Esempio n. 14
0
        public IEnumerable <UserInputsDC> GetData(out int totalRecords, string globalSearch, int?limitOffset, int?limitRowCount, string orderBy, bool desc)
        {
            var query = DataLink.GetAllUserInputsDC().AsQueryable();

            if (!String.IsNullOrWhiteSpace(globalSearch))
            {
                query = query.Where(p => (p.PotMaxExp.ToString() + " " + p.AvailSCC.ToString() + " " + p.Duration.ToString() + " "
                                          + p.IPAddress + " " + p.date.ToString()).Contains(globalSearch));
            }

            totalRecords = query.Count();

            if (!String.IsNullOrWhiteSpace(orderBy))
            {
                switch (orderBy.ToLower())
                {
                case "potmaxep":
                    if (!desc)
                    {
                        query = query.OrderBy(p => p.PotMaxExp);
                    }
                    else
                    {
                        query = query.OrderByDescending(p => p.PotMaxExp);
                    }
                    break;

                case "availscc":
                    if (!desc)
                    {
                        query = query.OrderBy(p => p.AvailSCC);
                    }
                    else
                    {
                        query = query.OrderByDescending(p => p.AvailSCC);
                    }
                    break;

                case "duration":
                    if (!desc)
                    {
                        query = query.OrderBy(p => p.Duration);
                    }
                    else
                    {
                        query = query.OrderByDescending(p => p.Duration);
                    }
                    break;

                case "ipaddress":
                    if (!desc)
                    {
                        query = query.OrderBy(p => p.IPAddress);
                    }
                    else
                    {
                        query = query.OrderByDescending(p => p.IPAddress);
                    }
                    break;

                case "date":
                    if (!desc)
                    {
                        query = query.OrderBy(p => p.date);
                    }
                    else
                    {
                        query = query.OrderByDescending(p => p.date);
                    }
                    break;
                }
            }


            if (limitOffset.HasValue)
            {
                query = query.Skip(limitOffset.Value).Take(limitRowCount.Value);
            }

            return(query.ToList());
        }