예제 #1
0
        private bool fncAltaLinea()
        {
            bool vOk = false;

            cPedidosVenta.LinVenta cLinVenta = new cPedidosVenta.LinVenta();
            if (txCajas.Text == "")
            {
                txCajas.Text = "0";
            }
            if (txCan.Text == "")
            {
                txCan.Text = "0";
            }
            if (txDTO.Text == "")
            {
                txDTO.Text = "0";
            }
            if (txDTOLin.Text == "")
            {
                txDTOLin.Text = "0";
            }
            if (txIva.Text == "")
            {
                txIva.Text = "0";
            }
            if (txPrecio.Text == "")
            {
                txPrecio.Text = "0";
            }


            cLinVenta.Cajas             = Convert.ToInt32(txCajas.Text);
            cLinVenta.Cantidad          = Convert.ToDecimal(txCan.Text);
            cLinVenta.CantidadPendiente = 0;
            cLinVenta.CantidadServida   = 0;
            cLinVenta.Descripción       = txDesProd.Text;
            cLinVenta.DTO          = Convert.ToDecimal(txDTO.Text);
            cLinVenta.DTOLin       = Convert.ToDecimal(txDTOLin.Text);
            cLinVenta.Empresa      = cParamXml.Emp;
            cLinVenta.FechaEntrega = dTEntrega.Value;
            cLinVenta.IVA          = Convert.ToInt16(txIva.Text);
            cLinVenta.Lote         = txLote.Text;
            cLinVenta.NumPed       = Convert.ToInt32(txPed.Text);
            cLinVenta.Precio       = Convert.ToDecimal(txPrecio.Text);
            cLinVenta.Producto     = txProd.Text;
            vOk = cLinVenta.fncAltaLin();

            return(vOk);
        }
예제 #2
0
        private void sbrProcesoPedCli()
        {
            if (cParamXml.ActPedCli == "False")
            {
                return;
            }

            tiProces.Enabled = false;
            lbMen.Text       = "Procesando Pedidos de Cliente";
            Application.DoEvents();
            DataTable dt = new DataTable();

            string vNumSerie = SQLDataAccess.GenTraeNumSerie(cParamXml.NSerPedCli, false, cParamXml.strConec);

            string vSql = cConstantes.SQL_CabPed_Dbf;

            vSql = vSql.Replace("[?vbCr]", cConstantes.vbCtr.ToString());
            vSql = vSql.Replace("[?vbLf]", cConstantes.vbLF.ToString());
            vSql = vSql.Replace("[?NumPed]", vNumSerie);

            try
            {
                dt = SQLDataAccess.TraeDBF(vSql, cUtil.DBFConec(cParamXml.strOleDBConecDbf));
                cPedidosVenta.CabVenta oCabPed = new cPedidosVenta.CabVenta();
                cPedidosVenta.LinVenta oLinPed = new cPedidosVenta.LinVenta();
                string vNumPed = "";
                string vErr    = "";
                foreach (DataRow dr in dt.Rows)
                {
                    vNumPed = dr["nnumped"].ToString();

                    if (oCabPed.fncAlta(dr))
                    {
                        string vSql2 = cConstantes.SQL_LinPed_Dbf;
                        vSql2 = vSql2.Replace("[?vbCr]", cConstantes.vbCtr.ToString());
                        vSql2 = vSql2.Replace("[?vbLf]", cConstantes.vbLF.ToString());
                        vSql2 = vSql2.Replace("[?NumPed]", vNumPed);
                        DataTable dt2 = SQLDataAccess.TraeDBF(vSql2, cUtil.DBFConec(cParamXml.strOleDBConecDbf));
                        foreach (DataRow dr2 in dt2.Rows)
                        {
                            //DataRow dr2 = dt2.Rows[0];
                            if (!oLinPed.fncAltaLin(dr2))
                            {
                                vErr         = oLinPed.Error;
                                lbError.Text = vErr;
                                Application.DoEvents();
                                Thread.Sleep(5000);
                            }
                        }
                    }
                    else
                    {
                        vErr         = oCabPed.Error;
                        lbError.Text = vErr;
                        Application.DoEvents();
                        Thread.Sleep(5000);
                    }
                    SQLDataAccess.GenSetNumSerie(cParamXml.NSerPedCli, vNumPed, cParamXml.strConec);
                }
            }
            catch (Exception ex)
            {
                lbError.Text = DateTime.Now.ToLongDateString() + "-- " + ex.Message;
            }


            lbMen.Text = "";
            Application.DoEvents();
            tiProces.Enabled = true;
        }