Esempio n. 1
0
        internal bool MtdGuardarProveedor(ClsEproveedor e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarProveedor";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("r", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("nom", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("dir", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("tel", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("cor", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
                command.Parameters["r"].Value   = e.Ruc;
                command.Parameters["nom"].Value = e.Nombre;
                command.Parameters["dir"].Value = e.Direccion;
                command.Parameters["tel"].Value = e.Telefono;
                command.Parameters["cor"].Value = e.Correo;
                command.Parameters["est"].Value = e.Estado;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 2
0
        internal bool MtdGuardarClienteDispositivo(string dni, ClsEdetallecomprobante en, DataTable ddisponibles)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarClienteDispositivo";
                command.Parameters.Add(new SqlParameter("dcli", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("lotser", SqlDbType.VarChar));
                for (int i = 0; i < en.Cantidad; i++)
                {
                    ClsEclientedispositivo En = new ClsEclientedispositivo();
                    En.Serie_dispositivo               = ddisponibles.Rows[i][0].ToString();
                    En.Dni_cliente                     = dni;
                    command.CommandType                = CommandType.StoredProcedure;
                    command.Parameters["dcli"].Value   = En.Dni_cliente;
                    command.Parameters["lotser"].Value = En.Serie_dispositivo;
                    command.ExecuteNonQuery();
                }
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 3
0
        internal bool MtdAgregarAlerta(ClsEalerta e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarAlerta";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("dni", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("lat", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("lon", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("fec", SqlDbType.Date));
                command.Parameters.Add(new SqlParameter("hor", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("turn", SqlDbType.Int));
                command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
                command.Parameters["dni"].Value  = e.Dni;
                command.Parameters["lat"].Value  = e.Latitud;
                command.Parameters["lon"].Value  = e.Longitud;
                command.Parameters["fec"].Value  = e.Fecha;
                command.Parameters["hor"].Value  = e.Hora;
                command.Parameters["turn"].Value = e.Turno;
                command.Parameters["est"].Value  = e.Estado;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 4
0
        internal bool MtdModificarCargo(ClsEcargo e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_U_ModificarCargo";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("id", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("des", SqlDbType.VarChar));
                command.Parameters["id"].Value  = e.Idcargo;
                command.Parameters["des"].Value = e.Descripcion;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 5
0
        internal bool MtdCambiarContraseña(string clave, string dni)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_U_CambiarClave";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("d", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("cla", SqlDbType.VarChar));
                command.Parameters["d"].Value   = dni;
                command.Parameters["cla"].Value = clave;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 6
0
        internal bool MtdDesactivarDispositivos(DataTable ddisponibles, ClsEdetallecomprobante ed)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = "USP_U_ModificarEstadoDispositivo";
                command.Parameters.Add(new SqlParameter("lotser", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
                for (int i = 0; i < ed.Cantidad; i++)
                {
                    command.Parameters["lotser"].Value = ddisponibles.Rows[i][0].ToString();
                    command.Parameters["est"].Value    = "0";
                    command.ExecuteNonQuery();
                }
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 7
0
        internal bool MtdGuardarDispositivo(ClsElote en)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarDispositivo";
                command.Parameters.Add(new SqlParameter("lotser", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("lot", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
                for (int i = 1; i <= en.Cantidad; i++)
                {
                    ClsEdispositivo En = new ClsEdispositivo();
                    En.Serie            = MtdCalcularSerieDispositivo(en.Codigo, i);
                    En.Lote             = en.Codigo;
                    En.Estado           = "1";
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters["lotser"].Value = En.Serie;
                    command.Parameters["lot"].Value    = En.Lote;
                    command.Parameters["est"].Value    = En.Estado;
                    command.ExecuteNonQuery();
                }
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 8
0
        internal void MtdAgregarKardex(ClsEkardex objEKardex, string descripcion)
        {
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     command     = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            command.Connection  = objConexion.Conectar();
            command.CommandText = "USP_I_AgregarKardex";
            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add(new SqlParameter("lot", SqlDbType.VarChar));
            command.Parameters.Add(new SqlParameter("demp", SqlDbType.VarChar));
            command.Parameters.Add(new SqlParameter("desc", SqlDbType.VarChar));
            command.Parameters.Add(new SqlParameter("cant", SqlDbType.Int));
            command.Parameters.Add(new SqlParameter("prec", SqlDbType.Decimal));
            command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
            command.Parameters.Add(new SqlParameter("hor", SqlDbType.VarChar));
            command.Parameters.Add(new SqlParameter("fech", SqlDbType.Date));
            command.Parameters["lot"].Value  = objEKardex.Codlote;
            command.Parameters["demp"].Value = objEKardex.DniEmpleado;
            command.Parameters["desc"].Value = descripcion;
            command.Parameters["cant"].Value = objEKardex.Cantidad;
            command.Parameters["prec"].Value = objEKardex.PrecioUnitario;
            command.Parameters["est"].Value  = objEKardex.Estado;
            command.Parameters["hor"].Value  = objEKardex.Hora;
            command.Parameters["fech"].Value = objEKardex.Fecha;
            command.ExecuteNonQuery();
            command.Connection = objConexion.Desconectar();
        }
Esempio n. 9
0
        internal void MtdCerrarSesion(string usuario)
        {
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_D_EliminarSesion";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("usu", SqlDbType.VarChar));
            objComando.Parameters["usu"].Value = usuario;

            objComando.ExecuteNonQuery();
            objComando.Connection = objConexion.Desconectar();
        }
Esempio n. 10
0
        internal void MtdDecrementarLote(ClsElote en)
        {
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_U_DecrementarCantidad";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("cod", SqlDbType.VarChar));
            objComando.Parameters.Add(new SqlParameter("can", SqlDbType.Int));
            objComando.Parameters["cod"].Value = en.Codigo;
            objComando.Parameters["can"].Value = en.Cantidad;
            objComando.ExecuteNonQuery();
            objComando.Connection = objConexion.Desconectar();
        }
        internal DataTable MtdListarReportesTrimestre()
        {
            ClsConexionSQL conn    = new ClsConexionSQL();
            DataTable      result  = new DataTable();
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.Conectar();
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "USP_S_ListarVentaDeEmpleadosPorTrimestre";
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(result);
            command.Connection = conn.Desconectar();
            return(result);
        }
Esempio n. 12
0
        internal DataTable MtdListarReportesAnual()
        {
            ClsConexionSQL conn    = new ClsConexionSQL();
            DataTable      result  = new DataTable();
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.Conectar();
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "USP_S_ListarProductosVendidosAnual";
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(result);
            command.Connection = conn.Desconectar();
            return(result);
        }
Esempio n. 13
0
        internal DataTable MtdListarIncidencias()
        {
            ClsConexionSQL conn    = new ClsConexionSQL();
            DataTable      result  = new DataTable();
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.Conectar();
            command.CommandText = "USP_S_ListarAlerta";
            command.CommandType = CommandType.StoredProcedure;
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(result);
            command.Connection = conn.Desconectar();
            return(result);
        }
Esempio n. 14
0
        internal object MtdFiltrarCargos(string filtro)
        {
            ClsConexionSQL conn    = new ClsConexionSQL();
            DataTable      result  = new DataTable();
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.Conectar();
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "USP_S_FiltrarCargo";
            command.Parameters.Add(new SqlParameter("fil", SqlDbType.VarChar));
            command.Parameters["fil"].Value = filtro;
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(result);
            command.Connection = conn.Desconectar();
            return(result);
        }
Esempio n. 15
0
        internal DataTable MtdBusquedaCargo(string cargo)
        {
            ClsConexionSQL conn    = new ClsConexionSQL();
            DataTable      result  = new DataTable();
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.Conectar();
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "USP_S_BusquedaCargo";
            command.Parameters.Add(new SqlParameter("id", SqlDbType.VarChar));
            command.Parameters["id"].Value = cargo;
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(result);
            command.Connection = conn.Desconectar();
            return(result);
        }
Esempio n. 16
0
        internal DataTable MtdListarDisponibles(ClsEdetallecomprobante ed)
        {
            ClsConexionSQL conn    = new ClsConexionSQL();
            DataTable      result  = new DataTable();
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.Conectar();
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "USP_S_ListarDispositivosDisponibles";
            command.Parameters.Add(new SqlParameter("lot", SqlDbType.VarChar));
            command.Parameters["lot"].Value = ed.Codigo;
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(result);
            command.Connection = conn.Desconectar();
            return(result);
        }
Esempio n. 17
0
        internal object MtdListarMisAlertas(string dni)
        {
            ClsConexionSQL conn    = new ClsConexionSQL();
            DataTable      result  = new DataTable();
            SqlDataAdapter adapter = new SqlDataAdapter();
            SqlCommand     command = new SqlCommand();

            command.Connection  = conn.Conectar();
            command.CommandText = "USP_S_ListarAlertas";
            command.CommandType = CommandType.StoredProcedure;
            command.Parameters.Add(new SqlParameter("dni", SqlDbType.VarChar));
            command.Parameters["dni"].Value = dni;
            command.ExecuteNonQuery();
            adapter.SelectCommand = command;
            adapter.Fill(result);
            command.Connection = conn.Desconectar();
            return(result);
        }
Esempio n. 18
0
        internal Boolean MtdGuardarEmpleado(ClsEempleado e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarEmpleado";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("d", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("nom", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("ape", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("dir", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("cor", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("tel", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("car", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("tur", SqlDbType.Int));
                command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("usu", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("con", SqlDbType.VarChar));
                command.Parameters["d"].Value   = e.Dni;
                command.Parameters["nom"].Value = e.Nombres;
                command.Parameters["ape"].Value = e.Apellidos;
                command.Parameters["dir"].Value = e.Direccion;
                command.Parameters["cor"].Value = e.Correo;
                command.Parameters["tel"].Value = e.Telefono;
                command.Parameters["car"].Value = e.Cargo;
                command.Parameters["tur"].Value = e.Turno;
                command.Parameters["est"].Value = e.Estado;
                command.Parameters["usu"].Value = e.Usuario;
                command.Parameters["con"].Value = e.Contraseña;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 19
0
        internal Boolean MtdAgregarLote(ClsElote e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarLote";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("cod", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("nom", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("col", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("pro", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("so", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("can", SqlDbType.Int));
                command.Parameters.Add(new SqlParameter("pre", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("for", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("mem", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("pes", SqlDbType.Decimal));
                command.Parameters["cod"].Value = e.Codigo;
                command.Parameters["nom"].Value = e.Nombre;
                command.Parameters["col"].Value = e.Color;
                command.Parameters["pro"].Value = e.Proveedor;
                command.Parameters["so"].Value  = e.SistemaOperativo;
                command.Parameters["can"].Value = e.Cantidad;
                command.Parameters["pre"].Value = e.Precio_unitario;
                command.Parameters["for"].Value = e.Forma;
                command.Parameters["mem"].Value = e.Memoria;
                command.Parameters["pes"].Value = e.Peso;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 20
0
        internal DataTable MtdVerificarExistencia(string texto)
        {
            DataTable      empleado    = new DataTable();
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_S_VerificarCuenta";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("ver", SqlDbType.VarChar));
            objComando.Parameters["ver"].Value = texto;
            objComando.Connection = objConexion.Conectar();
            objComando.ExecuteNonQuery();
            adapter.SelectCommand = objComando;
            adapter.Fill(empleado);
            objComando.Connection = objConexion.Desconectar();

            return(empleado);
        }
Esempio n. 21
0
        internal void MtdAgregarHistorial(ClsEauditoria objE)
        {
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_I_AgregarAuditoria";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("dniemp", SqlDbType.VarChar));
            objComando.Parameters.Add(new SqlParameter("desc", SqlDbType.VarChar));
            objComando.Parameters.Add(new SqlParameter("fech", SqlDbType.Date));
            objComando.Parameters.Add(new SqlParameter("hor", SqlDbType.VarChar));
            objComando.Parameters["dniemp"].Value = objE.Dniemp;
            objComando.Parameters["desc"].Value   = objE.Desc;
            objComando.Parameters["fech"].Value   = objE.Fecha;
            objComando.Parameters["hor"].Value    = objE.Hora;
            objComando.ExecuteNonQuery();
            objComando.Connection = objConexion.Desconectar();
        }
Esempio n. 22
0
        internal DataTable MtdBuscarSesion(string usuario)
        {
            DataTable      empleado    = new DataTable();
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_S_BuscarSesion";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("usu", SqlDbType.VarChar));
            objComando.Parameters["usu"].Value = usuario;
            objComando.Connection = objConexion.Conectar();
            objComando.ExecuteNonQuery();
            adapter.SelectCommand = objComando;
            adapter.Fill(empleado);
            objComando.Connection = objConexion.Desconectar();

            return(empleado);
        }
Esempio n. 23
0
        internal Boolean MtdGuardarComprobante(ClsEcomprobante e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarComprobante";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("ser", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("num", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("fec", SqlDbType.Date));
                command.Parameters.Add(new SqlParameter("demp", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("dcli", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("sub", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("igv", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("tot", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
                command.Parameters["ser"].Value  = e.Serie;
                command.Parameters["num"].Value  = e.Numero;
                command.Parameters["fec"].Value  = e.Fecha;
                command.Parameters["demp"].Value = e.Empleado;
                command.Parameters["dcli"].Value = e.Cliente;
                command.Parameters["sub"].Value  = e.Subtotal;
                command.Parameters["igv"].Value  = e.Igv;
                command.Parameters["tot"].Value  = e.Total;
                command.Parameters["est"].Value  = e.Estado;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 24
0
        internal object MtdListarDetallesComprobante(ClsEdetallecomprobante e)
        {
            DataTable      data        = new DataTable();
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_S_ListarDetallesComprobante";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("ser", SqlDbType.VarChar));
            objComando.Parameters.Add(new SqlParameter("num", SqlDbType.VarChar));
            objComando.Parameters["ser"].Value = e.Serie;
            objComando.Parameters["num"].Value = e.Numero;
            objComando.Connection = objConexion.Conectar();
            objComando.ExecuteNonQuery();
            adapter.SelectCommand = objComando;
            adapter.Fill(data);
            objComando.Connection = objConexion.Desconectar();

            return(data);
        }
Esempio n. 25
0
        internal DataTable MtdValidarLogin(ClsElogin e)
        {
            DataTable      empleado    = new DataTable();
            ClsConexionSQL objConexion = new ClsConexionSQL();
            SqlCommand     objComando  = new SqlCommand();
            SqlDataAdapter adapter     = new SqlDataAdapter();

            objComando.Connection  = objConexion.Conectar();
            objComando.CommandText = "USP_S_ValidarLogin";
            objComando.CommandType = CommandType.StoredProcedure;
            objComando.Parameters.Add(new SqlParameter("usu", SqlDbType.VarChar));
            //objComando.Parameters.Add(new SqlParameter("cla", SqlDbType.VarChar));
            objComando.Parameters["usu"].Value = e.Usuario;
            //objComando.Parameters["cla"].Value = e.Clave;
            objComando.Connection = objConexion.Conectar();
            objComando.ExecuteNonQuery();
            adapter.SelectCommand = objComando;
            adapter.Fill(empleado);
            objComando.Connection = objConexion.Desconectar();

            return(empleado);
        }
Esempio n. 26
0
        internal bool MtdGuardarSesion(string usuario)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarSesion";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("usu", SqlDbType.VarChar));
                command.Parameters["usu"].Value = usuario;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 27
0
        internal Boolean MtdGuardarDetalleComprobante(ClsEdetallecomprobante ed)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarDetalleComprobante";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("ser", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("num", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("cod", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("des", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("can", SqlDbType.Int));
                command.Parameters.Add(new SqlParameter("pre", SqlDbType.Decimal));
                command.Parameters.Add(new SqlParameter("imp", SqlDbType.Decimal));
                command.Parameters["ser"].Value = ed.Serie;
                command.Parameters["num"].Value = ed.Numero;
                command.Parameters["cod"].Value = ed.Codigo;
                command.Parameters["des"].Value = ed.Descripcion;
                command.Parameters["can"].Value = ed.Cantidad;
                command.Parameters["pre"].Value = ed.Precio_unitario;
                command.Parameters["imp"].Value = ed.Importe;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Esempio n. 28
0
        internal bool MtdGuardarCliente(ClsEcliente e)
        {
            try
            {
                ClsConexionSQL objConexion = new ClsConexionSQL();
                SqlCommand     command     = new SqlCommand();
                SqlDataAdapter adapter     = new SqlDataAdapter();
                command.Connection  = objConexion.Conectar();
                command.CommandText = "USP_I_AgregarCliente";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add(new SqlParameter("d", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("nom", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("ape", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("cor", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("tel", SqlDbType.VarChar));
                command.Parameters.Add(new SqlParameter("est", SqlDbType.VarChar));
                //command.Parameters.Add(new SqlParameter("idd", SqlDbType.VarChar));
                command.Parameters["d"].Value   = e.Dni;
                command.Parameters["nom"].Value = e.Nombres;
                command.Parameters["ape"].Value = e.Apellidos;
                command.Parameters["cor"].Value = e.Correo;
                command.Parameters["tel"].Value = e.Telefono;
                command.Parameters["est"].Value = e.Estado;
                //command.Parameters["idd"].Value = e.IdDispositivo;
                command.ExecuteNonQuery();
                command.Connection = objConexion.Desconectar();

                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }