public Int32 InsertarPresupuesto(SqlConnection con, SqlTransaction Transaccion, double Total, DateTime Fecha
                                         , Int32?CodVendedor, DateTime?FechaRendicion)
        {
            cFunciones fun = new cFunciones();
            string     sql = " insert into Presupuesto(Total,Fecha,CodVendedor";

            sql = sql + ",FechaRendicion,FechaRendicionTexto)";
            sql = sql + " values (" + Total.ToString().Replace(",", ".");
            sql = sql + "," + "'" + Fecha.ToShortDateString() + "'";


            if (CodVendedor != null)
            {
                sql = sql + "," + CodVendedor.ToString();
            }
            else
            {
                sql = sql + ",null";
            }
            if (FechaRendicion != null)
            {
                sql = sql + "," + "'" + fun.FormatoFechaDMA(Convert.ToDateTime(FechaRendicion)) + "'";
                sql = sql + "," + "'" + fun.FormatoFechaDMA(Convert.ToDateTime(FechaRendicion)) + "'";
            }
            else
            {
                sql = sql + ",null,null";
            }

            sql = sql + ")";

            return(cDb.EjecutarEscalarTransaccion(con, Transaccion, sql));
        }
        private void btnCancelar_Click(object sender, EventArgs e)
        {
            cFunciones fun = new Clases.cFunciones();

            txtCodigo.Text  = "";
            txt_Nombre.Text = "";
            Botonera(1);
            Grupo.Enabled = false;
            fun.LimpiarGenerico(this);
        }
Exemplo n.º 3
0
 private void form_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (Principal.CodigoPrincipalAbm != null)
     {
         Botonera(3);
         txtCodigo.Text = Principal.CodigoPrincipalAbm.ToString();
         cFunciones fun = new Clases.cFunciones();
         fun.CargarControles(this, "Color", "CodColor", txtCodigo.Text);
     }
 }
Exemplo n.º 4
0
 private void btnNuevo_Click(object sender, EventArgs e)
 {
     Botonera(2);
     Grupo.Enabled = true;
     Clases.cFunciones fun = new Clases.cFunciones();
     fun.LimpiarGenerico(this);
     txtPorEfectivo.Text = "70";
     txtPorTarjeta.Text  = "100";
     txt_Nombre.Focus();
 }
Exemplo n.º 5
0
        public DataTable GetResumenVentas(DateTime FechaDesde, DateTime FechaHasta)
        {
            cFunciones fun = new cFunciones();
            string     sql = " SELECT MONTH(FECHA) as Mes, YEAR(FECHA) as Anio,SUM(TOTAL) as Total, ";

            sql = sql + " sum(totalcomision) as TotalComision, sum(TotalVentaComision) as TotalRendido";
            sql = sql + " FROM VENTA ";
            sql = sql + " where fecha>=" + "'" + fun.FormatoFechaDMA(FechaDesde) + "'";
            sql = sql + " and fecha<=" + "'" + fun.FormatoFechaDMA(FechaHasta) + "'";
            sql = sql + " GROUP BY MONTH(FECHA), YEAR(FECHA)";
            return(cDb.GetDatatable(sql));
        }
Exemplo n.º 6
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (fun.ValidarFecha(txtM_Fecha.Text) == false)
            {
                Mensaje("La fecha no es válida");
                return;
            }
            if (txt_Nombre.Text == "")
            {
                Mensaje("Debe ingresar una descripción para continuar");
                return;
            }
            if (txtCodigo.Text == "")
            {
                fun.GuardarNuevoGenerico(this, "Articulo");
            }
            else
            {
                // if (txt_Ruta.Text != "")
                //   txt_Ruta.Text = txt_Ruta.Text.Replace("\\", "\\\\");
                fun.ModificarGenerico(this, "Articulo", "CodArticulo", txtCodigo.Text);
            }

            Mensaje("Datos grabados correctamente");
            if (txt_Ruta.Text != "")
            {
                Imagen.Image.Save(txt_Ruta.Text);
            }

            if (txt_CodigoBarra.Text != "")
            {
                var result = MessageBox.Show("Desea Imprimir", "Información",
                                             MessageBoxButtons.YesNo,
                                             MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    cCodigoBarra objCodBarra = new cCodigoBarra();
                    objCodBarra.Insertar(ImagenCodigo, 1, 2);
                    FrmVerReporteBarra frm = new FrmVerReporteBarra();
                    frm.Show();
                }
            }

            Botonera(1);
            fun.LimpiarGenerico(this);
            Imagen.Image       = null;
            ImagenCodigo.Image = null;
            txtCodigo.Text     = "";
            Grupo.Enabled      = false;
        }
