Ejemplo n.º 1
0
        // delete single reports related to content
        public static async Task Delete(ApplicationDbContext context, long Id)
        {
            var entity = new JGN_AbuseReports {
                id = Id
            };

            context.JGN_AbuseReports.Attach(entity);
            context.JGN_AbuseReports.Remove(entity);
            await context.SaveChangesAsync();
        }
Ejemplo n.º 2
0
        public static async Task Delete(ApplicationDbContext context, long ContentID, int Type)
        {
            var entity = new JGN_AbuseReports {
                contentid = ContentID, type = (byte)Type
            };

            context.JGN_AbuseReports.Attach(entity);
            context.JGN_AbuseReports.Remove(entity);
            await context.SaveChangesAsync();
        }
Ejemplo n.º 3
0
        public static async Task Update(ApplicationDbContext context, JGN_AbuseReports entity)
        {
            var item = context.JGN_AbuseReports
                       .Where(p => p.id == entity.id)
                       .FirstOrDefault();

            if (item != null)
            {
                item.status         = entity.status;
                item.review_comment = UtilityBLL.processNull(entity.review_comment, 0);

                context.Entry(item).State = EntityState.Modified;
                await context.SaveChangesAsync();
            }
        }
Ejemplo n.º 4
0
        public static async Task <JGN_AbuseReports> Add(ApplicationDbContext context, long ContentID, string userid, string IPAddress, string Reason, int Type)
        {
            var entry = new JGN_AbuseReports()
            {
                contentid  = ContentID,
                userid     = userid,
                ipaddress  = IPAddress,
                reason     = Reason,
                type       = (byte)Type,
                created_at = DateTime.Now
            };

            context.Entry(entry).State = EntityState.Added;

            await context.SaveChangesAsync();

            return(entry);
        }