Example #1
0
        public static ApplicationLogItem Get(entitiesEvolveCentral ctx, int itemid)
        {
            var item = new ApplicationLogItem();

            try
            {
                item = (from i in ctx.ApplicationLogItems where i.Id == itemid select i).FirstOrDefault();
            }
            catch (Exception ex)
            {
                item = null;
            }

            return(item);
        }
Example #2
0
        public static bool Delete(entitiesEvolveCentral ctx, ApplicationLogItem item)
        {
            bool retval = true;

            try
            {
                ctx.ApplicationLogItems.Remove(item);
                ctx.SaveChanges();
            }
            catch (Exception ex)
            {
                retval = false;
            }

            return(retval);
        }
Example #3
0
        public static bool Save(entitiesEvolveCentral ctx, ApplicationLogItem item)
        {
            bool retval = true;

            try
            {
                if (item.Id == 0)
                {
                    ctx.ApplicationLogItems.Add(item);
                }

                ctx.SaveChanges();
            }
            catch (Exception ex)
            {
                retval = false;
            }

            return(retval);
        }
Example #4
0
        public static bool Log(entitiesEvolveCentral ctx, string source, string message)
        {
            bool retval = true;

            try
            {
                ApplicationLogItem item = new ApplicationLogItem();
                item.CreatedOn = DateTime.Now;
                item.AdministratorAccountId = null;
                item.MemberAccountId        = null;
                item.Message = message;
                item.Source  = source;

                retval = Save(ctx, item);
            }
            catch (Exception ex)
            {
                retval = false;
            }

            return(retval);
        }