Example #1
0
        public async Task UpdateEntityAsync(EnTemp type, Guid entityGuid, ServerStatus st, DateTime deliveryDate, string connectionString)
        {
            try
            {
                using (var cn = new SqlConnection(connectionString))
                {
                    var cmd = new SqlCommand("sp_Temp_UpdateEntities", cn)
                    {
                        CommandType = CommandType.StoredProcedure
                    };
                    cmd.Parameters.AddWithValue("@type", (short)type);
                    cmd.Parameters.AddWithValue("@entityGuid", entityGuid);
                    cmd.Parameters.AddWithValue("@st", (short)st);
                    cmd.Parameters.AddWithValue("@deliveryDate", deliveryDate);

                    await cn.OpenAsync();

                    await cmd.ExecuteNonQueryAsync();

                    cn.Close();
                }
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
Example #2
0
 public static bool SaveLog(Guid cusGuid, Guid objectGuid, EnTemp tmp)
 {
     try
     {
         var db  = new ModelContext();
         var log = new SyncedData()
         {
             Guid         = Guid.NewGuid(),
             Modified     = DateTime.Now,
             Status       = true,
             CustomerGuid = cusGuid,
             Type         = tmp,
             ObjectGuid   = objectGuid
         };
         db.SyncedData.Add(log);
         db.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         WebErrorLog.ErrorInstence.StartErrorLog(ex);
         return(false);
     }
 }
Example #3
0
 public static async Task UpdateEntityAsync(EnTemp type, Guid entityGuid, ServerStatus st, DateTime deliveryDate) =>
 await UnitOfWork.Temp.UpdateEntityAsync(type, entityGuid, st, deliveryDate, Cache.ConnectionString);