Exemplo n.º 7
0
        public DataTable GetPresupuesto(DateTime FechaDesde, DateTime FechaHasta)
        {
            cFunciones fun = new cFunciones();
            string     sql = " select p.CodPresupuesto,p.Fecha,";

            sql = sql + "(select c.Apellido from Cliente c where c.CodCliente = p.CodCliente) as Apellido";
            sql = sql + ",(select c.Nombre from Cliente c where c.CodCliente = p.CodCliente) as Nombre";
            sql = sql + ",p.Total";
            sql = sql + " from Presupuesto p";
            sql = sql + " where p.Fecha>=" + "'" + FechaDesde.ToShortDateString() + "'";
            sql = sql + " and p.Fecha <=" + "'" + FechaHasta.ToShortDateString() + "'";
            sql = sql + " order by p.CodPresupuesto Desc";
            return(cDb.GetDatatable(sql));
        }
Exemplo n.º 8
0
 private void form_FormClosing(object sender, FormClosingEventArgs e)
 {
     LlenarComboArticulo();
     if (Principal.CampoIdSecundarioGenerado != "")
     {
         Clases.cFunciones fun = new Clases.cFunciones();
         switch (Principal.NombreTablaSecundario)
         {
         case "Proveedor":
             fun.LlenarCombo(cmbProveedor, "Proveedor", "Nombre", "CodProveedor");
             cmbProveedor.SelectedValue = Principal.CampoIdSecundarioGenerado;
             break;
         }
     }
 }
        public DataTable GetPresupuestoxFecha(DateTime FechaDesde, DateTime FechaHasta, string Apellido)
        {
            cFunciones fun = new cFunciones();
            string     sql = "select p.CodPresupuesto,p.Fecha,v.Apellido,v.Nombre,p.Total";

            sql = sql + " from Presupuesto p, Vendedor v";
            sql = sql + " where p.CodVendedor=v.CodVendedor";
            sql = sql + " and p.Fecha>=" + "'" + fun.FormatoFechaDMA(FechaDesde) + "'";
            sql = sql + " and p.Fecha<=" + "'" + fun.FormatoFechaDMA(FechaHasta) + "'";
            if (Apellido != "")
            {
                sql = sql + " and v.Apellido like " + "'%" + Apellido + "%'";
            }
            sql = sql + " order by p.CodPresupuesto desc";
            return(cDb.GetDatatable(sql));
        }
Exemplo n.º 10
0
        private void form_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (Principal.CodigoPrincipalAbm != "")
            {
                Clases.cFunciones fun = new Clases.cFunciones();
                switch (Principal.NombreTablaSecundario)
                {
                case "Articulo":
                    BuscarArticuloxCodigo(Convert.ToInt32(Principal.CodigoPrincipalAbm));
                    break;

                case "Cantidad":
                    txtCantidad.Text = Principal.CantidadArticulo.ToString();
                    txtCantidad.Focus();
                    break;
                }
            }
        }
