Beispiel #1
0
 public Entradafiltros(DAConnectionSQL ObjDAConnecion, UserSistemas oUserSistemas)
 {
     oUserSistemasLog = oUserSistemas;
     ObjDaConnexion   = ObjDAConnecion;
     InitializeComponent();
     this.Text = this.Text + " USER .: " + oUserSistemasLog.NOMVENDEDOR + " :.";
 }
Beispiel #2
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (txtUser.Text != null && txtPassword.Text != null)
            {
                oUserSistemas.PASSWORDWEB = txtPassword.Text;
                oUserSistemas.NOMVENDEDOR = txtUser.Text;

                UserSistemas OUserLogueado = BuscarUsuario();
                if (OUserLogueado.NOMVENDEDOR != null && OUserLogueado.PASSWORDWEB != null)
                {
                    oUserSistemas.PASSWORDWEB = txtPassword.Text;
                    UserLogued = true;
                    Entradafiltros FormFiltros = new Entradafiltros(ObjDaConnexion, OUserLogueado);
                    this.Hide();
                    FormFiltros.ShowDialog();
                    this.Show();
                }
                else
                {
                    MessageBox.Show("Error en la Validación del Usuario", "Información", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    txtPassword.SelectAll();
                }
            }
            else
            {
                MessageBox.Show("Ingrese Datos Validos", "Información", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtPassword.SelectAll();
            }
        }
Beispiel #3
0
        private void txtPassword_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (Char)13)
            {
                if (txtPassword.Text == "")
                {
                    txtUser.Text = "";
                }

                else
                {
                    oUserSistemas.PASSWORDWEB = txtPassword.Text;
                    UserSistemas OUserLogueado = BuscarUsuario();
                    if (OUserLogueado.NOMVENDEDOR != null && OUserLogueado.PASSWORDWEB != null)
                    {
                        UserLogued = true;
                        Entradafiltros FormFiltros = new Entradafiltros(ObjDaConnexion, OUserLogueado);
                        this.Hide();
                        FormFiltros.ShowDialog();
                        this.Show();
                    }
                    else
                    {
                        MessageBox.Show("Error en la Validación del Usuario", "Información", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        txtPassword.SelectAll();
                    }
                }
            }
        }
Beispiel #4
0
 public FacturasVenta(ListaDocVentas ObjListaDoc, DAConnectionSQL ObjDAConnecion, UserSistemas oUserSistemas)
 {
     oUserSistemasLog  = oUserSistemas;
     ObjListaDocVentas = ObjListaDoc;
     ObjDaConnexion    = ObjDAConnecion;
     InitializeComponent();
     this.Text = this.Text + " USER .: " + oUserSistemasLog.NOMVENDEDOR + " :.";
 }
Beispiel #5
0
        public FormDevolucion(ref ProductoDev ObjProductoDev, DAConnectionSQL ObjDAConnecion, UserSistemas oUserSistemas)
        {
            ObjDaConnexion   = ObjDAConnecion;
            oUserSistemasLog = oUserSistemas;
            InitializeComponent();

            this.Text = this.Text + " USER .: " + oUserSistemasLog.NOMVENDEDOR + " :.";

            ObjProducto = ObjProductoDev;
            CargaInfo(ref ObjProductoDev);
        }
