public void SendBrodcastStatus(string responseString, string Id, string APIfor) { try { int SentStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSSentStatus.Unsent; MobileResponce objMobileResponce = JsonConvert.DeserializeObject <MobileResponce>(responseString); if (objMobileResponce.Apifor.ToLower() == "balance") { if (objMobileResponce.status.ToLower() == "success") { SentStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSSentStatus.Sent; } AccountHistoryBLL.UpdateBalanceStatus(objMobileResponce.trans_id, SentStatus, objMobileResponce.message); } if (objMobileResponce.Apifor.ToLower() == "notification") { if (objMobileResponce.status.ToLower() == "success") { SentStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSSentStatus.Sent; } SMSCommunicationHistoryBLL.UpdateNotificationStatus(objMobileResponce.trans_id, SentStatus); } } catch (Exception ex) { LogMessage("Failed to send Mobile." + ex.Message + " Account Entry Id: " + Id + " Responce: " + responseString + " API For " + APIfor); } }
public void SendSMSStatus(SMSCommunicationHistoryCBE sms, string responseString) { try { SMSResponce objSMSResponce = JsonConvert.DeserializeObject <SMSResponce>(responseString); sms.TransactionId = objSMSResponce.transId; if (!string.IsNullOrEmpty(objSMSResponce.idsms)) { sms.OperatorResponseCode = objSMSResponce.statussms; if (objSMSResponce.statussms == 5) { sms.MessageDeliveryStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSDeliveryStatus.UnDelivered; sms.SentStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSSentStatus.Unsent; } else if (objSMSResponce.statussms == 2 || objSMSResponce.statussms == 3) { sms.MessageDeliveryStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSDeliveryStatus.Delivered; sms.SentStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSSentStatus.Sent; } else { sms.MessageDeliveryStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSDeliveryStatus.Delivered; sms.SentStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSSentStatus.Sent; } sms.ModificationDate = DateTime.Now; sms.MessageReceiveTime = DateTime.Now; sms.OperatorAttemptCount = 1; sms.GatewayResponse = responseString; SMSCommunicationHistoryBLL.UpdateSecondResponse(sms); LogMessage("SMS sent status Second status updated successfully."); } else { sms.MessageDeliveryStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSDeliveryStatus.Delivered; sms.SentStatus = (int)VaaaN.MLFF.Libraries.CommonLibrary.Constants.SMSSentStatus.Sent; sms.ModificationDate = DateTime.Now; sms.MessageReceiveTime = DateTime.Now; sms.OperatorAttemptCount = 0; SMSCommunicationHistoryBLL.UpdateSecondResponse(sms); } } catch (Exception ex) { LogMessage("Failed to GET SMS Responce: " + responseString + " Exception Occured :" + ex.Message); } }