Exemplo n.º 11
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            Clases.cFunciones fun = new Clases.cFunciones();
            if (txt_Costo.Text != "")
            {
                txt_Costo.Text = txt_Costo.Text.Replace(",", ".");
            }

            if (txt_PrecioEfectivo.Text != "")
            {
                txt_PrecioEfectivo.Text = txt_PrecioEfectivo.Text.Replace(",", ".");
            }

            if (txt_PrecioTarjeta.Text != "")
            {
                txt_PrecioTarjeta.Text = txt_PrecioTarjeta.Text.Replace(",", ".");
            }

            if (txt_Nombre.Text == "")
            {
                Mensaje("Debe ingresar una descripción para continuar");
                return;
            }
            if (txtCodigo.Text == "")
            {
                fun.GuardarNuevoGenerico(this, "Juguete");
            }
            else
            {
                // if (txt_Ruta.Text != "")
                //   txt_Ruta.Text = txt_Ruta.Text.Replace("\\", "\\\\");
                fun.ModificarGenerico(this, "Juguete", "CodArticulo", txtCodigo.Text);
            }

            Mensaje("Datos grabados correctamente");
            txtPorEfectivo.Text = "";
            txtPorTarjeta.Text  = "";
            Botonera(1);
            fun.LimpiarGenerico(this);

            txtCodigo.Text = "";
            Grupo.Enabled  = false;
        }
Exemplo n.º 12
0
        private void form_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (Principal.CampoIdSecundarioGenerado != "")
            {
                Clases.cFunciones fun = new Clases.cFunciones();
                switch (Principal.NombreTablaSecundario)
                {
                case "TipoPrenda":
                    fun.LlenarCombo(CmbTipoPrenda, "TipoPrenda", "Nombre", "CodTipoPrenda");
                    CmbTipoPrenda.SelectedValue = Principal.CampoIdSecundarioGenerado;
                    break;

                case "Origen":
                    fun.LlenarCombo(cmbOrigen, "Origen", "Nombre", "CodOrigen");
                    cmbOrigen.SelectedValue = Principal.CampoIdSecundarioGenerado;
                    break;
                }
            }
        }
Exemplo n.º 13
0
        private void form_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (Principal.CampoIdSecundarioGenerado != "")
            {
                Clases.cFunciones fun = new Clases.cFunciones();
                switch (Principal.NombreTablaSecundario)
                {
                case "TipoPrenda":
                    fun.LlenarCombo(cmb_CodTipoPrenda, "TipoPrenda", "Nombre", "CodTipoPrenda");
                    cmb_CodTipoPrenda.SelectedValue = Principal.CampoIdSecundarioGenerado;
                    break;

                case "Origen":
                    fun.LlenarCombo(cmb_CodOrigen, "Origen", "Nombre", "CodOrigen");
                    cmb_CodOrigen.SelectedValue = Principal.CampoIdSecundarioGenerado;
                    break;

                case "Color":
                    fun.LlenarCombo(cmb_CodColor, "Color", "Nombre", "CodColor");
                    cmb_CodColor.SelectedValue = Principal.CampoIdSecundarioGenerado;
                    break;
                }
            }
            if (Principal.CodigoPrincipalAbm != null)
            {
                Botonera(3);
                txtCodigo.Text = Principal.CodigoPrincipalAbm.ToString();
                cFunciones fun = new Clases.cFunciones();
                fun.CargarControles(this, "Articulo", "CodArticulo", txtCodigo.Text);
                if (txt_CodigoBarra.Text != "")
                {
                    BarcodeLib.Barcode CodBar = new BarcodeLib.Barcode();
                    ImagenCodigo.Image = CodBar.Encode(BarcodeLib.TYPE.CODE128, txt_CodigoBarra.Text, Color.Black, Color.White, 300, 300);
                    if (txt_Ruta.Text != "")
                    {
                        string ruta = txt_Ruta.Text;
                        //ruta = ruta.Replace("\","\\");
                        Imagen.Image = System.Drawing.Image.FromFile(ruta);
                    }
                }
            }
        }
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (txt_Nombre.Text == "")
     {
         Mensaje("Debe ingresar una descripción");
         return;
     }
     Clases.cFunciones fun = new Clases.cFunciones();
     if (txtCodigo.Text == "")
     {
         fun.GuardarNuevoGenerico(this, "TipoPrenda");
     }
     else
     {
         fun.ModificarGenerico(this, "TipoPrenda", "CodTipoPrenda", txtCodigo.Text);
     }
     Mensaje("Datos grabados correctamente");
     txtCodigo.Text  = "";
     txt_Nombre.Text = "";
 }
