Exemplo n.º 1
0
        public static int Save(DevelopingRecord dRecord)
        {
            var a = new DevelopingRecord
            {
                DevelopingRecordId      = dRecord.DevelopingRecordId,
                DevelopingRecordName    = dRecord.DevelopingRecordName,
                DevelopingRecordComment = dRecord.DevelopingRecordComment,
                ModifiedOn = dRecord.ModifiedOn,
                ModifiedBy = dRecord.ModifiedBy
            };

            using (_d = new DataRepository <DevelopingRecord>())
            {
                if (dRecord.DevelopingRecordId > 0)
                {
                    _d.Update(a);
                }
                else
                {
                    _d.Add(a);
                }
                _d.SaveChanges();
            }
            return(a.DevelopingRecordId);
        }
Exemplo n.º 2
0
 public static bool Delete(DevelopingRecord dRecord)
 {
     using (_d = new DataRepository <DevelopingRecord>())
     {
         _d.Delete(dRecord);
         _d.SaveChanges();
     }
     return(true);
 }