private async void SendButton_Click(object sender, RoutedEventArgs e) { createSMS(); if (SMS != null) { int result = SMSManager.Instance.SendASMS(SMS.PHONE_NUMBER, SMS.CONTENT); if (result == 1) { await MainWindow.Instance.ShowMessageAsync(Messages.TTL_MSG, "Sms has been sent", MessageDialogStyle.Affirmative); SMS.SENDING_STATUS = true; SMS.SEND_DATE_TIME = System.DateTime.Now; SMSService.InsertSMS(SMS); SMS = null; } else { await MainWindow.Instance.ShowMessageAsync(Messages.TTL_MSG, "Sms sending failed", MessageDialogStyle.Affirmative); SMS.SENDING_STATUS = false; SMS.SEND_DATE_TIME = System.DateTime.Now; SMSService.InsertSMS(SMS); } } else { await MainWindow.Instance.ShowMessageAsync(Messages.TTL_MSG, "Please Select a Customer!", MessageDialogStyle.Affirmative); } }
private void createSMS() { sm _nsms = new sm(); try { _nsms.ID = IDHandller.generateID("sms"); _nsms.PHONE_NUMBER = SelectedCustomer.PHONE_HP1; _nsms.CONTENT = "Dear "+LetterHandller.Uppercase(SelectedCustomer.FULLNAME)+", We confirm loan of Rs."+AmountTextBox.Text+" has been granted."+Environment.NewLine+Messages.TTL_MSG; _nsms.TYPE = "send"; _nsms.SENDING_STATUS = true; _nsms.STATUS = true; _nsms.INSERT_USER_ID = Session.LoggedEmployee.ID; _nsms.INSERT_DATETIME = System.DateTime.Now; _nsms.FK_EMPLOYEE_ID = Session.LoggedEmployee.ID; _nsms.FK_CUSTOMER_ID = SelectedCustomer.ID; SMS = _nsms; } catch { SMS = null; } }
private void createSMS() { sm _nsms = new sm(); try { _nsms.ID = IDHandller.generateID("sms"); _nsms.PHONE_NUMBER = PhoneNumberTextBox.Text; _nsms.CONTENT = SMSContentTextBox.Text; _nsms.TYPE = "send"; _nsms.SENDING_STATUS = true; _nsms.STATUS = true; _nsms.INSERT_USER_ID = Session.LoggedEmployee.ID; _nsms.INSERT_DATETIME = System.DateTime.Now; _nsms.FK_EMPLOYEE_ID = Session.LoggedEmployee.ID; _nsms.FK_CUSTOMER_ID = SelectedCustomer.ID; SMS = _nsms; } catch { SMS = null; } }