// GET: Operaciones
        public ActionResult Entrada(int operacion)
        {
            ViewBag.breadcrumb = "Catalogos/" + (operacion == 1 ? "Entrada de Inventario" : "Salida de inventario");
            ViewBag.pageheader = "Estado de Usuarios";
            ViewBag.Heading    = operacion == 1 ? "Entrada de Inventario" : "Salida de inventario";
            var model = new Operacion {
                IdTipoOperacion = operacion, Total = 0, CantProductos = 0, UsuarioCrea = Usuario.UserId, Estado = "ACT"
            };

            ViewBag.Clientes = new SelectList(clienteLogic.GetAll(), "IdCliente", "Nombre");
            return(PartialView(model));
        }
Exemple #2
0
        public ActionResult ClienteListar()
        {
            ViewBag.Heading = "Lista de Clientes";
            var Listado = clientelogic.GetAll();

            return(PartialView("_ClienteListar", Listado));
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            dgvUsuarios.DataSource = cliLog.GetAll();
            dgvUsuarios.DataBind();
            bool ban = Session.IsNewSession;

            Session["role"] = (ban) ? "" : Session["role"];
            try
            {
                if (!Session["role"].Equals("admin"))
                {
                    Response.Redirect("homepage.aspx");
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #4
0
        public override bool Validar()
        {
            // Los valores de los msgLabel son seteados en los eventos TextChanged de cada TextBox
            bool ban = false;

            msgNombre.Visible         = !String.IsNullOrEmpty(msgNombre.Text);
            msgApellido.Visible       = !String.IsNullOrEmpty(msgApellido.Text);
            msgUsuario.Visible        = !String.IsNullOrEmpty(msgUsuario.Text);
            msgEmail.Visible          = !String.IsNullOrEmpty(msgEmail.Text);
            msgClave.Visible          = !String.IsNullOrEmpty(msgClave.Text);
            msgConfirmarClave.Visible = !String.IsNullOrEmpty(msgConfirmarClave.Text);

            if (!msgNombre.Visible)
            {
                if (!msgApellido.Visible)
                {
                    if (!msgUsuario.Visible)
                    {
                        if (!msgEmail.Visible)
                        {
                            if (!msgClave.Visible)
                            {
                                if (!msgConfirmarClave.Visible)
                                {
                                    if (Modo == ModoForm.Baja)
                                    {
                                        ban = true;
                                        return(ban);
                                    }
                                    else
                                    {
                                        clientes cli = cliLog.GetOne(txtUsuario.Text);
                                        if (cli == null || Modo == ModoForm.Modificacion)
                                        {
                                            clientes[] clientes = cliLog.GetAll().ToArray();
                                            foreach (clientes c in clientes)
                                            {
                                                if (c.email != txtEmail.Text || c.email == cli.email)
                                                {
                                                    ban = true;
                                                }
                                                else
                                                {
                                                    msgEmail.Text    = "El email ingresado ya existe";
                                                    msgEmail.Visible = true;
                                                    ban = false;
                                                    break;
                                                }
                                            }
                                        }
                                        else if (Modo != ModoForm.Modificacion)
                                        {
                                            msgUsuario.Text    = "El nombre de usuario ingresado ya existe";
                                            msgUsuario.Visible = true;
                                        }
                                        else
                                        {
                                            ban = true;
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            msgEmail.Text = "Debe ingresar un email";
                        }
                    }
                    else
                    {
                        msgUsuario.Text = "Debe ingresar un nombre de usuario";
                    }
                }
            }
            return(ban);
        }
Exemple #5
0
        public void Listar()
        {
            ClienteLogic cliLog = new ClienteLogic();

            dgvClientes.DataSource = cliLog.GetAll();
        }