/// <summary> /// Contact Upd /// </summary> public static async Task <ContactEntity> ContactUpd(ContactEntity item, string userGuid, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryFirstOrDefaultAsync <ContactEntity>( "pm_contact_upd", new { contact_guid_in = item.contact_guid, service_group_guid_in = serviceGroupGuid, user_guid_in = userGuid, contact_type_guid_in = item.contact_type_guid, contact_info_in = item.contact_info }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); return(null); } }
/// <summary> /// Attachment Upd /// </summary> public static async Task <AttachmentEntity> AttachmentUpd(AttachmentEntity item) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryFirstOrDefaultAsync <AttachmentEntity>( "pm_attachment_upd", new { service_group_guid_in = item.service_group_guid, user_guid_in = item.user_guid, container_in = item.container, object_guid_in = item.object_guid, name_in = item.name, uri_in = item.uri }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); return(null); } }
/// <summary> /// Nomenclature Material Upd /// </summary> public static async Task <NomenclatureOperationEntity> NomenclatureOperationUpd(NomenclatureOperationEntity item, string userGuid, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryFirstOrDefaultAsync <NomenclatureOperationEntity>( "pm_nomenclature_operation_upd", new { nomenclature_operation_guid_in = item.nomenclature_operation_guid, nomenclature_guid_in = item.nomenclature_guid, service_group_guid_in = serviceGroupGuid, user_guid_in = userGuid, operation_guid_in = item.operation_guid, operation_count_in = item.operation_count, operation_price_in = item.operation_price, operation_price_total_in = item.operation_price_total, operation_price_total_src_in = item.operation_price_total_src, operation_attribute_in = item.operation_attribute }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); return(null); } }
public async Task <bool> Send(ISmsMessage smsItem) { if (smsItem.Retries > MaximumRetries) { return(false); } if (smsItem.IsNew) { await Database.Save(smsItem); } try { await Dispatcher.Dispatch(smsItem); await Database.Update(smsItem, o => o.DateSent = LocalTime.Now); return(true); } catch (Exception ex) { await SendError.Raise(new SmsSendingEventArgs(smsItem) { Error = ex }); Log.Error(ex, "Can not send the SMS queue item."); await RecordFailedAttempt(smsItem); return(false); } }
/// <summary> /// EquipmentColorfulnessEditionPrice Get /// </summary> public static async Task <IEnumerable <EquipmentColorfulnessEditionPrice> > EquipmentColorfulnessEditionPriceGet( string equipmentGuid, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryAsync <EquipmentColorfulnessEditionPrice>( "pm_equipment_colorfulness_edition_price_get", new { equipment_guid_in = equipmentGuid, service_group_guid_in = serviceGroupGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); return(null); } }
/// <summary> /// Nomenclature Operation Get /// </summary> public static async Task <IEnumerable <NomenclatureOperationEntity> > NomenclatureOperationGet( string nomenclatureOperationGuid, string nomenclatureGuid, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryAsync <NomenclatureOperationEntity>( "pm_nomenclature_operation_get", new { nomenclature_operation_guid_in = nomenclatureOperationGuid, nomenclature_guid_in = nomenclatureGuid, service_group_guid_in = serviceGroupGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); return(null); } }
/// <summary> /// Attachment Get /// </summary> public static async Task <IEnumerable <AttachmentEntity> > AttachmentGet(string container, string objectGuid, string attachmentGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryAsync <AttachmentEntity>("pm_attachment_get", new { container_in = container, object_guid_in = objectGuid, attachment_guid_in = attachmentGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); return(null); } }
private void OnSendError(SocketException socketException) { if (SendError != null) { SendError.BeginInvoke(this, new SocketExceptionEventArgs(socketException), null, null); } }
/// <summary> /// TypeOfOwnership Upd /// </summary> public static async Task <IEnumerable <UniversalCatalogEntity> > CatalogObjectUpd(string objectGuid, string objectTypeGuid, string serviceGroupGuid, string userGuid, string objectInfo) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryAsync <UniversalCatalogEntity>( "catalog_object_upd", new { object_guid_in = objectGuid, object_type_guid_in = objectTypeGuid, service_group_guid_in = serviceGroupGuid, user_guid_in = userGuid, object_info_in = objectInfo }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); return(null); } }
public void SendConsole(string message) { Console.WriteLine($"Sending console {message}"); Sent?.Invoke(); SendError?.Invoke(this, new SendErrorEventArgs("brak polaczenia")); }
private void OnReceiveMsg(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e) { if (!e.sMsg.Contains("신규주문") && !e.sMsg.Contains("지연")) { Box.Show(e.sMsg.Substring(8), "Caution", 895); string[] arr = e.sRQName.Split(';'); OnReceiveOrder(new Elements(Number.GetScreen(), arr[2], arr[3], arr[0], arr[1])); } SendError?.Invoke(this, new Error(e.sTrCode, e.sRQName, e.sScrNo, e.sMsg)); }
public void OnReceiveOrder(Elements e) { rq = new Task(() => { Error_code = axAPI.SendOrderFO(e.sRQName, e.screen, Account, Code, 1, e.classification, "3", Math.Abs(e.quantity), "", ""); }); request.RequestTrData(rq); if (Error_code != 0) { SendError?.Invoke(this, new Error(Error_code)); } }
public async Task <bool> Send(IEmailMessage message) { if (message == null) { throw new ArgumentNullException(nameof(message)); } if (message.SendableDate > LocalTime.Now) { Log.Info($"Skipping Send() command for IEmailMessage ({message.GetId()}). SendableDate is in the future."); if (message.IsNew) { await Database.Save(message); } return(false); } using (var mail = await MessageCreator.Create(message)) { if (mail.To.None() && mail.CC.None() && mail.Bcc.None()) { Log.Info($"Mail message {message.GetId()} will not be sent as there is no effective recipient."); return(false); } try { await Sending.Raise(new EmailSendingEventArgs(message, mail)); await Dispatcher.Dispatch(mail, message); if (!message.IsNew) { await Database.Delete(message); } await Sent.Raise(new EmailSendingEventArgs(message, mail)); return(true); } catch (Exception ex) { await SendError.Raise(new EmailSendingEventArgs(message, mail) { Error = ex }); await RecordRetry(message); Log.Error(ex, $"Error in sending an email for this EmailQueueItem of '{message.GetId()}' because : " + Environment.NewLine + ex.ToFullMessage()); return(false); } } }
private void InputValueRqData(TR param) { string[] count = param.ID.Split(';'), value = param.Value.Split(';'); int i, l = count.Length; for (i = 0; i < l; i++) { axAPI.SetInputValue(count[i], value[i]); } Error_code = axAPI.CommRqData(param.RQName, param.TrCode, param.PrevNext, param.ScreenNo); if (Error_code != 0) { SendError?.Invoke(this, new Error(Error_code)); } }
/// <summary> /// Attachment Del /// </summary> public static async Task AttachmentUpdDel(string attachmentGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); await pixMakeRepository.ExecuteAsync("pm_attachment_del", new { attachment_guid_in = attachmentGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); } }
/// <summary> /// User Identity Info /// </summary> public static async Task <string> GetUserServiceGroup(string userGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryFirstOrDefaultAsync <string>("auth_service_group_account_get", new { user_guid_in = userGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); } return(null); }
/// <summary> /// Log Ins /// </summary> public static async Task LogEventIns(int eventTypeId, string eventDescripton) { try { var logRepository = await LogMySqlRepository.GetConnection(); await logRepository.ExecuteAsync("log_event_ins", new { event_type_id_in = eventTypeId, event_desc_in = eventDescripton }, commandType : CommandType.StoredProcedure); logRepository.Close(); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); } }
public void StartProgress() { if (axAPI != null) { Error_code = axAPI.CommConnect(); if (Error_code != 0) { SendError?.Invoke(this, new Error(Error_code)); Box.Show("Connection Failed!!", "Caution", waiting); SendExit?.Invoke(this, new ForceQuit(end)); } return; } Box.Show("API Not Found!!", "Caution", waiting); SendExit?.Invoke(this, new ForceQuit(end)); }
/// <summary> /// CatalogObjectDel /// </summary> public static async Task CatalogObjectDel(string objectGuid, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); await pixMakeRepository.ExecuteAsync("catalog_object_del", new { object_guid_in = objectGuid, service_group_guid_in = serviceGroupGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); } }
/// <summary> /// Contact Person Del /// </summary> public static async Task ContactPersonDel(string contactPersonGuid, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); await pixMakeRepository.ExecuteAsync("pm_contact_person_del", new { contact_person_guid_in = contactPersonGuid, service_group_guid_in = serviceGroupGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); } }
/// <summary> /// Nomenclature Operation Del /// </summary> public static async Task NomenclatureOperationByNomenclatureDel(string nomenclatureGuid, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); await pixMakeRepository.ExecuteAsync("pm_nomenclature_operation_by_nomenclature_del", new { nomenclature_guid_in = nomenclatureGuid, service_group_guid_in = serviceGroupGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); } }
/// <summary> /// Order Upd /// </summary> public static async Task OrderApprovedUpd(string orderGuid, bool approved, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); await pixMakeRepository.ExecuteAsync( "pm_order_approved_updV2", new { order_guid_in = orderGuid, approved_in = approved, service_group_guid_in = serviceGroupGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); } }
/// <summary> /// Contact Bank Account Get /// </summary> public static async Task <IEnumerable <ContactBankAccountEntity> > ContactBankAccountGet(string contactBankAccountGuid, string contactGuid, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryAsync <ContactBankAccountEntity>("pm_contact_bank_account_get", new { contact_bank_account_guid_in = contactBankAccountGuid, contact_guid_in = contactGuid, service_group_guid_in = serviceGroupGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); return(null); } }
EquipmentAdjustmentGroupEditionGet(string equipmentGuid, string serviceGroupGuid) { try { var pixMakeRepository = await PixMakeMySqlRepository.GetConnection(); var result = await pixMakeRepository.QueryAsync <EquipmentAdjustmentGroupEdition>( "pm_equipment_adjustment_group_edition_get", new { equipment_guid_in = equipmentGuid, service_group_guid_in = serviceGroupGuid }, commandType : CommandType.StoredProcedure); pixMakeRepository.Close(); return(result); } catch (Exception ex) { await SendError.SendErrorAsync(ex, customMessage : "MySql"); return(null); } }
private static void UIThreadException(object sender, ThreadExceptionEventArgs t) { SendError error = new SendError(t.Exception, true); error.ShowDialog(); }
private static void UnhandledException(object sender, UnhandledExceptionEventArgs e) { SendError error = new SendError((Exception)e.ExceptionObject, true); error.ShowDialog(); }
static void OnSendError(IEmailQueueItem email, Exception error) { SendError?.Invoke(email, new EventArgs <Exception>(error)); }
void OnSendError(string errorString) => SendError.Invoke(this, errorString);