Beispiel #6
0
        public NotasCredito InsertarNotasCredito(DAConnectionSQL ObjDaConnexion, ListaNotasCredito ObjListaNotasCredito, string TipoSerie, UserSistemas oUserSistemas)
        {
            string       StrinSQL     = "";
            Int32        NumNCR       = 0;
            NotasCredito notasCredito = new NotasCredito();

            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = ObjDaConnexion.Con;
            cmd.CommandType = CommandType.Text;

            //ExisteNC = ValidarDevolucion(cmd, ObjNotasCredito.Serie, ObjNotasCredito.Numero, ObjNotasCredito.CodBarra, ObjNotasCredito.UnidadesDevueltas);

            try
            {
                if (ObjDaConnexion.Con.State == ConnectionState.Closed)
                {
                    ObjDaConnexion.Open();
                }

                NumNCR = BuscarNumeroDoc(cmd, TipoSerie) + 1;

                cmd.Transaction = ObjDaConnexion.Tran;

                cmd.Transaction = ObjDaConnexion.Con.BeginTransaction();

                //ObjDaConnexion.BeginTransaction();

                foreach (var item in ObjListaNotasCredito)
                {
                    item.CodArticulo = BuscarCodigoArticulo(cmd, item.Referencia);


                    StrinSQL = "INSERT INTO NotaC_Join ";
                    StrinSQL = StrinSQL + "(Fecha_Notac,Serie,Numero,Referencia,Descripcion,UnidadesVenta,UnidadesDevueltas, ";
                    StrinSQL = StrinSQL + "RazonDevolucion,Precio,Talla,Color,CodBarra,Almacen,NumLinea,Dtco,CodArticulo, ";
                    StrinSQL = StrinSQL + "Precio_Sin_Iva, Fecha_Fact, Serie_Fact , Numero_Fact,CODVENDEDOR, Linea_Fact ) ";
                    StrinSQL = StrinSQL + "VALUES ('" + DateTime.Now.Date.ToString("MM/dd/yyyy") + "','" + SerieTienda + TipoSerie + "'," + NumNCR + ",";
                    StrinSQL = StrinSQL + "'" + item.Referencia + "','" + item.Descripcion + "',";
                    StrinSQL = StrinSQL + item.Unidades + "," + item.UnidadesDevueltas + ",'" + item.RazonDevolucion + "',";
                    StrinSQL = StrinSQL + item.Precio + ",'" + item.Talla + "','";
                    StrinSQL = StrinSQL + item.CodColor + "','" + item.CodBarra + "','" + Bodega + "'," + item.NumLinea + ",'";
                    StrinSQL = StrinSQL + item.Descuento + "'," + item.CodArticulo + "," + item.Precio_Sin_iva + ",'";
                    StrinSQL = StrinSQL + item.Fecha_Fact.Date.ToString("MM/dd/yyyy") + "','" + item.Serie_Fact + "', ";
                    StrinSQL = StrinSQL + item.Num_Fact + ",'" + oUserSistemas.CODVENDEDOR + "', '" + item.Linea_Fact + "')";

                    cmd.CommandText = StrinSQL;

                    cmd.ExecuteNonQuery();
                }


                StrinSQL        = "JOIN_NC_CAB";
                cmd.CommandText = StrinSQL;

                cmd.ExecuteNonQuery();

                cmd.CommandText = "select MAX(Serie) as Serie, MAX(NUMERO) as Numero from NotaC_Join where serie = '" + SerieTienda + TipoSerie + "'";

                SqlDataReader dr = cmd.ExecuteReader();

                while (dr.Read())
                {
                    notasCredito.Serie  = dr["Serie"].ToString();
                    notasCredito.Numero = Convert.ToInt32(dr["NUMERO"]);
                }

                dr.Close();
                //cmd.Transaction = ObjDaConnexion.Con.
                cmd.Transaction.Commit(); //= ObjDaConnexion.Tran.Commit();

                return(notasCredito);
                //exitoso = true;
            }
            catch (Exception ex)
            {
                cmd.Transaction.Rollback(); //ObjDaConnexion.RollBackTransaction();
                //dr.Close();

                System.Windows.Forms.MessageBox.Show("Error al ejecutar el Qyery " + ex.Message, "Información", MessageBoxButtons.OK, MessageBoxIcon.Error);;
            }

            //return exitoso;
            return(notasCredito);
        }
Beispiel #7
0
        public UserSistemas GetUserSistema(DAConnectionSQL ObjDaConnexion, UserSistemas oUserSistemas)
        {
            UserSistemas oUserSistemaLog = new UserSistemas();

            string StrinSQL = "";


            SqlCommand cmd = new SqlCommand();

            cmd.CommandType = CommandType.Text;
            cmd.Connection  = ObjDaConnexion.Con;

            StrinSQL = "SELECT CODVENDEDOR, NOMVENDEDOR,TIPOUSUARIO, PASSWORDWEB ";
            StrinSQL = StrinSQL + " FROM VENDEDORES where NOMVENDEDOR  = '" + oUserSistemas.NOMVENDEDOR + "' AND ";
            StrinSQL = StrinSQL + " PASSWORDWEB  = '" + oUserSistemas.PASSWORDWEB + "' ";


            cmd.CommandText = StrinSQL;

            if (ObjDaConnexion.Con.State == ConnectionState.Closed)
            {
                ObjDaConnexion.Open();
            }


            SqlDataReader dr = cmd.ExecuteReader();

            try
            {
                while (dr.Read())
                {
                    var withBlock = oUserSistemaLog;
                    withBlock.CODVENDEDOR = dr.GetInt32(0);
                    withBlock.NOMVENDEDOR = dr.GetString(1);
                    //withBlock.TIPOUSUARIO = dr.GetInt32(2);

                    if (dr["PASSWORDWEB"].GetType() == typeof(DBNull)) //!dr.IsDBNull(GetString(45)))
                    {
                        withBlock.PASSWORDWEB = "";
                    }
                    else
                    {
                        withBlock.PASSWORDWEB = dr.GetString(3);
                    }

                    if (dr["TIPOUSUARIO"].GetType() == typeof(DBNull)) //!dr.IsDBNull(GetString(45)))
                    {
                        withBlock.TIPOUSUARIO = 0;
                    }
                    else
                    {
                        withBlock.TIPOUSUARIO = dr.GetInt32(2);
                    }
                }
                dr.Close();
            }
            catch (Exception)
            {
                dr.Close();
            }


            return(oUserSistemaLog);
        }
Beispiel #8
0
        private UserSistemas BuscarUsuario()
        {
            UserSistemas OUserSistemas = ObjProcDB.GetUserSistema(ObjDaConnexion, oUserSistemas);

            return(OUserSistemas);
        }