Exemplo n.º 1
0
        public bool Delete(TableLogViewModel dt, int id)
        {
            TableLog dr = db.TableLogs.Where(i => i.tlID == id).FirstOrDefault();

            db.TableLogs.Remove(dr);
            var Result = db.SaveChanges();

            return(Result == 1);
        }
Exemplo n.º 2
0
        public bool Update(TableLogViewModel dt, int id)
        {
            TableLog dr = db.TableLogs.Where(i => i.tlID == id).FirstOrDefault();

            dr.tlID          = dt.ID;
            dr.tlType        = dt.LogType;
            dr.tlDate        = dt.LogDate;
            dr.tlDescription = dt.LogDescription;
            var Result = db.SaveChanges();

            return(Result == 1);
        }
Exemplo n.º 3
0
        public int Insert(TableLogViewModel dt)
        {
            TableLog dr = new TableLog();

            dr.tlType        = dt.LogType;
            dr.tlDate        = dt.LogDate;
            dr.tlDescription = dt.LogDescription;
            db.TableLogs.Add(dr);
            var Result = db.SaveChanges();

            return(dr.tlID);
        }