/// <summary> /// Metodo que agregra los usuarios a la base de datos /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAgregar_Click(object sender, EventArgs e) { try { IBLLSeguridad _BLLSeguridad = new BLLSeguridad(); Usuario oUsuario = new Usuario(); if (string.IsNullOrEmpty(txtNombreUsuario.Text)) { erpErrores.SetError(txtNombreUsuario, "Debe contener un valor"); return; } if (string.IsNullOrEmpty(txtContrasena.Text)) { erpErrores.SetError(txtContrasena, "Debe contener un valor"); return; } oUsuario = _BLLSeguridad.AgregarUsuario(FactoryUsuario.ConstruirUsuario(txtNombreUsuario.Text, txtContrasena.Text, cboTipoUsuario.SelectedItem.ToString())); CargarUsuarios(); } catch (Exception er) { StringBuilder msg = new StringBuilder(); msg.AppendFormat("Message {0}\n", er.Message); msg.AppendFormat("Source {0}\n", er.Source); msg.AppendFormat("InnerException {0}\n", er.InnerException); msg.AppendFormat("StackTrace {0}\n", er.StackTrace); msg.AppendFormat("TargetSite {0}\n", er.TargetSite); _MyLogControlEventos.ErrorFormat("Error {0}", msg.ToString()); MessageBox.Show("Se ha producido el siguiente error " + er.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public List <Geo> InformaGeo() { try { foreach (var Lista in new ManterGeoDAO(ObjGeo).InformaGeoDAO()) { if (Lista.Data.Date < DateTime.Now.Date || Lista.Data.Date == DateTime.Now.Date && Lista.Data.Hour < (DateTime.Now.Hour - 1)) { foreach (var Gestores in new ManterUsuario(ObjUsuario).ConsultaUsuariosGestores()) { Usuario Usr = FactoryUsuario.GetNew(TipoUsuario.UsuarioFuncionario); Usr.Id = Lista.IdUsr; Usr = new ManterUsuario(Usr).ConsultaUsuarioById(); ObjNotificacao.IdOrigem = Lista.IdUsr; ObjNotificacao.IdDest = Gestores.Id; ObjNotificacao.IdMensagem = 10; ObjNotificacao.IdTipo = 4; new ManterNotificacao(ObjNotificacao).NotificaUsuariosSistem(); } } } return(new ManterGeoDAO(ObjGeo).InformaGeoDAO()); } catch (Exception) { throw; } }
public List <Usuario> ConsultaTecnicoAtendByChamadoDAO() { try { List <Usuario> List = new List <Usuario>(); SqlDataReader Dr = null; using (SqlConnection Con = new Conexao().ConexaoDB()) { SqlCommand Cmd = new SqlCommand(@" select top 1 Atd.idTecnico, Usr.nome from Atendimento Atd inner join Usuario Usr on (Atd.idTecnico = Usr.idUsuario) where Atd.idChamado = @Id;", Con); Cmd.Parameters.AddWithValue("@Id", ObjAtend.IdChamado); Dr = Cmd.ExecuteReader(); while (Dr.Read()) { Usuario Usuario = FactoryUsuario.GetNew(TipoUsuario.Usuario); Usuario.Id = Dr.GetInt32(0); Usuario.Nome = Dr.GetString(1); List.Add(Usuario); } return(List); } } catch (SqlException) { throw; } }
public bool CancelaChamado() { try { ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.Usuario); ObjUsuario.IdStatus = 1; if (new ManterChamadoDAO(ObjChamado).CancelaChamadoDAO() && new ManterAtendimento(ObjAtend, ObjChamado).CancelaAtendimento() && new ManterUsuario(ObjUsuario).AlteraDisponibilidade()) { ObjNotificacao.IdOrigem = 0; ObjNotificacao.IdDest = ObjAtend.IdTecnico; ObjNotificacao.IdMensagem = 6; ObjNotificacao.IdTipo = 4; ObjNotificacao.IdChamado = ObjChamado.Id; new ManterNotificacao(ObjNotificacao).NotificaUsuariosSistem(); ObjNotificacao.IdDest = ObjAtend.IdCliente; new ManterNotificacao(ObjNotificacao).NotificaUsuariosSistem(); return(true); } else { return(false); } } catch (Exception) { throw; } }
protected void BotaoEntrar_Click(object sender, EventArgs e) { try { if (!TxtLogin.Text.Equals("") && !TxtSenha.Text.Equals("")) { if (ManterLogin.Logar(TxtLogin.Text, TxtSenha.Text)) { ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.Usuario); ObjUsuario.Login = TxtLogin.Text; TxtLogin.Visible = true; ObjUsuario = new ManterUsuario(ObjUsuario).GetUsuarioEmpresa(); Session["usuario"] = TxtLogin.Text; InfoGlobal.GlobalIdEmpresa = ObjUsuario.IdEmpresa; FormsAuthentication.RedirectFromLoginPage(TxtLogin.Text, true); Response.Redirect("\\Views\\SGA\\Inicio.aspx", false); } else { MsgLabel.Text = "Login ou senha inválidos."; } } else { MsgLabel.Text = "Login ou senha não preenchidos."; } } catch (Exception Ex) { LogException.InsereLogBd(Ex); MsgLabel.Text = LogException.CodigoErroBd(); } }
protected void ButtonChamar_Click(object sender, EventArgs e) { try { ListaUsuario.Clear(); ChamarTecnico = true; EntrarChat = false; Perfil.Add("Técnico"); Perfil.Add("Gestor"); Perfil.Add("Atendente"); foreach (var ObjTecnico in new ManterUsuario().ConsultaUsuariosByPerfil(Perfil)) { Usuario ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.UsuarioFuncionario); if (!ObjTecnico.IdMS.Equals(Session["idms"])) { ObjUsuario.Id = ObjTecnico.Id; ObjUsuario.Login = ObjTecnico.Login; ObjUsuario.Nome = ObjTecnico.Nome; ObjUsuario.IdMS = ObjTecnico.IdMS; ListaUsuario.Add(ObjUsuario); } } } catch (Exception Ex) { LogException.InsereLogBd(Ex); MsgLabel.Text = LogException.CodigoErroBd(); } }
public string Login() { Usuario ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.Usuario); List <Usuario> Lista = new List <Usuario>(); Lista = new ManterUsuario(ObjUsuario).ConsultaUsuarios(); return(JsonConvert.SerializeObject(Lista, Newtonsoft.Json.Formatting.Indented)); }
public List <Usuario> ConsultaUsuariosDAO() { try { List <Usuario> UsrList = new List <Usuario>(); SqlDataReader Dr = null; using (SqlConnection Con = new Conexao().ConexaoDB()) { SqlCommand CmdUsrs = new SqlCommand(@" SELECT usr.idUsuario, usr.nome, usr.endereco, usr.numero, usr.cep, usr.telefone, emp.nome FROM [dbo].[Usuario] Usr left join [dbo].[Empresa] Emp on (Usr.idEmpresa = Emp.idEmpresa) WHERE Usr.idEmpresa = @Empresa", Con); CmdUsrs.Parameters.AddWithValue("@Empresa", InfoGlobal.GlobalIdEmpresa); Dr = CmdUsrs.ExecuteReader(); while (Dr.Read()) { Usuario Usr = FactoryUsuario.GetNew(TipoUsuario.UsuarioFuncionario); Usr.Id = Dr.GetInt32(0); Usr.Nome = Dr.GetString(1); Usr.Endereco = Dr.GetString(2); Usr.Complemento = Dr.GetString(3); Usr.Cep = Dr.GetString(4); Usr.Telefone = Dr.GetString(5); if (!Dr.IsDBNull(6)) { Usr.NomeEmpresa = Dr.GetString(6); } Usr.Regra = GetRegraUserDAO(Usr.Id); UsrList.Add(Usr); } return(UsrList); } } catch (SqlException) { throw; } }
protected void RecuperarButton_Click(object sender, EventArgs e) { MsgLabel.Text = ""; ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.Usuario); ObjUsuario.Login = TxtLoginRecup.Text; ObjUsuario.Email = TxtEmail.Text; if (new ManterUsuario(ObjUsuario).RecuperarSenha()) { MsgLabel.Text = "Sua nova senha foi enviada para seu e-mail. Favor consultar sua caixa de entrada."; } else { MsgLabel.Text = "Login/E-mail não encontrado ou inválido. Favor rever."; } }
public bool RecusaAtendimentoChamado() { try { ObjNotificacao.IdOrigem = 0; ObjNotificacao.IdDest = ObjAtend.IdTecnico; ObjNotificacao.IdMensagem = 9; ObjNotificacao.IdTipo = 4; ObjNotificacao.IdChamado = ObjAtend.IdChamado; new ManterNotificacao(ObjNotificacao).NotificaUsuariosSistem(); ObjAtend.IdTecnico = new ManterAtendimentoDAO(ObjAtend, ObjChamado).RecusaAtendimentoChamadoDAO().IdTecnico; ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.Usuario); ObjUsuario.Id = ObjAtend.IdTecnico; ObjUsuario.IdStatus = 2; if (ObjAtend != null && new ManterAtendimentoDAO(ObjAtend, ObjChamado).CadastraAtendimentoReaberturaChamadoDAO() && new ManterUsuario(ObjUsuario).AlteraDisponibilidade()) { ObjNotificacao.IdOrigem = 0; ObjNotificacao.IdDest = ObjAtend.IdTecnico; ObjNotificacao.IdMensagem = 3; ObjNotificacao.IdTipo = 4; ObjNotificacao.IdChamado = ObjAtend.IdChamado; new ManterNotificacao(ObjNotificacao).NotificaUsuariosSistem(); foreach (var Gestor in new ManterUsuario(ObjUsuario).ConsultaUsuariosGestores()) { ObjNotificacao.IdDest = Gestor.Id; new ManterNotificacao(ObjNotificacao).NotificaUsuariosSistem(); } return(true); } else { return(false); } } catch (Exception) { throw; } }
public List <Usuario> ConsultaUsuariosGestoresDAO() { try { List <Usuario> UsrList = new List <Usuario>(); SqlDataReader Dr = null; using (SqlConnection Con = new Conexao().ConexaoDB()) { SqlCommand CmdUsrs = new SqlCommand(@" SELECT * FROM Usuario Usr INNER JOIN UsuarioXMemberShipUser UsrMb ON (Usr.idUsuario = UsrMb.idUsuario) INNER JOIN aspnet_UsersInRoles UsrRoles ON (UsrMb.IdUsrMemberShip = UsrRoles.UserId) INNER JOIN aspnet_Users UsrUsers ON (UsrMb.IdUsrMemberShip = UsrUsers.UserId) WHERE UsrRoles.RoleId IN ('6A0BD300-3942-49E5-8307-F0DBC1591186') and Usr.idEmpresa = @Empresa;" , Con); CmdUsrs.Parameters.AddWithValue("@Empresa", InfoGlobal.GlobalIdEmpresa); Dr = CmdUsrs.ExecuteReader(); while (Dr.Read()) { Usuario Usr = FactoryUsuario.GetNew(TipoUsuario.UsuarioFuncionario); Usr.Id = Dr.GetInt32(0); Usr.Nome = Dr.GetString(1); Usr.Endereco = Dr.GetString(2); Usr.Complemento = Dr.GetString(3); Usr.Cep = Dr.GetString(4); Usr.Telefone = Dr.GetString(5); UsrList.Add(Usr); } return(UsrList); } } catch (SqlException) { throw; } }
public bool ReabreChamado() { try { ObjAtend.IdChamado = ObjChamado.Id; ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.Usuario); ObjUsuario.Id = ObjAtend.IdTecnico; ObjUsuario.IdStatus = 2; if (new ManterChamadoDAO(ObjChamado).ReabreChamadoDAO() && new ManterAtendimento(ObjAtend).CadastraAtendimentoReaberturaChamado() && new ManterUsuario(ObjUsuario).AlteraDisponibilidade()) { return(true); } else { return(false); } } catch (Exception) { throw; } }
public bool IniciaAtendimento() { try { ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.UsuarioFuncionario); ObjUsuario.Id = ObjAtend.IdTecnico; ObjUsuario.IdStatus = 2; if (new ManterAtendimentoDAO(ObjAtend).IniciaAtendimentoDAO() && new ManterUsuario(ObjUsuario).AlteraDisponibilidade()) { ObjChamado = FactoryChamado.GetNew(); ObjChamado.Id = ObjAtend.IdChamado; ObjChamado = new ManterChamado(ObjChamado).ConsultaChamadoById(); ObjAtend.IdCliente = ObjChamado.IdCliente; ObjNotificacao.IdOrigem = 0; ObjNotificacao.IdDest = ObjAtend.IdTecnico; ObjNotificacao.IdMensagem = 4; ObjNotificacao.IdTipo = 4; ObjNotificacao.IdChamado = ObjAtend.IdChamado; new ManterNotificacao(ObjNotificacao).NotificaUsuariosSistem(); ObjNotificacao.IdDest = ObjAtend.IdCliente; new ManterNotificacao(ObjNotificacao).NotificaUsuariosSistem(); return(true); } else { return(false); } } catch (Exception) { throw; } }
/// <summary> /// Se encarga de obtener el usuario por medio de su correo /// </summary> ///<param name="correo">EL correo único del usuario</param> ///<returns>Un objeto de tipo Usuario</returns> public static Usuario SeleccionarPorCorreo(string correo) { using (IDataBase db = FactoryDatabase.CreateDefaultDataBase()) { SqlCommand comando = new SqlCommand(); comando.CommandType = System.Data.CommandType.StoredProcedure; comando.CommandText = "PA_SeleccionarUsuarioPorCorreo"; comando.Parameters.AddWithValue("@correo", correo); DataSet ds = db.ExecuteDataSet(comando); foreach (DataRow dr in ds.Tables[0].Rows) { Usuario usuario = null; // Si el usuario está inactivo, retorna null if ((dr["ACTIVO"].ToString().ToLower().Equals("inactivo"))) { break; } // Se construye el usuario dependiendo de su tipo FactoryUsuario fu = new FactoryUsuario(); usuario = fu.CrearUsuario(SeleccionarTipoUsuarioPorID((int)dr["TIPO_USUARIO_ID"])); // Se agregan las propiedades única de cada usuario if (usuario is Cliente) { (usuario as Cliente).Apellidos = dr["APELLIDOS"].ToString(); } if (usuario is Repartidor) { (usuario as Repartidor).PuntajeTotal = PuntajeTotal((int)dr["USUARIO_ID"]); (usuario as Repartidor).Apellidos = dr["APELLIDOS"].ToString(); (usuario as Repartidor)._Transporte = TransporteDB.SeleccionarTransportePorID((int)dr["TRANSPORTE_ID"]); (usuario as Repartidor).ListaCalificacion = CalificacionDB.ObtenerCalificacionesPorIDUsuario((int)dr["USUARIO_ID"]); } if (usuario is Negocio) { (usuario as Negocio).PuntajeTotal = PuntajeTotal((int)dr["USUARIO_ID"]); (usuario as Negocio).ListaCalificacion = CalificacionDB.ObtenerCalificacionesPorIDUsuario((int)dr["USUARIO_ID"]); (usuario as Negocio).ListaProductos = ArticuloDB.ObtenerArticulosPorIDUsuario((int)dr["USUARIO_ID"]); } if (usuario is Admin) { (usuario as Admin).Id = (int)dr["USUARIO_ID"]; (usuario as Admin).Cedula = dr["CEDULA"].ToString(); (usuario as Admin).Nombre = dr["NOMBRE_USUARIO"].ToString(); (usuario as Admin).Correo = dr["CORREO_ELECTRONICO"].ToString(); (usuario as Admin).Contrasenna = usuario.Contrasenna = dr["CONTRASENNA"].ToString(); (usuario as Admin).Activo = (dr["ACTIVO"].ToString().ToLower().Equals("activo")); return(usuario); } // Se agregan las propiedades generales de un usuario usuario.Id = (int)dr["USUARIO_ID"]; usuario.Cedula = dr["CEDULA"].ToString(); usuario.Nombre = dr["NOMBRE_USUARIO"].ToString(); usuario.NumeroTelefono = dr["NUMERO_TELEFONO"].ToString(); usuario._Direccion = DireccionDB.SeleccionarPorID((int)dr["DIRECCION_ID"]); usuario.Correo = dr["CORREO_ELECTRONICO"].ToString(); usuario.Contrasenna = dr["CONTRASENNA"].ToString(); usuario._Tarjeta = TarjetaDB.SeleccionarPorID((int)dr["TARJETA_CREDITO_ID"]); usuario.Activo = (dr["ACTIVO"].ToString().ToLower().Equals("activo")); return(usuario); } } return(null); }
public static Usuario ValidarYObtenerUsuario(string user, string password) { FactoryUsuario nuevoUsuario = new FactoryUsuario(); Usuario nuevo = nuevoUsuario.GetUsuario(user, password); return nuevo; }
protected void BotaoCriarUsuario_OnClick(object sender, EventArgs e) { try { if (DropDownListTipo.Text.Equals("Administrador")) { ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.Usuario); ValidaInfo = true; } else if (DropDownListTipo.Text.Equals("Técnico") && DropDownListEspec.SelectedIndex > 0 && DropDownListArea.SelectedIndex > 0) { ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.UsuarioFuncionario); ObjUsuario.ObjEspec.Id = Convert.ToInt32(DropDownListEspec.SelectedValue); ValidaInfo = true; if (!IdEmpresa.Equals(0) || !IdEmpresa.Equals(null)) { ObjUsuario.IdEmpresa = (int)(Session["idEmpresa"]); } else { ObjUsuario.IdEmpresa = Convert.ToInt32(DropDownListEmpresa.SelectedValue); } } else if (DropDownListTipo.Text.Equals("Gestor") || DropDownListTipo.Text.Equals("Atendente")) { ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.UsuarioFuncionario); ValidaInfo = true; if (!IdEmpresa.Equals(0) || !IdEmpresa.Equals(null)) { ObjUsuario.IdEmpresa = (int)(Session["idEmpresa"]); } else { ObjUsuario.IdEmpresa = Convert.ToInt32(DropDownListEmpresa.SelectedValue); } } else if (DropDownListTipo.Text.Equals("Cliente Físico") && DropDownListArea.SelectedIndex > 0) { ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.UsuarioClienteFisico); ObjUsuario.ObjCF.DocIdent = Doc.Value; ObjUsuario.ObjCF.OrgEmiss = EmissDoc.Value; CPFValido = ValidaDocumento.ValidaCPF(CPF.Value); if (CPFValido) { ObjUsuario.ObjCF.Cpf = CPF.Value; ValidaInfo = true; } else { CNPJValido = true; ValidaInfo = false; } } else if (DropDownListTipo.Text.Equals("Cliente Jurídico") && DropDownListArea.SelectedIndex > 0) { ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.UsuarioClienteJuridico); CNPJValido = ValidaDocumento.ValidaCNPJ(CNPJ.Value); if (CNPJValido) { ObjUsuario.ObjCJ.Cnpj = CNPJ.Value; ValidaInfo = true; } else { CPFValido = true; ValidaInfo = false; } } else { ValidaInfo = false; } if (ValidaInfo) { ObjUsuario.Login = UserName.Value; ObjUsuario.Senha = Password.Value; ObjUsuario.Email = Email.Value; ObjUsuario.Regra = DropDownListTipo.SelectedValue; ObjUsuario.Nome = Nome.Value; ObjUsuario.Endereco = ValidaCEP.GetCEPCorreios(CEP.Value, Complemento.Value); ObjUsuario.Complemento = Complemento.Value; ObjUsuario.Cep = CEP.Value; ObjUsuario.Telefone = Telefone.Value; ObjUsuario.ObjRegiao.Id = Convert.ToInt32(DropDownListArea.SelectedValue); if (ObjUsuario.Endereco != null) { Mensagem = new ManterUsuario(ObjUsuario).CadastraUsuario(); if (Mensagem.Equals("Usuário cadastrado com sucesso!")) { Endereco.Disabled = false; Endereco.Value = ObjUsuario.Endereco; ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true); } } else { Mensagem = "CEP inválido ou incorreto. Favor verificar."; ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true); } } else { if (!CPFValido) { Mensagem = "O CPF é invalido. Favor verificar."; ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true); } else if (!CNPJValido) { Mensagem = "O CNPJ é invalido. Favor verificar."; ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true); } else { Mensagem = "Informações obrigatórias não preenchidas."; ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true); } } } catch (Exception Ex) { LogException.InsereLogBd(Ex); MsgLabel.Text = LogException.CodigoErroBd(); } }
public List <Usuario> ConsultaUsuariosByPerfilDAO(List <string> Perfil) { try { List <Usuario> UsrList = new List <Usuario>(); SqlDataReader Dr = null; using (SqlConnection Con = new Conexao().ConexaoDB()) { foreach (var P in Perfil) { SqlCommand Cmd = new SqlCommand(@" SELECT * FROM Usuario Usr INNER JOIN UsuarioXMemberShipUser UsrMb ON (Usr.idUsuario = UsrMb.idUsuario) INNER JOIN aspnet_UsersInRoles UsrRoles ON (UsrMb.IdUsrMemberShip = UsrRoles.UserId) INNER JOIN aspnet_Users UsrUsers ON (UsrMb.IdUsrMemberShip = UsrUsers.UserId) WHERE UsrRoles.RoleId in (@IdRole1, @IdRole2) and Usr.idEmpresa = @Empresa", Con); Cmd.Parameters.AddWithValue("@Empresa", InfoGlobal.GlobalIdEmpresa); switch (P) { case "Administrador": Cmd.Parameters.AddWithValue("@IdRole1", "6829B283-EC4D-4ACB-AC7C-B1FA61C71F58"); Cmd.Parameters.AddWithValue("@IdRole2", "00000000-0000-0000-0000-000000000000"); break; case "Cliente": Cmd.Parameters.AddWithValue("@IdRole1", "77DAA669-C0F6-4D2F-8B3A-AD4ACCBF8D1E"); Cmd.Parameters.AddWithValue("@IdRole2", "7EDC0ACD-F32C-4946-9BD0-889742053030"); break; case "Gestor": Cmd.Parameters.AddWithValue("@IdRole1", "6A0BD300-3942-49E5-8307-F0DBC1591186"); Cmd.Parameters.AddWithValue("@IdRole2", "00000000-0000-0000-0000-000000000000"); break; case "Técnico": Cmd.Parameters.AddWithValue("@IdRole1", "5E106C37-3E4D-4B41-9EEE-F190EA99E534"); Cmd.Parameters.AddWithValue("@IdRole2", "00000000-0000-0000-0000-000000000000"); break; case "Atendente": Cmd.Parameters.AddWithValue("@IdRole1", "4355C114-EAF9-4B05-B6D2-3CB47FFAE948"); Cmd.Parameters.AddWithValue("@IdRole2", "00000000-0000-0000-0000-000000000000"); break; case "Cliente Físico": Cmd.Parameters.AddWithValue("@IdRole1", "77DAA669-C0F6-4D2F-8B3A-AD4ACCBF8D1E"); Cmd.Parameters.AddWithValue("@IdRole2", "00000000-0000-0000-0000-000000000000"); break; case "Cliente Jurídico": Cmd.Parameters.AddWithValue("@IdRole1", "7EDC0ACD-F32C-4946-9BD0-889742053030"); Cmd.Parameters.AddWithValue("@IdRole2", "00000000-0000-0000-0000-000000000000"); break; } Dr = Cmd.ExecuteReader(); while (Dr.Read()) { Usuario Usr = FactoryUsuario.GetNew(TipoUsuario.Usuario); Usr.Id = Dr.GetInt32(0); Usr.Nome = Dr.GetString(1); Usr.Endereco = Dr.GetString(2); Usr.Complemento = Dr.GetString(3); Usr.Cep = Dr.GetString(4); Usr.Telefone = Dr.GetString(5); Usr.Regra = GetRegraUserDAO(Usr.Id); Usr.IdMS = Dr.GetGuid(15).ToString(); Usr.Login = Dr.GetString(16); UsrList.Add(Usr); } Dr.Close(); } return(UsrList); } } catch (SqlException) { throw; } }