protected void uiGridViewHistory_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView row = (DataRowView)e.Row.DataItem; Label lblfrom = (Label)e.Row.FindControl("uiLabelFrom"); Label lblto = (Label)e.Row.FindControl("uiLabelTo"); Label lblstatus = (Label)e.Row.FindControl("uiLabelStatus"); AirPort airport = new AirPort(); airport.LoadByPrimaryKey(Convert.ToInt32(row["From_AirportID"].ToString())); lblfrom.Text = airport.IATACode; airport.LoadByPrimaryKey(Convert.ToInt32(row["To_AirportID"].ToString())); lblto.Text = airport.IATACode; TicketStatus Status = new TicketStatus(); if (!string.IsNullOrEmpty(row["TicketStatusID"].ToString())) { Status.LoadByPrimaryKey(Convert.ToInt32(row["TicketStatusID"].ToString())); if (Session["CurrentCulture"].ToString() == "ar-EG") lblstatus.Text = Status.ArName; else lblstatus.Text = Status.EnName; } } }
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 { } } }