Beispiel #1
0
        public static List <Object> RetrieveFunctions()
        {
            try
            {
                List <Object> returnedFunctions = new List <object>();

                List <Function> functions = FunctionDL.RetrieveFunctions().OrderBy(f => f.Name).ToList();

                foreach (Function function in functions)
                {
                    Object functionObj = new
                    {
                        ID       = function.ID,
                        Name     = function.Name,
                        PageLink = function.PageLink
                    };

                    returnedFunctions.Add(functionObj);
                }

                return(returnedFunctions);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
 public static bool Update(Function function)
 {
     try
     {
         return(FunctionDL.Update(function));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
 public static bool Save(Function function, out string message)
 {
     try
     {
         if (FunctionDL.FunctionExists(function))
         {
             message = string.Format("Function with name: {0} exists already", function.Name);
             return(false);
         }
         else
         {
             message = string.Empty;
             return(FunctionDL.Save(function));
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }