Exemplo n.º 1
0
        public frmUpPedido(int strcodigo)
        {
            //emp = be;
            InitializeComponent();

               // txtCodVendedor.Text = be.Id.ToString();
            //txtNomVendedor.Text = be.Nombres + " " + be.Apellidos;

            ped = pdl.getpedido(strcodigo);

            cli = clibl.getcliente(ped.IDCliente);

            txtCodCliente.Text = cli.IdCliente.ToString();
            txtNombreCliente.Text = cli.Nombre.ToString();
            /*NO SE CARGA EL ALMACEN POR QUE NO SE GUARDA*/
            //al = albl.getalmacen(ped.);

            modbe = modbl.getmodalidad(cli.IDModalidadCredito);

            txtmodalidad.Text = modbe.Descripcion;

            emp = empbl.getvendedor(ped.IDVendedor);
            txtCodVendedor.Text = emp.Id.ToString();
            txtNomVendedor.Text = emp.Nombres.ToString();

            dtdetalle.Columns.Add("Codigo", typeof(String));
            dtdetalle.Columns.Add("Nombre", typeof(String));
            dtdetalle.Columns.Add("Precio", typeof(Double));
            dtdetalle.Columns.Add("Cantidad", typeof(Int32));
            dtdetalle.Columns.Add("DetallePedidoId", typeof(Int32));

            actualizarDetalle();
            actualizarmontos();
        }
Exemplo n.º 2
0
        public MenuPrincipal(EmpleadosBE be)
        {
            InitializeComponent();
            emp = be;
            barStaticItem8.Caption = "Bienvenido(a)  "+be.Cargo +": " + be.Nombres +" "+ be.Apellidos ;

            //label1.Text = "HOLA";
        }
Exemplo n.º 3
0
        public frmPedido(EmpleadosBE be)
        {
            emp = be;
            InitializeComponent();

               // txtCodVendedor.Text = be.Id.ToString();
            //txtNomVendedor.Text = be.Nombres + " " + be.Apellidos;

            dtdetalle.Columns.Add("codigo", typeof(String));
            dtdetalle.Columns.Add("nombre", typeof(String));
            dtdetalle.Columns.Add("precio", typeof(Double));
            dtdetalle.Columns.Add("cantidad", typeof(Int32));
            emp.Id = 0;
        }
Exemplo n.º 4
0
        public EmpleadosBE getempleado(int codemp)
        {
            EmpleadosBE be = new EmpleadosBE();

            SqlConnection con = DConexion.obtenerBD();

            string textoCmd = "sp_vt_empleado";

            SqlCommand cmd = new SqlCommand(textoCmd, con);

            cmd.CommandType = CommandType.StoredProcedure;

            // 3. add parameter to command, which
            // will be passed to the stored procedure
            cmd.Parameters.Add(
                new SqlParameter("@empleadoid", codemp));

            SqlDataReader dr = cmd.ExecuteReader();

            if (dr.HasRows)
            {
                while (dr.Read())
                {

                    if (object.ReferenceEquals(dr["IdVendedor"], DBNull.Value))
                    {
                        be.Id = 0;
                    }
                    else
                    {
                        be.Id = int.Parse(dr["IdVendedor"].ToString());
                    }

                    if (object.ReferenceEquals(dr["nombres"], DBNull.Value))
                    {
                        be.Nombres = null;
                    }
                    else
                    {
                        be.Nombres = dr["nombres"].ToString();
                    }

                }
            }

            return be;
        }
Exemplo n.º 5
0
        private void btnIngresar_Click(object sender, EventArgs e)
        {
            AutenticacionBL n = new AutenticacionBL();

            EmpleadosBE be = new EmpleadosBE();
            be = n.Autenticacion(textBox1.Text, textBox2.Text);

            if (be.UserProfile_UserId != 0)
            {
            DevExpress.XtraBars.Ribbon.RibbonForm frm = new Presentacion.MenuPrincipal(be);
            this.Visible = false;
            frm.Show();
            }
            else
            {
                MessageBox.Show("Usuario o Contraseña incorrectas , Por favor vuelva a ingresarlas");
            }
        }
 public frmConsultaComprobante(EmpleadosBE be)
 {
     InitializeComponent();
     emp = be;
 }
Exemplo n.º 7
0
 public frmConsultaPedido(EmpleadosBE be)
 {
     InitializeComponent();
     emp = be;
 }
Exemplo n.º 8
0
        public EmpleadosBE Autenticacion(string usu , string pass)
        {
            EmpleadosBE be = new EmpleadosBE();

            SqlConnection con = DConexion.obtenerBD();

            string textoCmd = "sp_vt_autenticacion";

            SqlCommand cmd = new SqlCommand(textoCmd, con);

            cmd.CommandType = CommandType.StoredProcedure;

            // 3. add parameter to command, which
            // will be passed to the stored procedure
            cmd.Parameters.Add(
                new SqlParameter("@usu", usu));
            cmd.Parameters.Add(
              new SqlParameter("@pass", pass));

            SqlDataReader dr = cmd.ExecuteReader();

            if (dr.HasRows)
            {
                while (dr.Read())
                {

                    if (object.ReferenceEquals(dr["id"], DBNull.Value))
                    {
                        be.Id = 0;
                    }
                    else
                    {
                        be.Id = int.Parse(dr["id"].ToString()) ;
                    }

                    if (object.ReferenceEquals(dr["cargo"], DBNull.Value))
                    {
                        be.Cargo = null;
                    }
                    else
                    {
                        be.Cargo = dr["cargo"].ToString();
                    }

                    if (object.ReferenceEquals(dr["apellidos"], DBNull.Value))
                    {
                        be.Apellidos = null;
                    }
                    else
                    {
                        be.Apellidos = dr["apellidos"].ToString();
                    }

                          if (object.ReferenceEquals(dr["nombres"], DBNull.Value))
                    {
                        be.Nombres = null;
                    }
                    else
                    {
                        be.Nombres = dr["nombres"].ToString();
                    }

                          if (object.ReferenceEquals(dr["userprofile_userid"], DBNull.Value))
                    {
                        be.UserProfile_UserId = 0;
                    }
                    else
                    {
                        be.UserProfile_UserId = int.Parse( dr["userprofile_userid"].ToString());
                    }

                }
            }

            return be;
        }