private void callAfterSended(SendResponse response) { if (response.GetSendStatus(proccessingVisit.Patient.CellNumber) == SendStatus.Succesful) { proccessingVisit.ReminderStatus =(int) SmsStatus.Sent; } afterSend = true; }
private void Send(string username, string password, int accountType) { System.Exception error = null; SendResponse sendResponseResult = null; try { if (_numbers.Length == 0) throw new SmsException(SmsExceptionType.NoNumberSpecified); if (_message == null) throw new SmsException(SmsExceptionType.NoMessageSpecified); if (!IsConnectedToInternet()) throw new SmsException(SmsExceptionType.NoInternetAccess); Cookie cookie = ProcessStepOneRequest(username, password, accountType); if (cookie != null) { ProcessStepTwoRequest(cookie, _numbers); sendResponseResult = ProcessStepThreeRequest(cookie, _message); } else sendResponseResult = new SendResponse { SmsErrorType = SmsErrorType.AuthenticationFailed }; // TODO : Mast maali :-" } catch (System.Exception exp) { error = new SmsException(SmsExceptionType.UnknownError, exp); } this.OnSendComplete(error, sendResponseResult); }
private void callAfterSended(SendResponse response) { btnSend.Enabled = true; lblRunning.Visible = false; lblAccount.Text = string.Format("{0:0,0}", response.Credit); for (int i = 0; i < grdList.RowCount; i++) { if (grdList.Rows[i].Cells["send"].Value != null && (bool)grdList.Rows[i].Cells["send"].Value) {//todo grdList.Rows[i].Cells["statusNo"].Value = response.GetSendStatus(grdList.Rows[i].Cells["phone"].Value.ToString()); } } }
private void OnSendComplete(System.Exception error, SendResponse result) { _sendCompeleted = true; if (SendCompleted != null) { SendCompletedEventArgs e = new SendCompletedEventArgs(error) { Result = result }; SendCompleted(this, e); } }