public List <beLocal_subscriber> ComboLocal_subscriber(SqlConnection con) { List <beLocal_subscriber> lbeLocal_subscriber = null; SqlCommand cmd = new SqlCommand("sp_web_combo_Local_subscriber", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader drd = cmd.ExecuteReader(); if (drd != null) { int Localid = drd.GetOrdinal("Localid"); int Localdes = drd.GetOrdinal("Localdes"); lbeLocal_subscriber = new List <beLocal_subscriber>(); beLocal_subscriber obeLocal_subscriber; while (drd.Read()) { obeLocal_subscriber = new beLocal_subscriber(); obeLocal_subscriber.Localid = drd.GetString(Localid); obeLocal_subscriber.Localdes = drd.GetString(Localdes); lbeLocal_subscriber.Add(obeLocal_subscriber); } drd.Close(); } return(lbeLocal_subscriber); }
public List <beLocal_subscriber> Buscar_Local_Subscriber(SqlConnection con, string pLocalid, string pLocaldesc) { List <beLocal_subscriber> lbeLocal_subscriber = null; SqlCommand cmd = new SqlCommand("sp_web_Buscar_Local_Subscriber", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter param1 = cmd.Parameters.Add("@Localid", SqlDbType.VarChar, 15); param1.Direction = ParameterDirection.Input; param1.Value = pLocalid; SqlParameter param2 = cmd.Parameters.Add("@Localdes", SqlDbType.VarChar, 100); param2.Direction = ParameterDirection.Input; param2.Value = pLocaldesc; SqlDataReader drd = cmd.ExecuteReader(); if (drd != null) { int Localid = drd.GetOrdinal("Localid"); int Localdes = drd.GetOrdinal("Localdes"); lbeLocal_subscriber = new List <beLocal_subscriber>(); beLocal_subscriber obeLocal_subscriber; while (drd.Read()) { obeLocal_subscriber = new beLocal_subscriber(); obeLocal_subscriber.Localid = drd.GetString(Localid); obeLocal_subscriber.Localdes = drd.GetString(Localdes); lbeLocal_subscriber.Add(obeLocal_subscriber); } drd.Close(); } return(lbeLocal_subscriber); }
public beLogin ValidarLogin(SqlConnection con, string usuario, string password, string dstb) { beLogin obeLogin = new beLogin(); SqlCommand cmd = new SqlCommand("spw_validarlogin", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter param1 = cmd.Parameters.Add("@sUserIden", SqlDbType.VarChar, 10); param1.Direction = ParameterDirection.Input; param1.Value = usuario; SqlParameter param2 = cmd.Parameters.Add("@sUserPswd", SqlDbType.VarChar, 10); param2.Direction = ParameterDirection.Input; param2.Value = password; SqlParameter param3 = cmd.Parameters.Add("@DealerCode", SqlDbType.VarChar, 3); param3.Direction = ParameterDirection.Input; param3.Value = dstb; SqlDataReader drd = cmd.ExecuteReader(); List <beDstbAbnd> lbeDstbAbnd = null; List <beLocal_subscriber> lbeLocal_subscriber = null; if (drd != null) { drd.Read(); obeLogin.exito = drd.GetInt32(0); if (drd.NextResult()) { int DstbCode = drd.GetOrdinal("DstbCode"); int DstbName = drd.GetOrdinal("DstbName"); int AbndCode = drd.GetOrdinal("AbndCode"); int Oficina = drd.GetOrdinal("Oficina"); int AbndDireccion = drd.GetOrdinal("AbndDireccion"); lbeDstbAbnd = new List <beDstbAbnd>(); beDstbAbnd obeDstbAbnd; while (drd.Read()) { obeDstbAbnd = new beDstbAbnd(); obeDstbAbnd.DstbCode = drd.GetString(DstbCode); obeDstbAbnd.DstbName = drd.GetString(DstbName); obeDstbAbnd.AbndCode = drd.GetString(AbndCode); obeDstbAbnd.Oficina = drd.GetString(Oficina); obeDstbAbnd.AbndDireccion = drd.GetString(AbndDireccion); lbeDstbAbnd.Add(obeDstbAbnd); } if (drd.NextResult()) { int Localid = drd.GetOrdinal("Localid"); int Localdes = drd.GetOrdinal("Localdes"); lbeLocal_subscriber = new List <beLocal_subscriber>(); beLocal_subscriber obeLocal_subscriber; while (drd.Read()) { obeLocal_subscriber = new beLocal_subscriber(); obeLocal_subscriber.Localid = drd.GetString(Localid); obeLocal_subscriber.Localdes = drd.GetString(Localdes); lbeLocal_subscriber.Add(obeLocal_subscriber); } } } obeLogin.lstDstAbnd = lbeDstbAbnd; obeLogin.lstLocal_subscriber = lbeLocal_subscriber; drd.Close(); } return(obeLogin); }