public static void AddImportErrorsLog(int logId, ChannelErrorEnum errorType, string productName) { ImportLogError le = new ImportLogError(); le.ErrorType = (int)errorType; le.MainLogId = logId; if (productName != string.Empty) le.ProductName = productName; CanonDataContext db = Cdb.Instance; db.ImportLogErrors.InsertOnSubmit(le); db.SubmitChanges(); }