protected void Page_Load(object sender, EventArgs e) { SMSGateway gateway = new SMSGateway(); Label1.Text = "Message List\n"; foreach (InboundMessage msg in gateway.getNewMessages()) { Label1.Text += "\n Messsage From :" + msg.getOriginator() + "\nContent : " + msg.getText(); } }
// POST /api/SMSGateway/ public IHttpActionResult PostSendSMS(SMSGateway message) // message serialised in request body { if (ModelState.IsValid) { // log to file log("Sent: " + message.Content + " from " + message.FromNumber + " to " + message.ToNumber); return(Ok()); } else { return(BadRequest()); } }
public ActionResult EditSMSGateway(SMSGateway model) { try { using (var con = new SqlConnection(_connectionString)) { var result = con.Query <int>("Add_Edit_Delete_SMSGateway", new { model.ProcessName, model.SettingID, model.SettingName, model.CompanyName, model.LoginURL, model.UserID, model.Paswrd, model.URLSetting, model.SuccessMsg, model.AvailCredit, model.IsActive, model.Comments, User = "******", Action = "edit" }, commandType: CommandType.StoredProcedure).FirstOrDefault(); if (result == 2) { TempData["Message"] = "Successfully Update"; } else { TempData["Message"] = "Something Went Wrong"; } } } catch (Exception) { throw; } return(RedirectToAction("SMSGatewayIndex")); }
public SmsController(SMSGateway smsGateway, ContactGateway contactGateway, IHubContext <VueHub> hubContext) { _smsGateway = smsGateway; _contactGateway = contactGateway; _hubContext = hubContext; }