Exemplo n.º 15
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     Clases.cFunciones fun = new Clases.cFunciones();
     if (txt_Nombre.Text == "")
     {
         Mensaje("Debe ingresar un color");
         return;
     }
     if (txtCodigo.Text == "")
     {
         fun.GuardarNuevoGenerico(this, "Color");
     }
     else
     {
         // if (txt_Ruta.Text != "")
         //   txt_Ruta.Text = txt_Ruta.Text.Replace("\\", "\\\\");
         fun.ModificarGenerico(this, "Color", "CodColor", txtCodigo.Text);
     }
     fun.LimpiarGenerico(this);
     Mensaje("Datos grabados correctamente");
 }
Exemplo n.º 16
0
        public Int32 InsertarVenta(SqlConnection con, SqlTransaction Transaccion, Int32?CodVendedor, DateTime Fecha,
                                   Int32 CodPresupuesto, Double Total, Double TotalComision, Double TotalVentaComision)
        {
            cFunciones fun = new cFunciones();
            string     sql = "insert into Venta(CodVendedor,Fecha,CodPresupuesto,Total,TotalComision,TotalVentaComision)";

            if (CodVendedor != null)
            {
                sql = sql + " values(" + CodVendedor.ToString();
            }
            else
            {
                sql = sql + " Values(null";
            }
            sql = sql + "," + "'" + fun.FormatoFechaDMA(Fecha) + "'";
            sql = sql + "," + CodPresupuesto.ToString();
            sql = sql + "," + Total.ToString().Replace(",", ".");
            sql = sql + "," + TotalComision.ToString().Replace(",", ".");
            sql = sql + "," + TotalVentaComision.ToString().Replace(",", ".");
            sql = sql + ")";
            return(cDb.EjecutarEscalarTransaccion(con, Transaccion, sql));
        }
Exemplo n.º 17
0
        private void form_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (Principal.CampoIdSecundarioGenerado != "")
            {
                switch (Principal.NombreTablaSecundario)
                {
                case "Marca":
                    cFunciones fun = new Clases.cFunciones();
                    fun.LlenarCombo(cmb_CodMarca, "Marca", "Nombre", "CodMarca");
                    cmb_CodMarca.SelectedValue = Principal.CampoIdSecundarioGenerado;
                    break;
                }
            }

            if (Principal.CodigoPrincipalAbm != null)
            {
                Botonera(3);
                txtCodigo.Text = Principal.CodigoPrincipalAbm.ToString();
                cFunciones fun = new Clases.cFunciones();
                fun.CargarControles(this, "Juguete", "CodArticulo", txtCodigo.Text);
                if (txt_PrecioEfectivo.Text != "")
                {
                    Double Efectivo = Convert.ToDouble(txt_PrecioEfectivo.Text.Replace(".", ","));
                    txt_PrecioEfectivo.Text = Math.Round(Efectivo, 0).ToString();
                }

                if (txt_Costo.Text != "")
                {
                    Double Costo = Convert.ToDouble(txt_Costo.Text.Replace(".", ","));
                    txt_Costo.Text = Math.Round(Costo, 0).ToString();
                }

                if (txt_PrecioTarjeta.Text != "")
                {
                    Double Efectivo = Convert.ToDouble(txt_PrecioTarjeta.Text.Replace(".", ","));
                    txt_PrecioTarjeta.Text = Math.Round(Efectivo, 0).ToString();
                }
            }
        }
Exemplo n.º 18
0
        private void txtPorcentaje_KeyPress(object sender, KeyPressEventArgs e)
        {
            cFunciones fun = new Clases.cFunciones();

            fun.SoloNumerosEnteros(e);
        }
Exemplo n.º 19
0
        private void FrmCopia_Load(object sender, EventArgs e)
        {
            cFunciones fun = new Clases.cFunciones();

            fun.EstiloBotones(btnCopia);
        }