public void CarregarGridviewUsuarios(bool bSomenteAtivo, GridView grdDados) { usuarioBLL BUsuario = new usuarioBLL(); DataTable dataTable = BUsuario.RetornarUsuarios(bSomenteAtivo); grdDados.DataSource = dataTable; grdDados.DataBind(); }
private void Btn_listartodos_Click(object sender, RoutedEventArgs e) { cbb_listarusuarios.SelectedIndex = -1; txt_rut.Text = ""; usuarioBLL ub = new usuarioBLL(); System.Data.DataTable dt = ub.AllUserList(); dtg_Usuarios.ItemsSource = dt.DefaultView; lb1.Content = ""; }
private void btnEntrar_Click(object sender, EventArgs e) { dtovar.login = txtUser.Text; dtovar.senha = txtSenha.Text; try { List <usuarioDTO> ListDto = new List <usuarioDTO>(); ListDto = new usuarioBLL().validar(dtovar); if (ListDto.Count > 0) { information.id = dtovar.id; information.nome = dtovar.nome; information.foto = dtovar.foto; information.aula = dtovar.aula; information.tipo = dtovar.tipo; if (dtovar.tipo == 1) { frmPerfilProf prof = new frmPerfilProf(); prof.Show(); this.Hide(); } else if (dtovar.tipo == 2) { frmPerfilTec prof = new frmPerfilTec(); prof.Show(); this.Hide(); } else { frmPerfilAdm prof = new frmPerfilAdm(); prof.Show(); this.Hide(); } } else { MessageBox.Show("Usuário, senha ou incorretos", "Erro de autenticação", MessageBoxButtons.OK, MessageBoxIcon.Error); txtUser.Focus(); return; } } catch (Exception erro) { MessageBox.Show("Falha de conexão, entre em contato com o T.I.\n", "Falha de conexão", MessageBoxButtons.OK, MessageBoxIcon.Error); txtUser.Focus(); } }
private void Btn_ingresar_Click(object sender, RoutedEventArgs e) { if (rbClienteNuevo.IsChecked == true) { if (MessageBox.Show("Ingresar Cliente " + txt_nombre.Text + " " + "a mesa " + cbox_cantidad.SelectedValue + "?", "Seguro?", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { usuarioBLL usrBLL = new usuarioBLL(); int rut = int.Parse(txt_rut.Text); string nombre = txt_nombre.Text; string apellido = txt_apellido.Text; string email = txt_email.Text; bool status = usrBLL.CreateCliente(rut, nombre, apellido, email); if (status) { BoletaBLL bolBLL = new BoletaBLL(); int id_mesa = int.Parse(cbox_cantidad.SelectedValue.ToString()); int id_garzon = int.Parse(cbGarzon.SelectedValue.ToString()); if (bolBLL.insertBoleta(id_mesa, id_garzon, rut)) { MessageBox.Show("Asignacion Ingresada Correctamente"); } else { MessageBox.Show("El Cliente Fue ingresado, Pero ocurrio un error al ingresar la asignacion de mesa"); } } else { MessageBox.Show("Ocurrio un error al ingresar el cliente"); } } loadGarzones(); } else if (rbClienteRegistrado.IsChecked == true) { BoletaBLL bolBLL = new BoletaBLL(); int id_mesa = int.Parse(cbox_cantidad.SelectedValue.ToString()); int id_garzon = int.Parse(cbGarzon.SelectedValue.ToString()); int rut = int.Parse(txt_rut.Text); if (bolBLL.insertBoleta(id_mesa, id_garzon, rut)) { MessageBox.Show("Asignacion Ingresada Correctamente"); } else { MessageBox.Show("Ocurrio un error al ingresar la asignacion de mesa"); } } }
private void loadGarzones() { MesaBLL mesabll = new MesaBLL(); dtgMesas.ItemsSource = mesabll.getmesasvacias().DefaultView; cbox_cantidad.ItemsSource = mesabll.getmesasvacias().DefaultView; cbox_cantidad.DisplayMemberPath = "ID_MESA"; cbox_cantidad.SelectedValuePath = "ID_MESA"; usuarioBLL usrBLL = new usuarioBLL(); cbGarzon.ItemsSource = usrBLL.getGarzones().DefaultView; cbGarzon.DisplayMemberPath = "Nombre"; cbGarzon.SelectedValuePath = "ID_USER"; }
private void loadGrid() { try { List <usuarioDTO> listUsuarioDTO = new List <usuarioDTO>(); listUsuarioDTO = new usuarioBLL().loadUser(); grdUser.AutoGenerateColumns = false; grdUser.DataSource = listUsuarioDTO; log.Info("Dados de usuários carregados"); } catch (Exception ex) { MessageBox.Show("Erro ao carregar dados de usuários.\n" + Environment.NewLine + ex.Message, "Erro!", MessageBoxButtons.OK, MessageBoxIcon.Error); log.Error(ex); } }
private void btn_aceptar_Click(object sender, RoutedEventArgs e) { usuarioBLL usrbll = new usuarioBLL(); bool check = usrbll.getLogin(txt_nombreusuario.Text, txtPass.Password.ToString()); if (check) { MessageBox.Show("Bienvenido " + txt_nombreusuario.Text); MenuRecepcion mrecep = new MenuRecepcion(); Close(); mrecep.Show(); } else { MessageBox.Show("Credenciales o Rol Incorrectos \n Intente nuevamente"); } }
private void btnBuscar_Click(object sender, RoutedEventArgs e) { usuarioBLL ub = new usuarioBLL(); if (rbtIngredientes.IsChecked == true) { ingredienteBLL ib = new ingredienteBLL(); System.Data.DataTable dt = ib.GetAllIngredientes(); dgListado.ItemsSource = dt.DefaultView; } else if (rbtBebestibles.IsChecked == true) { bebestibleBLL ib = new bebestibleBLL(); System.Data.DataTable dt = ib.Get_allbebest(); dgListado.ItemsSource = dt.DefaultView; } }
private void carregaGrid() { dgvAltera.AutoGenerateColumns = false; try { List <usuarioDTO> ListDto = new List <usuarioDTO>(); ListDto = new usuarioBLL().listaUsuario(); dgvAltera.DataSource = ListDto; CurrencyManager cm = (CurrencyManager)BindingContext[dgvAltera.DataSource]; cm.EndCurrentEdit(); cm.ResumeBinding(); cm.SuspendBinding(); foreach (DataGridViewRow row in dgvAltera.Rows) { if (Convert.ToInt32(row.Cells["tipo"].Value) == 1) { row.Cells["teste"].Value = Convert.ToString("Professor"); } else if (Convert.ToInt32(row.Cells["tipo"].Value) == 2) { row.Cells["teste"].Value = Convert.ToString("Técnico"); } else { row.Visible = false; } } } catch (Exception erro) { throw erro; } mktxtRG.ForeColor = Color.Black; }
private void carregaGrid() { try { btnGravar.Enabled = false; btnCancel.Enabled = false; List <usuarioDTO> listUsuarioDTO = new List <usuarioDTO>(); listUsuarioDTO = new usuarioBLL().cargaUsuario(); grdUsuario.AutoGenerateColumns = false; grdUsuario.DataSource = listUsuarioDTO; txtNome.Text = Convert.ToString(grdUsuario.SelectedRows[0].Cells[0].Value); txtLogin.Text = Convert.ToString(grdUsuario.SelectedRows[0].Cells[1].Value); txtEmail.Text = Convert.ToString(grdUsuario.SelectedRows[0].Cells[2].Value); txtSenha.Text = Convert.ToString(grdUsuario.SelectedRows[0].Cells[3].Value); dtpCadastro.Text = Convert.ToString(grdUsuario.SelectedRows[0].Cells[4].Value); cmbSit.Text = Convert.ToString(grdUsuario.SelectedRows[0].Cells[6].Value); cmbPerfil.Text = Convert.ToString(grdUsuario.SelectedRows[0].Cells[5].Value); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public string CadastrarUsuario(usuario Usuario, int iIDUsuarioCadastro) { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.CadastrarUsuario(Usuario, iIDUsuarioCadastro)); }
public void ExcluirUsuarioCampanhas(int iIDUsuario) { usuarioBLL BUsuario = new usuarioBLL(); BUsuario.ExcluirUsuarioCampanhas(iIDUsuario); }
public void EditarUsuario(usuario Usuario) { usuarioBLL BUsuario = new usuarioBLL(); BUsuario.EditarUsuario(Usuario); }
public string RetornarSenha(int iIDUsuario) { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.RetornarSenha(iIDUsuario)); }
public DataTable RetornarUsuarios(bool bSomenteAtivo) { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.RetornarUsuarios(bSomenteAtivo)); }
public void PausaAgente(int iIDUsuario, int iPausaAgente) { usuarioBLL BUsuario = new usuarioBLL(); BUsuario.PausaAgente(iIDUsuario, iPausaAgente); }
private void Button_Click(object sender, RoutedEventArgs e) { usuarioBLL ub = new usuarioBLL(); bool nombre = true; bool apellido = true; bool rut = true; bool rol = true; bool fono = true; bool direccion = true; bool clave = true; bool estado = true; if (coc.IsSelected || bart.IsSelected || Admin.IsSelected || Gar.IsSelected || fina.IsSelected || caja.IsSelected || bodega.IsSelected) { rol = true; } else { rol = false; lb2.Content = "Ingrese un rol"; } if (txt_Contrasena.Text == "") { clave = false; lb7.Content = "Ingrese una contraseña"; } if (txt_apellido.Text == "") { nombre = false; lb4.Content = "Ingrese un apellido"; } if (txt_nombre.Text == "") { apellido = false; lb3.Content = "Ingrese un nombre"; } if (txt_rut.Text == "") { rut = false; lb1.Content = "Ingrese un rut"; } if (txt_direccion.Text == "") { direccion = false; lb6.Content = "Ingrese una dirección"; } if (txt_fono.Text == "") { fono = false; lb5.Content = "Ingrese un número"; } if (clave == true && nombre == true && rut == true && apellido == true && rol == true && fono == true && direccion == true && estado == true) { bool existe = ub.GetUserByRut(Int32.Parse(txt_rut.Text)); if (existe) { if (existe == true) { ub.id_usuario = Int32.Parse(txt_rut.Text); } string roll = ""; if (coc.IsSelected) { roll = "Cocinero"; } else if (bart.IsSelected) { roll = "Bartender"; } else if (Gar.IsSelected) { roll = "Garzón"; } else if (fina.IsSelected) { roll = "Finanzas"; } else if (Admin.IsSelected) { roll = "Administrador"; } else if (caja.IsSelected) { roll = "caja"; } else if (bodega.IsSelected) { roll = "Bodeguero"; } else { lb2.Content = "Debe seleccionar un rol"; } ub.rol = roll; ub.nom_usuario = txt_nombre.Text; ub.apellido_usuario = txt_apellido.Text; ub.fono = Int32.Parse(txt_fono.Text); ub.direccion = txt_direccion.Text; ub.rut = Int32.Parse(txt_rut.Text); ub.clave = txt_Contrasena.Text; string[] partesnom = txt_nombre.Text.Split(' '); string[] partesape = txt_apellido.Text.Split(' '); string primera = partesnom[0]; string segunda = partesape[0]; string nick = (primera + "." + segunda).ToString(); bool nickexist = ub.Getnick(nick); string namefinal = ""; if (nickexist) { namefinal = nick; } else { namefinal = nick; } string habilitado = ""; if (rdb_habilitar.IsChecked == true) { habilitado = "Si"; } else { habilitado = lb_estado.Content.ToString(); } int rutt = Int32.Parse(txt_rut.Text); string nom = namefinal; string pass = txt_Contrasena.Text; ub.AlterInfoUser(ub); ub.AlterUser(rutt, namefinal, roll, pass, habilitado); PopupNotifier popup = new PopupNotifier(); popup.TitleText = "Aviso"; popup.Image = Properties.Resources.add; popup.ContentText = "El usuario con RUT: " + txt_rut.Text + " Fue modificado de forma exitosa"; popup.AnimationDuration = 1000; popup.Delay = 1500; popup.Popup(); txt_rut.Text = ""; txt_nombre.Text = ""; txt_apellido.Text = ""; cbb_rol.SelectedIndex = -1; txt_fono.Text = ""; txt_direccion.Text = ""; txt_Contrasena.Text = ""; rdb_habilitar.IsEnabled = false; txt_nombre.IsEnabled = false; txt_apellido.IsEnabled = false; cbb_rol.IsEnabled = false; txt_fono.IsEnabled = false; txt_direccion.IsEnabled = false; txt_Contrasena.IsEnabled = false; rdb_habilitar.IsChecked = false; } else { lb1.Content = "Este rut no está registrado en el sistema"; } } else { } }
public void AtualizarNroAgente(int iIDUsuario, int iNroAgente) { usuarioBLL BUsuario = new usuarioBLL(); BUsuario.AtualizarNroAgente(iIDUsuario, iNroAgente); }
public DataTable RetornarCampanhasUsuario(int iIDUsuario) { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.RetornarCampanhasUsuario(iIDUsuario)); }
public int RetornarClientAtivos() { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.RetornarClientAtivos()); }
public int RetornarUsuario(string sLogin, string sSenha, int iAtivo) { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.RetornarUsuario(sLogin, sSenha, iAtivo)); }
public void TabulareLogado(int iIDUsuario, int iTabulareLogado) { usuarioBLL BUsuario = new usuarioBLL(); BUsuario.TabulareLogado(iIDUsuario, iTabulareLogado); }
public void CadastrarUsuarioCampanhas(int iIDUsuario, int iIDCampanha) { usuarioBLL BUsuario = new usuarioBLL(); BUsuario.CadastrarUsuarioCampanhas(iIDUsuario, iIDCampanha); }
public usuario RetornarUsuario(string sLogin, string sSenha, string sRamal) { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.RetornarUsuario(sLogin, sSenha, sRamal)); }
private void Btn_suser_Click(object sender, RoutedEventArgs e) { usuarioBLL us = new usuarioBLL(); if (txt_rut.Text == "") { lb1.Content = "Debe ingresar un rut para buscar"; } else if (txt_rut.Text != "") { bool existe = us.GetUserByRut(Int32.Parse(txt_rut.Text)); if (existe == true) { int rut = Int32.Parse(txt_rut.Text); DataTable da = us.userList(rut); DataRow row = da.Rows[0]; txt_nombre.Text = row[1].ToString(); txt_apellido.Text = row[2].ToString(); string estado = row[3].ToString(); string rol = row[4].ToString(); if (rol == "Cocinero") { coc.IsSelected = true; } else if (rol == "Bartender") { bart.IsSelected = true; } else if (rol == "Garzón") { Gar.IsSelected = true; } else if (rol == "Finanzas") { fina.IsSelected = true; } else if (rol == "Administrador") { Admin.IsSelected = true; } else if (rol == "caja") { caja.IsSelected = true; } else if (rol == "Bodeguero") { bodega.IsSelected = true; } else { } txt_fono.Text = row[5].ToString(); txt_direccion.Text = row[6].ToString(); txt_Contrasena.Text = row[8].ToString(); if (estado == "No") { rdb_habilitar.IsEnabled = true; } else { lb_estado.Content = estado; } txt_nombre.IsEnabled = true; txt_apellido.IsEnabled = true; cbb_rol.IsEnabled = true; txt_fono.IsEnabled = true; txt_direccion.IsEnabled = true; txt_Contrasena.IsEnabled = true; } else { lb1.Content = "Este rut no está registrado en el sistema"; } } }
public bool VerificarExistenciaUsuario(string sLogin, int iIDUsuario) { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.VerificarExistenciaUsuario(sLogin, iIDUsuario)); }
public bool RetornarNroAgentesRepetidos(int iIDUsuario, int iNroAgente)//robson { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.RetornarNroAgentesRepetidos(iIDUsuario, iNroAgente)); }
public usuario RetornarUsuario(int iIDUsuario) { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.RetornarUsuario(iIDUsuario)); }
private void Btn_Confirmar_Click(object sender, RoutedEventArgs e) { usuarioBLL us = new usuarioBLL(); string act = ACCION.Content.ToString(); if (act == "eliminar") { int rut = Int32.Parse(lb_rut.Content.ToString()); lb_titulo.VerticalAlignment = VerticalAlignment.Center; us.rut = rut; us.DeleteUser(us); PopupNotifier popup = new PopupNotifier(); popup.TitleText = "Aviso"; popup.Image = Properties.Resources.delete; popup.ContentText = "Se ha Eliminado el usuario con rut: " + rut; popup.AnimationDuration = 800; popup.Delay = 1400; popup.Popup(); Close(); } else if (act == "eliminarprov") { ProveedorBLL pb = new ProveedorBLL(); int id = Int32.Parse(lb_rut.Content.ToString()); pb.deleteprov(id); PopupNotifier popup = new PopupNotifier(); popup.TitleText = "Aviso"; popup.Image = Properties.Resources.delete; popup.ContentText = "Se ha Eliminado el Proveedor con id: " + id; popup.AnimationDuration = 500; popup.Delay = 2500; popup.Popup(); Close(); } else if (act == "deletemesa") { MesaBLL mb = new MesaBLL(); int num = Int32.Parse(lb_rut.Content.ToString()); mb.DeleteMesa(num); PopupNotifier popup = new PopupNotifier(); popup.TitleText = "Aviso"; popup.Image = Properties.Resources.delete; popup.ContentText = "Se ha Eliminado la mesa número: " + num; popup.AnimationDuration = 500; popup.Delay = 2500; popup.Popup(); Close(); } else if (act == "Modificarbebi") { int id = Int32.Parse(lb_rut.Content.ToString()); BebestibleBLL bb = new BebestibleBLL(); lb_titulo.VerticalAlignment = VerticalAlignment.Center; PopupNotifier popup = new PopupNotifier(); popup.TitleText = "Aviso"; popup.Image = Properties.Resources.add; popup.ContentText = "Se ha Deshabilitado el bebestible con id: " + id; popup.AnimationDuration = 500; popup.Delay = 2000; popup.Popup(); bb.id_bebestible = id; bb.Alterinhabilitado(bb); Close(); } else if (act == "Modificaring") { int id = Int32.Parse(lb_rut.Content.ToString()); lb_titulo.VerticalAlignment = VerticalAlignment.Center; IngredienteBLL ib = new IngredienteBLL(); ib.id_ingrediente = id; PopupNotifier popup = new PopupNotifier(); popup.TitleText = "Aviso"; popup.Image = Properties.Resources.add; popup.ContentText = "Se ha Deshabilitado el ingrediente con id: " + id; popup.AnimationDuration = 500; popup.Delay = 2000; popup.Popup(); ib.Alterinhabilitadoing(ib); Close(); } else if (act == "deshabilitar") { PlatoBLL pb = new PlatoBLL(); pb.Id_plato = Int32.Parse(lb_rut.Content.ToString()); pb.DesPlato(pb); Close(); PopupNotifier popup = new PopupNotifier(); popup.TitleText = "Aviso"; popup.Image = Properties.Resources.delete; popup.ContentText = "Se ha Deshabilitado el plato con id: " + Int32.Parse(lb_rut.Content.ToString()); popup.AnimationDuration = 500; popup.Delay = 2000; popup.Popup(); Close(); } else if (act == "go_list") { ListarMesas lm = new ListarMesas(); lm.Owner = this; lm.rdb_todas.IsChecked = true; lm.ShowDialog(); Close(); } else { } }
public usuario RetornarUsuarioNet(string sEmail, string sSenha) { usuarioBLL BUsuario = new usuarioBLL(); return(BUsuario.RetornarUsuarioNet(sEmail, sSenha)); }