コード例 #1
0
 static void LogMessageToDatabase(string message, bool success)
 {
     DAL.SyncLogCrmEvolutionDetailItem item = new DAL.SyncLogCrmEvolutionDetailItem();
     item.SyncLogCrmEvolutionId = CurrentLogId;
     item.Name         = message;
     item.IsSuccessful = success;
     item.CreateDate   = DateTime.Now;
     DAL.SyncLogCrmEvolutionDetail.Save(ctx, item);
 }
コード例 #2
0
        static void LogSqlCommandToDatabase(DAL.ServiceCrmEvolutionDetailItem i, string message)
        {
            DAL.SyncLogCrmEvolutionDetailItem item = new DAL.SyncLogCrmEvolutionDetailItem();
            item.SyncLogCrmEvolutionId = CurrentLogId;
            item.Name            = message;
            item.IsSuccessful    = true;
            item.ExecutedCommand = i.Name;
            item.CreateDate      = DateTime.Now;
            item.ErrorMessage    = null;

            DAL.SyncLogCrmEvolutionDetail.Save(ctx, item);
        }
コード例 #3
0
        public static bool Save(entitiesEvolveCentralConsole ctx, SyncLogCrmEvolutionDetailItem item)
        {
            try
            {
                if (item.Id == 0)
                {
                    ctx.SyncLogCrmEvolutionDetailItems.Add(item);
                }

                ctx.SaveChanges();
            }
            catch (Exception ex)
            {
                return(false);
            }
            return(true);
        }
コード例 #4
0
        static void LogExceptionToDatabase(Exception ex, string message)
        {
            DAL.SyncLogCrmEvolutionDetailItem item = new DAL.SyncLogCrmEvolutionDetailItem();
            item.SyncLogCrmEvolutionId = CurrentLogId;
            item.Name            = message;
            item.IsSuccessful    = false;
            item.ExecutedCommand = null;
            item.CreateDate      = DateTime.Now;
            item.ErrorMessage    = ex.Message;


            DAL.SyncLogCrmEvolutionDetail.Save(ctx, item);


            DAL.SyncLogCrmEvolutionItem litem = DAL.SyncLogCrmEvolution.GetById(ctx, Convert.ToInt32(item.SyncLogCrmEvolutionId));
            litem.IsSuccessful = false;
            DAL.SyncLogCrmEvolution.Save(ctx, litem);
        }