public static void UpdateUser(Users u, EntityState Modified)
 {
     DataLink.UpdateUser(u, Modified);
 }
 public static void CreateUser(Users u)
 {
     DataLink.CreateUser(u);
 }
 public static void DeleteUser(int?id)
 {
     DataLink.DeleteUser(id);
 }
 public static Users GetUser(string email)
 {
     return(DataLink.GetUser(email));
 }
 public static bool CheckForUser(string email)
 {
     return(DataLink.CheckForUser(email));
 }
 public static List <Users> GetAllUsers()
 {
     return(DataLink.GetAllUsers());
 }
 public static Users GetUser(int?id)
 {
     return(DataLink.GetUser(id));
 }
 public static void CreateUserInputsDC(UserInputsDC ui)
 {
     DataLink.CreateUserInputsDC(ui);
 }
 public static void DeleteUserInputsDC(int?id)
 {
     DataLink.DeleteUserInputsDC(id);
 }
 public static List <UserInputsDC> GetAllUserInputsDC()
 {
     return(DataLink.GetAllUserInputsDC());
 }
 public static void CreateUserInputs60Hz(UserInputs60Hz ui)
 {
     DataLink.CreateUserInputs60Hz(ui);
 }
 public static List <UserInputs60Hz> GetAllUserInputs60Hz()
 {
     return(DataLink.GetAllUserInputs60Hz());
 }
Example #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());
        }
Example #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());
        }