public List <WhatsAppPendientes> ObtenerWhatsPendiente(string Telefono) { List <WhatsAppPendientes> lsWhatsAppPendientes = new List <WhatsAppPendientes>(); SqlCommand query = new SqlCommand(); query.CommandType = CommandType.Text; query.CommandText = "select * from WhatsAppPendientes where UidEstatusWhatsApp = '06BDD7B7-C463-4A23-982B-D1D95F695F80' and VchTelefono = '" + Telefono + "'"; DataTable dt = this.Busquedas(query); foreach (DataRow item in dt.Rows) { whatsAppPendientes = new WhatsAppPendientes() { UidWhatsAppPendiente = Guid.Parse(item["UidWhatsAppPendiente"].ToString()), VchUrl = item["VchUrl"].ToString(), DtVencimiento = DateTime.Parse(item["DtVencimiento"].ToString()), VchTelefono = item["VchTelefono"].ToString(), UidPropietario = Guid.Parse(item["UidPropietario"].ToString()), UidUsuario = Guid.Parse(item["UidUsuario"].ToString()), UidHistorialPago = Guid.Parse(item["UidHistorialPago"].ToString()), VchDescripcion = item["VchDescripcion"].ToString(), UidEstatusWhatsApp = Guid.Parse(item["UidEstatusWhatsApp"].ToString()) }; lsWhatsAppPendientes.Add(whatsAppPendientes); } return(lsWhatsAppPendientes); }
public List <WhatsAppPendientes> ObtenerWhatsPntHistPago(Guid UidPropietario) { List <WhatsAppPendientes> lsWhatsAppPendientes = new List <WhatsAppPendientes>(); SqlCommand query = new SqlCommand(); query.CommandType = CommandType.Text; query.CommandText = "select wp.*, pt.Prefijo from WhatsAppPendientes wp, Usuarios us, TelefonosUsuarios tu, PrefijosTelefonicos pt where wp.UidUsuario = us.UidUsuario and us.UidUsuario = tu.UidUsuario and tu.UidPrefijo = pt.UidPrefijo and UidEstatusWhatsApp = '06BDD7B7-C463-4A23-982B-D1D95F695F80' and UidPropietario = '" + UidPropietario + "'"; DataTable dt = this.Busquedas(query); foreach (DataRow item in dt.Rows) { whatsAppPendientes = new WhatsAppPendientes() { UidWhatsAppPendiente = Guid.Parse(item["UidWhatsAppPendiente"].ToString()), VchUrl = item["VchUrl"].ToString(), DtVencimiento = DateTime.Parse(item["DtVencimiento"].ToString()), VchTelefono = "(" + item["Prefijo"].ToString() + ")" + item["VchTelefono"].ToString(), UidPropietario = Guid.Parse(item["UidPropietario"].ToString()), UidUsuario = Guid.Parse(item["UidUsuario"].ToString()), UidHistorialPago = Guid.Parse(item["UidHistorialPago"].ToString()), VchDescripcion = item["VchDescripcion"].ToString(), UidEstatusWhatsApp = Guid.Parse(item["UidEstatusWhatsApp"].ToString()) }; lsWhatsAppPendientes.Add(whatsAppPendientes); } return(lsWhatsAppPendientes); }
public bool RegistrarWhatsPendiente(WhatsAppPendientes whatsAppPendientes) { bool Resultado = false; SqlCommand comando = new SqlCommand(); try { comando.CommandType = System.Data.CommandType.StoredProcedure; comando.CommandText = "sp_WhatsAppPendientesRegistrar"; comando.Parameters.Add("@UidWhatsAppPendiente", SqlDbType.UniqueIdentifier); comando.Parameters["@UidWhatsAppPendiente"].Value = whatsAppPendientes.UidWhatsAppPendiente; comando.Parameters.Add("@VchUrl", SqlDbType.VarChar); comando.Parameters["@VchUrl"].Value = whatsAppPendientes.VchUrl; comando.Parameters.Add("@DtVencimiento", SqlDbType.Date); comando.Parameters["@DtVencimiento"].Value = whatsAppPendientes.DtVencimiento; comando.Parameters.Add("@VchTelefono", SqlDbType.VarChar); comando.Parameters["@VchTelefono"].Value = whatsAppPendientes.VchTelefono; comando.Parameters.Add("@UidPropietario", SqlDbType.UniqueIdentifier); comando.Parameters["@UidPropietario"].Value = whatsAppPendientes.UidPropietario; comando.Parameters.Add("@UidUsuario", SqlDbType.UniqueIdentifier); comando.Parameters["@UidUsuario"].Value = whatsAppPendientes.UidUsuario; comando.Parameters.Add("@UidHistorialPago", SqlDbType.UniqueIdentifier); comando.Parameters["@UidHistorialPago"].Value = whatsAppPendientes.UidHistorialPago; comando.Parameters.Add("@VchDescripcion", SqlDbType.VarChar); comando.Parameters["@VchDescripcion"].Value = whatsAppPendientes.VchDescripcion; Resultado = this.ManipulacionDeDatos(comando); } catch (Exception) { throw; } return(Resultado); }