protected void uiGridViewCustomers_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditR") { Passenger passenger = new Passenger(); passenger.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); CurrentCustomer = passenger; uiTextBoxFN.Text = passenger.FirstName; uiTextBoxLN.Text = passenger.LastName; uiTextBoxMail.Text = passenger.Email; uiTextBoxMobile.Text = passenger.Mobile; uiDropDownListTitle.SelectedValue = passenger.TitleID.ToString(); uiPanelAll.Visible = false; uiPanelEdit.Visible = true; } else if (e.CommandName == "DeleteR") { Passenger passenger = new Passenger(); passenger.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); passenger.MarkAsDeleted(); passenger.Save(); LoadAllCustomers(); } }
private void SendSMS(TicketInfo Ticket) { Passenger passenger = new Passenger(); passenger.LoadByPrimaryKey(Ticket.PassengerID); AirPort to = new AirPort(); to.LoadByPrimaryKey(Ticket.To_AirportID); using (var wb = new WebClient()) { var data = new NameValueCollection(); data["username"] = "******"; data["password"] = "******"; data["message"] = string.Format(GetLocalResourceObject("SMSBody").ToString(), Ticket.TicketNo, to.Name); data["numbers"] = passenger.Mobile; data["sender"] = GetLocalResourceObject("SenderName").ToString(); data["retrun"] = "Json"; data["Rmduplicated"] = "1"; string url = "http://www.4jawaly.net/api/sendsms.php"; byte[] ServerResponse = wb.UploadValues(url, "POST", data); string responsetext = Encoding.ASCII.GetString(ServerResponse); if (responsetext != "100") { } else { } } }