public static void perform(string url = "activities/customers") { String successRecords = ""; dynamic customers = DownStream.syncCustomer(url); foreach (var customer in customers) { try { var response = ActionPerform.perform(customer, customer.action); if (response) { successRecords += customer.log_id + ""; } else { Console.WriteLine("Unable to create department"); } } catch (MySqlException e) { if (e.Number == 1062) { successRecords += customer.log_id + ""; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.Message.ToString()); } } UpStream.webAcknowledgement(successRecords); }
public static void perform(string url = "/activities/memberships") { String successRecords = ""; dynamic memberships = DownStream.syncMemberships(url); foreach (var membership in memberships) { try { var response = ActionPerform.perform(membership, membership.action); if (response) { successRecords += membership.log_id + ","; } else { Console.WriteLine("Unable to create membership"); } } catch (MySqlException e) { if (e.Number == 1062) { successRecords += membership.log_id + ","; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.Message.ToString()); } } UpStream.webAcknowledgement(successRecords); }
public static void perform(string url = "activities/employees") { String successRecords = ""; dynamic employees = DownStream.syncEmployee(url); foreach (var employee in employees) { try { var response = ActionPerform.perform(employee, employee.action); if (response) { successRecords += employee.log_id + ","; } else { Console.WriteLine("Unable to create employee"); } } catch (MySqlException e) { if (e.Number == 1062) { successRecords += employee.log_id + ","; } } catch (Exception ex) { Console.WriteLine("Error: " + ex.Message.ToString()); } } UpStream.webAcknowledgement(successRecords); }
public static void perform(string url = "activities/products") { String successRecords = ""; dynamic products = DownStream.syncProduct(url); Console.WriteLine("" + products); foreach (var product in products) { try { var response = ActionPerform.perform(product, product.action); if (response) { successRecords += product.log_id + ","; } else { Console.WriteLine("Unable to create department"); } } catch (MySqlException e) { if (e.Number == 1062) { successRecords += product.log_id + ","; } else { MessageDialog.ShowAlert("Error: " + e.Message.ToString()); } } catch (Exception ex) { Console.WriteLine("Error: " + ex.Message.ToString()); } } UpStream.webAcknowledgement(successRecords); }