Пример #1
0
 public void DeleteCallLog(Guid id)
 {
     using (var ctx = new NovaAlertContext())
     {
         var cl = new CallLogDb()
         {
             CallLogId = id
         };
         ctx.CallLogDbs.Attach(cl);
         cl.DeletedDate = DateTime.Now;
         ctx.SaveChanges();
     }
 }
Пример #2
0
        public void SaveCallLog(CallLog en)
        {
            lock (syncRoot)
            {
                using (var ctx = new NovaAlertContext())
                {
                    var cl = ctx.CallLogDbs.Where(c => c.CallLogId == en.CallLogId).FirstOrDefault();
                    if (cl == null)
                    {
                        cl = new CallLogDb();
                        ctx.CallLogDbs.Add(cl);
                    }

                    Mapper.Map <CallLog, CallLogDb>(en, cl);
                    ctx.SaveChanges();
                }
            }
        }