コード例 #1
0
    protected void lnkAceptaDescuento_Click(object sender, CommandEventArgs As)
    {
        cotizacionVO VO = new cotizacionVO();
        CotizacionBL BL = new CotizacionBL();

        VO.Operacion        = cotizacionVO.ACTUALIZARBANDESC;
        VO.CotizacionId     = Int32.Parse(As.CommandName);
        VO.BanderaDescuento = 1;
        //VO.FechaVencimiento = DateTime.Now.ToString("d");
        //VO.Fecha = DateTime.Now;
        //VO.DesctoGral=0;
        VO = (cotizacionVO)BL.execute(VO);
        if (VO.Resultado == 0)
        {
            //return true;
        }
        else
        {
            //return false;
        }

        ObjectDataSource1.DataBind();
        ObjectDataSource1.Select();
        GridView1.DataBind();
    }
コード例 #2
0
    protected void cancelaCotizacion_Click(object sender, CommandEventArgs As)
    {
        cotizacionVO VO = new cotizacionVO();
        CotizacionBL BL = new CotizacionBL();

        VO.Operacion           = cotizacionVO.ACTUALIZAR;
        VO.CotizacionId        = Int32.Parse(As.CommandName);
        VO.EstatusCotizacionId = 4;
        VO.Activo             = 0;
        VO.UsuarioIdActualiza = Int32.Parse(Session["usuarioID"].ToString());
        VO.FechaVencimiento   = DateTime.Now.ToString("d");
        VO.FechaCaida         = DateTime.Now.ToString("d");
        VO.Fecha           = DateTime.Now;
        VO.DesctoGral      = 1;
        VO.CondicionesPago = "";
        VO.Notas           = "";
        VO = (cotizacionVO)BL.execute(VO);
        if (VO.Resultado == 0)
        {
            //return true;
        }
        else
        {
            //return false;
        }

        GridView1.DataBind();
    }
コード例 #3
0
    public Object execute(Object O)
    {
        VOReg = (cotizacionVO)O;

        if (VOReg.Operacion == cotizacionVO.ACTUALIZAR)
        {
            return(actualizaCotizacion());
        }
        else if (VOReg.Operacion == cotizacionVO.INSERTAR)
        {
            return(insertaCotizacion());
        }
        else if (VOReg.Operacion == cotizacionVO.BUSCAR)
        {
            return(buscarCotizacion());
        }
        else if (VOReg.Operacion == cotizacionVO.INSERTARCP)
        {
            return(insertaCotizacionCP());
        }
        else if (VOReg.Operacion == cotizacionVO.ACTUALIZARBANDESC)
        {
            return(actualizaCotizacionBandera());
        }
        else if (VOReg.Operacion == cotizacionVO.ACTUALIZARBANINCPREC)
        {
            return(actualizaCotizacionBanderaIncPrec());
        }


        return(VOReg);
    }
コード例 #4
0
    protected void insertaCotizacion(String strCodigoCliente, int intClienteNuevo, int tipoCambio, int tipoDocumento, String strDocumento, String unidadnegocio)
    {
        String mensajeOk           = "<script>javascript:alert('Cotizacion creada exitosamente');window.opener.location.reload();window.close();</script> ";
        String mensajeFail         = "<script>javascript:alert('La Cotizacion no se creo');</script> ";
        int    usuarioIDCotizacion = 0;
        int    usuarioID           = 0;

        usuarioIDCotizacion = Int32.Parse(Session["usuarioIDCotizacion"].ToString());
        usuarioID           = Int32.Parse(Session["usuarioID"].ToString());
        cotizacionVO VO = new cotizacionVO();
        CotizacionBL BL = new CotizacionBL();

        VO.CotizacionId = 0;
        //VO.Fecha = DateTime.Now;
        //VO.Fecha = Convert.ToDateTime(((HiddenField)Master.FindControl("hdnDate")).Value);
        VO.Fecha               = Convert.ToDateTime(hdnDate.Value);
        VO.UsuarioId           = usuarioIDCotizacion;
        VO.Activo              = 1;
        VO.PreAprovado         = 0;
        VO.EstatusCotizacionId = 0;
        VO.CodigoCliente       = strCodigoCliente;
        VO.ClienteIdNuevo      = intClienteNuevo;
        VO.TipoMoneda          = tipoCambio;
        VO.TipoDocumento       = tipoDocumento;
        VO.Documento           = strDocumento;
        VO.UsuarioIdInserto    = usuarioID;
        VO.UnidadNegocio       = unidadnegocio;
        VO.Operacion           = cotizacionVO.INSERTAR;
        VO = (cotizacionVO)BL.execute(VO);
        Session["OrderNumber"] = VO.CotizacionId;
        if (Session["OrderNumber"] != null)
        {
            //Panel2.Visible = false;
            //Panel1.Visible = false;
            //lblMensaje.Visible = true;
            //lblMensaje.Text = "Los datos se insertaron correctamente.";
            Controls.Add(new LiteralControl(mensajeOk));
            //ClientScript.RegisterStartupScript(this.GetType(), "Actualiza", "ShowAlertSucess(''," + (int)EnumMessage.Message.ShowAlertCotizadorSucess + ");", true);
        }
        else
        {
            Controls.Add(new LiteralControl(mensajeFail));
        }
    }
コード例 #5
0
    protected void insertaCotizacion(String strCodigoCliente, int intClienteNuevo, int tipoCambio, int tipoDocumento, String strDocumento, String strRepresentante)
    {
        String mensajeOk           = "<script>javascript:alert('Cotizacion creada exitosamente');window.opener.location.reload();window.close();</script> ";
        String mensajeFail         = "<script>javascript:alert('La Cotizacion no se creo');</script> ";
        int    usuarioIDCotizacion = 0;
        int    usuarioID           = 0;

        usuarioIDCotizacion = Int32.Parse(Session["usuarioIDCotizacion"].ToString());
        usuarioID           = Int32.Parse(Session["usuarioID"].ToString());
        cotizacionVO VO = new cotizacionVO();
        CotizacionBL BL = new CotizacionBL();

        VO.CotizacionId        = 0;
        VO.Fecha               = DateTime.Now;
        VO.UsuarioId           = usuarioIDCotizacion;
        VO.Activo              = 1;
        VO.PreAprovado         = 0;
        VO.EstatusCotizacionId = 0;
        VO.CodigoCliente       = strCodigoCliente;
        VO.ClienteIdNuevo      = intClienteNuevo;
        VO.TipoMoneda          = tipoCambio;
        VO.TipoDocumento       = tipoDocumento;
        VO.Documento           = strDocumento;
        VO.UsuarioIdInserto    = usuarioID;
        VO.RepresentanteLegal  = strRepresentante;
        VO.Operacion           = cotizacionVO.INSERTAR;
        VO = (cotizacionVO)BL.execute(VO);
        Session["OrderNumber"] = VO.CotizacionId;
        if (Session["OrderNumber"] != null)
        {
            //Panel2.Visible = false;
            //Panel1.Visible = false;
            lblMensaje.Visible = true;
            lblMensaje.Text    = "Los datos se Guardaron correctamente.";
            Controls.Add(new LiteralControl(mensajeOk));
        }
        else
        {
            Controls.Add(new LiteralControl(mensajeFail));
        }
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }

        log.Info("Entrando en la busqueda de productos");
        String Criterion = Request.QueryString["Criterion"];
        String textoCat  = Request.QueryString["textoCat"];

        Books.EmptyDataText = "No se encontro el registro.";

        String Category = Request.QueryString["Categoria"];

        Books.DataSourceID       = "";
        Books.PagerSettings.Mode = PagerButtons.NextPreviousFirstLast;
        Books.AllowPaging        = true;

        //-----------------------------

        if (Session["OrderNumber"] != null)
        {
            cotizacionVO VOcotizacion = new cotizacionVO();
            CotizacionBL BLcotizacion = new CotizacionBL();

            //ClienteVO VOcliente = new ClienteVO();
            //ClienteBL BLcliente = new ClienteBL();

            TipoCambioVO VOTipoCambio = new TipoCambioVO();
            TipoCambioBL BLTipoCambio = new TipoCambioBL();

            VOcotizacion.Operacion    = cotizacionVO.BUSCAR;
            VOcotizacion.CotizacionId = Int32.Parse(Session["OrderNumber"].ToString());
            VOcotizacion = (cotizacionVO)BLcotizacion.execute(VOcotizacion);

            intEstatusCotizacion = VOcotizacion.EstatusCotizacionId;

            VOTipoCambio.MonedaId        = VOcotizacion.TipoMoneda;
            VOTipoCambio.FechaTipoCambio = VOcotizacion.Fecha;
            VOTipoCambio.Operacion       = TipoCambioVO.BUSCAR_TIPOS_CAMBIOS;
            VOTipoCambio = (TipoCambioVO)BLTipoCambio.execute(VOTipoCambio);

            conversionMoneda = VOTipoCambio.ArrCambios;

            lblTipoMoneda.Text = get_tipoMoneda(VOcotizacion.TipoMoneda);


            //for (int i =0; i<=conversionMoneda.GetLength(1)-1;i++)
            //{
            //    lblTipoMoneda.Text = lblTipoMoneda.Text + "<BR>" + conversionMoneda[0,i] +"-"+ conversionMoneda[1,i];
            //}

            if (!IsPostBack)
            {
                Session["vistaMode"] = 0;
            }
        }


        //-----------------------------

        Books.PageSize = 10;

        if (Category != null)
        {
            Type.Text          = " Productos: " + textoCat;
            Books.DataSourceID = "ObjectDataSourceProd";
        }
        else if (Criterion != null)
        {
            Type.Text          = "Resultados de la Busqueda: " + Criterion;
            Books.DataSourceID = "ObjectDataSourceProd2";
        }

        if (Session["OrderNumber"] == null)
        {
            lkbAltaProductoComodin.Visible = false;
            Books.Columns[3].Visible       = false;
        }
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }

        //ClienteVO VOcliente = new ClienteVO();
        //ClienteBL BLcliente = new ClienteBL();

        //VOcliente.Cliente_codigo = VOcotizacion.CodigoCliente;
        //VOcliente.Operacion = ClienteVO.BUSCAR_ADMIN_CODIGO;
        //VOcliente = (ClienteVO)BLcliente.execute(VOcliente);
        //if (VOcliente.Cliente_rfc != null)
        //{
        //    dblDescuento = VOcliente.Cliente_descuento;
        //}

        // ---------------------
        if (Session["OrderNumber"] != null)
        {
            cotizacionVO VOcotizacion = new cotizacionVO();
            CotizacionBL BLcotizacion = new CotizacionBL();

            VOcotizacion.Operacion    = cotizacionVO.BUSCAR;
            VOcotizacion.CotizacionId = Int32.Parse(Session["OrderNumber"].ToString());
            VOcotizacion = (cotizacionVO)BLcotizacion.execute(VOcotizacion);

            TipoCambioVO VOTipoCambio = new TipoCambioVO();
            TipoCambioBL BLTipoCambio = new TipoCambioBL();

            VOTipoCambio.MonedaId        = VOcotizacion.TipoMoneda;
            VOTipoCambio.FechaTipoCambio = VOcotizacion.Fecha;
            VOTipoCambio.Operacion       = TipoCambioVO.BUSCAR_TIPOS_CAMBIOS;
            VOTipoCambio = (TipoCambioVO)BLTipoCambio.execute(VOTipoCambio);

            conversionMoneda = VOTipoCambio.ArrCambios;

            //Label FVlblTipoMoneda = (Label)FormViewDisplay.FindControl("lblTipoMoneda");
            //FVlblTipoMoneda.Text = get_tipoMoneda(VOcotizacion.TipoMoneda);
        }

        // ---------------------

        if (!IsPostBack)
        {
//        String prodId = Request.QueryString["Modelo"];
//        DataTable datos = null;
//        //String agno = DateTime.Today.Year.ToString();
//        //String mes = DateTime.Today.Month.ToString().PadLeft(2, '0');
//        //String dia = DateTime.Today.Day.ToString().PadLeft(2, '0');
//        //Double existencia = new Double();
//        //String carpetaEmpresa = "C:/Compacw/Empresas/CALVEK";
//        StringBuilder salida = new StringBuilder();
//        if(prodId != null)
//        {
//            listaAlmacenTableAdapter tabla = new listaAlmacenTableAdapter();
//            datos = tabla.GetData();
//            ArrayList listaNueva = new ArrayList();
//            int index = 0;
////            long prueba = 0;

//            //saludo nuevo = new saludo();
//            //nuevo.fInicializaSDKW();
//            //nuevo.fAbreEmpresaW(carpetaEmpresa);

//            salida.Append("<table cellspacing='0' cellpadding='5' rules='all' border='1' style='border-collapse:collapse;margin-top:10px>");
//            salida.Append("<tr style='color:White;background-color:#990000;'>");
//            salida.Append("<td>");
//            salida.Append("Codigo Almacen.");
//            salida.Append("</td>");
//            salida.Append("<td>");
//            salida.Append("Almacen.");
//            salida.Append("</td>");
//            salida.Append("<td>");
//            salida.Append("Existencias.");
//            salida.Append("</td>");
//            salida.Append("</tr>");
//            while (index < datos.Rows.Count)
//            {
//                salida.Append("<tr>");
//                salida.Append("<td>");
//                salida.Append(datos.Rows[index]["CCODIGOA01"].ToString());
//                salida.Append("</td>");
//                salida.Append("<td>");
//                salida.Append(datos.Rows[index]["CNOMBREA01"].ToString());
//                salida.Append("</td>");
//                salida.Append("<td>");
//                //prueba = nuevo.fRegresaExistenciaW(prodId, datos.Rows[index]["CCODIGOA01"].ToString(), agno, mes, dia, ref existencia);
//                //salida.Append(existencia);

//                salida.Append(Get_Existencia(prodId, Int32.Parse(datos.Rows[index]["CIDALMACEN"].ToString().Trim())));
//                salida.Append("</td>");
//                index++;
//                salida.Append("</tr>");
//            }
//            salida.Append("</table>");

//            //nuevo.fCierraEmpresaW();
//            //nuevo.fTerminaSDKW();
//            tablaExistencia.Text = salida.ToString();
//        }
        }
    }
コード例 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        String error = Utilis.validaPermisos(Session, NUMFUNCION);

        if (!error.Equals(""))
        {
            Response.Redirect(error);
        }

        //String carpetaEmpresa = "C:/Compacw/Empresas/CALVEK";
        //saludo nuevo = new saludo();
        //nuevo.fInicializaSDKW();
        //nuevo.fAbreEmpresaW(carpetaEmpresa);
        //long resultadoAdminpaq;
        //String strRazonSocial = "                                   ";

        //// determinar si el usuario tiene los permisos para aceptar una cotizacion.
        //String error1 = Utilis.validaPermisos(Session, 14);
        //if (error1.Equals(""))
        //    {
        //    blnBanderaAceptaCotizacion = true;
        //    }

        //// determinar si el usuario tiene los permisos para aceptar una cotizacion con descuento.
        //String error2 = Utilis.validaPermisos(Session, 15);
        //if (error2.Equals(""))
        //    {
        //    blnBanderaAceptaCotizacionDescuento = true;
        //    }

        Double dblDescuento = 0;

        cotizacionVO VOcotizacion = new cotizacionVO();
        CotizacionBL BLcotizacion = new CotizacionBL();

        ClienteVO VOcliente = new ClienteVO();
        ClienteBL BLcliente = new ClienteBL();

        TipoCambioVO VOtipoCambio = new TipoCambioVO();
        TipoCambioBL BLtipoCambio = new TipoCambioBL();

        usuarioVO VOUsuario = new usuarioVO();
        UsuarioBL BLUsuario = new UsuarioBL();

        if (Request["cotizacionid"] != null)
        {
            Session["OrderNumber"]    = Request["cotizacionid"];
            VOcotizacion.Operacion    = cotizacionVO.BUSCAR;
            VOcotizacion.CotizacionId = Int32.Parse(Request["cotizacionid"]);
            VOcotizacion = (cotizacionVO)BLcotizacion.execute(VOcotizacion);
        }

        if (!Page.IsPostBack)
        {
            OrderNumberLabel.Text = (String)Session["OrderNumber"];
        }

        lbEstatusCotizacion.Text = VOcotizacion.EstatusCotizacionNombre;//Request["Estatus"];
        intEstatusCotizacion     = VOcotizacion.EstatusCotizacionId;

        //resultadoAdminpaq = nuevo.fBuscaCteProvW(VOcotizacion.CodigoCliente);
        //resultadoAdminpaq = nuevo.fLeeDatoCteProvW("CRAZONSO01", ref strRazonSocial, 30);
        //lblRazonSocial.Text = strRazonSocial;

        lblRazonSocial.Text = VOcotizacion.ClienteIdNuevo.ToString();

        VOcliente.Cliente_codigo = VOcotizacion.CodigoCliente;
        VOcliente.Operacion      = ClienteVO.BUSCAR_ADMIN_CODIGO;
        VOcliente = (ClienteVO)BLcliente.execute(VOcliente);
        if (VOcliente.Cliente_rfc != null)
        {
            lblRazonSocial.Text = VOcliente.Cliente_razonSocial;
            dblDescuento        = VOcliente.Cliente_descuento;
        }
        else
        {
            if (VOcotizacion.ClienteIdNuevo > 0)
            {
                VOcliente.Clienteid = VOcotizacion.ClienteIdNuevo;
                VOcliente.Operacion = ClienteVO.BUSCAR;
                VOcliente           = (ClienteVO)BLcliente.execute(VOcliente);
                if (VOcliente.Cliente_razonSocial != null)
                {
                    lblRazonSocial.Text = VOcliente.Cliente_razonSocial;
                    dblDescuento        = 0;
                }
            }
        }

        //nuevo.fCierraEmpresaW();
        //nuevo.fTerminaSDKW();

        VOtipoCambio.MonedaId  = VOcotizacion.TipoMoneda;
        VOtipoCambio.Operacion = TipoCambioVO.BUSCAR;
        VOtipoCambio           = (TipoCambioVO)BLtipoCambio.execute(VOtipoCambio);

        if (VOtipoCambio.Descripcion != null)
        {
            strTipoMonedaDescripcion = VOtipoCambio.Descripcion;
            //dblConversionCambio = VOtipoCambio.Cambio;
            lblMoneda.Text = strTipoMonedaDescripcion;
        }

        lblNumMoneda.Text = (VOcotizacion.TipoMoneda).ToString();

        if (VOcotizacion.TipoMoneda == 1)
        {
            lblTipoCambio.Text = "1";
        }
        else
        {
            VOtipoCambio.Operacion       = TipoCambioVO.BUSCAR_TIPOS_CAMBIOS;
            VOtipoCambio.FechaTipoCambio = VOcotizacion.Fecha;
            VOtipoCambio.MonedaId        = 1;
            VOtipoCambio = (TipoCambioVO)BLtipoCambio.execute(VOtipoCambio);
            String[,] conversionMoneda = VOtipoCambio.ArrCambios;

            for (int i = 0; i <= conversionMoneda.GetLength(1) - 1; i++)
            {
                if (Int32.Parse(conversionMoneda[0, i]) == VOcotizacion.TipoMoneda)
                {
                    lblTipoCambio.Text = conversionMoneda[1, i];
                }
            }
        }

        lblFechaCotizacion.Text = VOcotizacion.Fecha.ToString();
        lblCodigoCliente.Text   = VOcotizacion.CodigoCliente;

        VOUsuario.Usuarioid = VOcotizacion.UsuarioId;
        VOUsuario.Operacion = usuarioVO.BUSCAR;
        VOUsuario           = (usuarioVO)BLUsuario.execute(VOUsuario);

        lblCodigoAgente.Text = VOUsuario.Usuario_codigoUsuarioAdmin;
    }
コード例 #9
0
    protected void Button6_Click(object sender, EventArgs e)
    {
        NoItemsMessage.Visible = false;

        cotizacionVO VO = new cotizacionVO();
        CotizacionBL BL = new CotizacionBL();

        VO.Operacion           = cotizacionVO.ACTUALIZAR;
        VO.CotizacionId        = Int32.Parse(Request["cotizacionid"]);
        VO.EstatusCotizacionId = 2;

        VO = (cotizacionVO)BL.execute(VO);
        if (VO.Resultado == 0)
        {
            ErrMessage.Text      = "COTIZACION APROBADA";
            intEstatusCotizacion = 2;
            //Button btnActualizar = (Button)ShopCartGrid.Row.FindControl("Button3");
            //btnActualizar.Visible = false;
        }
        else
        {
            ErrMessage.Text = "Los datos NO se actualizaron correctamente";
        }

        String carpetaEmpresa = "C:/CompacW/Empresas/CALVEK";
        int    prueba         = 0;
        int    prueba2        = 0;
        saludo nuevo          = new saludo();
        String lSerie         = "            ";
        Double lFolio         = new Double();
        int    gIdDocto       = 0;

        String lCodigoConcepto = "";

        nuevo.fInicializaSDKW();
        nuevo.fAbreEmpresaW(carpetaEmpresa);
        prueba = nuevo.fSiguienteFolioW("1", lSerie, ref lFolio);

        nuevo.fPosPrimerConceptoDoctoW();

        nuevo.fLeeDatoConceptoDoctoW("cCodigoC01", lCodigoConcepto, 31);

        //nuevo.fCierraEmpresaW();
        //nuevo.fTerminaSDKW();

        String lFecha = lblFechaCotizacion.Text.Substring(3, 2) + "/" + lblFechaCotizacion.Text.Substring(0, 2) + "/" + lblFechaCotizacion.Text.Substring(6, 4);

        //lblComodin.Text += "<BR>Serie:" + lSerie;
        //lblComodin.Text += "<BR>Folio:" + lFolio.ToString();

        //lblEtiqueta.Visible = true;
        //lblEtiqueta.Text += "<BR>";
        //lblEtiqueta.Text += "<BR>Folio:" + lFolio;
        //lblEtiqueta.Text += "<BR>Serie:" + lSerie;
        //lblEtiqueta.Text += "<BR>NumMoneda:" + lblMoneda.Text;
        //lblEtiqueta.Text += "<BR>TipoCambio:" + lblTipoCambio.Text;
        //lblEtiqueta.Text += "<BR>concepto:" + f_RellenaConBlancos("1", 31);
        //lblEtiqueta.Text += "<BR>Serie:" + f_RellenaConBlancos(lSerie, 12);
        //lblEtiqueta.Text += "<BR>fecha:" + f_RellenaConBlancos(lFecha, 24);
        //lblEtiqueta.Text += "<BR>CodigoCteProv:" + f_RellenaConBlancos(lblCodigoCliente.Text, 31);
        //lblEtiqueta.Text += "<BR>CodigoAgente:" + f_RellenaConBlancos(lblCodigoAgente.Text, 31);
        //lblEtiqueta.Text += "<BR>Referencia:" + f_RellenaConBlancos(Session["OrderNumber"].ToString(), 21);

        //tDocumento EncabezadoDocumento = new tDocumento();
        //EncabezadoDocumento.aFolio = lFolio;
        //EncabezadoDocumento.aSerie = lSerie;
        //EncabezadoDocumento.aNumMoneda = Int32.Parse(lblNumMoneda.Text);
        //EncabezadoDocumento.aTipoCambio = Double.Parse(lblTipoCambio.Text);
        //EncabezadoDocumento.aImporte = 0;
        //EncabezadoDocumento.aDescuentoDoc1 = 0;
        //EncabezadoDocumento.aDescuentoDoc2 = 0;
        //EncabezadoDocumento.aSistemaOrigen = 55; //SDK ISV //aSistemaOrigen
        //EncabezadoDocumento.aCodConcepto = f_RellenaConBlancos("1",31);
        //EncabezadoDocumento.aSerie = f_RellenaConBlancos(lSerie,12);
        //EncabezadoDocumento.aFecha = f_RellenaConBlancos(lFecha,24);
        //EncabezadoDocumento.aCodigoCteProv = f_RellenaConBlancos(lblCodigoCliente.Text,31);
        //EncabezadoDocumento.aCodigoAgente = f_RellenaConBlancos(lblCodigoAgente.Text,31);
        //EncabezadoDocumento.aReferencia = f_RellenaConBlancos(Session["OrderNumber"].ToString(),21);
        //EncabezadoDocumento.aAfecta = 0;

        ////nuevo.fInicializaSDKW();
        ////nuevo.fAbreEmpresaW(carpetaEmpresa);

        prueba = nuevo.fBuscaConceptoDoctoW("1");  //MGW100006 Tabla de Conceptos de Documento
        if (prueba == 0)
        {
            NoItemsMessage.Text = "SE ENCONTRO CONCEPTO. ";
        }
        else
        {
            NoItemsMessage.Text = "NO SE ENCONTRO CONCEPTO. ";
        }

        prueba = nuevo.fAltaDocumentoW(ref gIdDocto, lFolio, lSerie, Int32.Parse(lblNumMoneda.Text), Double.Parse(lblTipoCambio.Text), 0, 0, 0, 55, lCodigoConcepto, lFecha, lblCodigoCliente.Text, lblCodigoAgente.Text, Session["OrderNumber"].ToString(), 0);
        //prueba = nuevo.fAltaDocumentoW(ref gIdDocto);

        //tMovimiento RegMovimiento = new tMovimiento();
        Boolean gPrimerMovto = true;
        int     lConsecutivoMovto;

        if (prueba == 0)
        {
            // se agregan movimientos de los productos

            DetalleCotizaVO VODetalleCotiza = new DetalleCotizaVO();
            DetalleCotizaBL BLDetalleCotiza = new DetalleCotizaBL();
            VODetalleCotiza.Operacion = DetalleCotizaVO.BUSCAR_DETALLES_COTIZACION;
            VODetalleCotiza           = (DetalleCotizaVO)BLDetalleCotiza.execute(VODetalleCotiza);

            String[,] arregloDetalles;
            arregloDetalles = VODetalleCotiza.ArrDetalles;
            int    lIdMovimiento     = 0;
            String lValorConsecutivo = "0";

            for (int i = 0; i <= arregloDetalles.GetLength(1) - 1; i++)
            {
                if (gPrimerMovto)
                {
                    lConsecutivoMovto = 100;
                }
                else
                {
                    nuevo.fPosUltimoMovimientoW();
                    nuevo.fLeeDatoMovimientoW("cNumeroM01", lValorConsecutivo, 10);
                    lConsecutivoMovto = 100 + Int32.Parse(lValorConsecutivo);
                    //lConsecutivoMovto += 100;
                }
                gPrimerMovto = false;

                //RegMovimiento.aConsecutivo = lConsecutivoMovto;
                //RegMovimiento.aUnidades = Double.Parse(arregloDetalles[3, i]);//' En caso de producto con series, lotes y/o pedimentos y carcateristicas este valor es cero
                //RegMovimiento.aPrecio = Double.Parse(arregloDetalles[2, i]) * Double.Parse(arregloDetalles[5, i]); //' Usado para docuementos de venta
                //RegMovimiento.aCosto = 0;       //' Usado para docuemtnos de compra y/o inventarios
                //RegMovimiento.aCodProdSer = arregloDetalles[0, i];
                //RegMovimiento.aCodAlmacen = "QGEN001"; // Pendiente
                //RegMovimiento.aReferencia = f_RellenaConBlancos(Session["OrderNumber"].ToString(),21);
                //RegMovimiento.aCodClasificacion = "" + ((char)0);  //' No tiene uso, valor omision en blancos

                prueba2 = nuevo.fAltaMovimientoW(gIdDocto, ref lIdMovimiento, lConsecutivoMovto, Double.Parse(arregloDetalles[3, i]), (Double.Parse(arregloDetalles[2, i]) * Double.Parse(arregloDetalles[5, i])), 0, arregloDetalles[0, i], "QGEN001", Session["OrderNumber"].ToString(), "" + ((char)0));
                if (prueba2 == 0)
                {
                    ErrMessage.Text += "COTIZACION EN ADMIN PAQ EXITOSA";
                }
                else
                {
                    NoItemsMessage.Visible = true;
                    NoItemsMessage.Text    = nuevo.MensajeError(prueba2);
                    nuevo.f_TerminaW(2);         // 0.- Se cancelan los cambios documento
                }
            }
        }
        else
        {
            NoItemsMessage.Visible = true;
            NoItemsMessage.Text   += nuevo.MensajeError(prueba);
            nuevo.f_TerminaW(0);     // 0.- Se cancelan los cambios documento
        }


        nuevo.fCierraEmpresaW();
        nuevo.fTerminaSDKW();

        //      //lblComodin.Text = "HOLA";
    }
コード例 #10
0
    protected void btnDuplicar_Command(object sender, CommandEventArgs As)
    {
        int usuarioIDCotizacion = 0;
        int usuarioID           = 0;
        int cotizaciondup       = 0;

        //String mensajeOk = "<script>javascript:alert('Cotizacion creada exitosamente');</script> ";
        //String mensajeFail = "<script>javascript:alert('La Cotizacion no se creo');</script> ";
        usuarioIDCotizacion = Int32.Parse(Session["usuarioIDCotizacion"].ToString());
        usuarioID           = Int32.Parse(Session["usuarioID"].ToString());
        cotizacionVO VO = new cotizacionVO();
        CotizacionBL BL = new CotizacionBL();

        VO.Operacion    = cotizacionVO.BUSCAR;
        VO.CotizacionId = Int32.Parse(As.CommandName);
        VO = (cotizacionVO)BL.execute(VO);
        cotizacionVO VOdup = new cotizacionVO();
        CotizacionBL BLdup = new CotizacionBL();

        VOdup.CotizacionId = 0;

        VOdup.Fecha = Convert.ToDateTime(hdnCotizadorDate.Value);  //DateTime.Now;

        VOdup.UsuarioId           = usuarioIDCotizacion;
        VOdup.Activo              = 1;
        VOdup.PreAprovado         = 0;
        VOdup.EstatusCotizacionId = 0;
        VOdup.CodigoCliente       = VO.CodigoCliente;
        VOdup.TipoMoneda          = VO.TipoMoneda;
        VOdup.TipoDocumento       = VO.TipoDocumento;
        VOdup.Documento           = VO.Documento;
        VOdup.UsuarioIdInserto    = usuarioID;
        VOdup.CondicionesPago     = VO.CondicionesPago;
        VOdup.UnidadNegocio       = VO.UnidadNegocio;
        VOdup.LAB = VO.LAB;
        VOdup.RepresentanteLegal = VO.RepresentanteLegal;
        //VOdup.DesctoGral = 0;
        VOdup.LAB = VO.LAB;
        VOdup.BanderaDescuento = 0;
        if ((VO.DesctoGral >= 1) && (VO.DesctoGral <= 15))
        {
            VOdup.DesctoGral = VO.DesctoGral;
        }
        else
        {
            VOdup.DesctoGral = 0;
        }
        VOdup.Notas     = VO.Notas;
        VOdup.Operacion = cotizacionVO.INSERTARCP;
        VOdup           = (cotizacionVO)BL.execute(VOdup);
        cotizaciondup   = Int32.Parse(VOdup.CotizacionId.ToString());
        set_detalleCotizacionDuplicadoTableAdapter setdupCotizacion = new set_detalleCotizacionDuplicadoTableAdapter();

        setdupCotizacion.GetData(Int32.Parse(As.CommandName), cotizaciondup);
        if (VOdup.Resultado == 0)
        {
            //Controls.Add(new LiteralControl(mensajeOk));
            //System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertBox", "alert('Your Message');", true);
            //ClientScript.RegisterStartupScript(typeof(Page), "test", "<script>alert('Hello');</script>");
            //Response.Write(@"<script language='javascript'>alert('The following errors have occurred: \n.');</script>");
        }
        else
        {
            //Controls.Add(new LiteralControl(mensajeFail));
        }
        //insertaCotizacion(VO.CodigoCliente, 0, intTipoCambio, VO.TipoDocumento, VO.Documento);

        GridView1.DataBind();
    }
コード例 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        lblCotizacion.Text = Request["cotizacionid"].ToString();

        int intLogoComponentes = Int32.Parse(Request.QueryString["intLogoComponentes"]);

        cotizacionVO VOcotizacion = new cotizacionVO();
        CotizacionBL BLcotizacion = new CotizacionBL();

        ClienteVO VOcliente = new ClienteVO();
        ClienteBL BLcliente = new ClienteBL();

        TipoCambioVO VOtipoCambio = new TipoCambioVO();
        TipoCambioBL BLtipoCambio = new TipoCambioBL();

        usuarioVO VOUsuario = new usuarioVO();
        UsuarioBL BLUsuario = new UsuarioBL();

        if (Request["cotizacionid"] != null)
        {
            VOcotizacion.Operacion    = cotizacionVO.BUSCAR;
            VOcotizacion.CotizacionId = Int32.Parse(Request["cotizacionid"]);
            VOcotizacion = (cotizacionVO)BLcotizacion.execute(VOcotizacion);
        }

        lblFechaCotizacion.Text = String.Format("{0:dd/MM/yyyy}", VOcotizacion.FechaCaida.ToString());

        lblLAB.Text             = VOcotizacion.LAB;
        lblCondicionesPago.Text = VOcotizacion.CondicionesPago;
        lblRepresentante.Text   = VOcotizacion.RepresentanteLegal;

        VOUsuario.Operacion = usuarioVO.BUSCAR;
        VOUsuario.Usuarioid = VOcotizacion.UsuarioId;
        VOUsuario           = (usuarioVO)BLUsuario.execute(VOUsuario);

        lblAsesor.Text   = VOUsuario.Usuario_nombrecompleto;
        lblAsesor2.Text  = VOUsuario.Usuario_nombrecompleto;
        lblEmail.Text    = VOUsuario.Usuario_correoElectronico;
        lblRadio.Text    = VOUsuario.Usuario_radio;
        lblVigencia.Text = VOcotizacion.FechaVencimiento;

        VOcliente.Clienteid = VOcotizacion.ClienteIdNuevo;
        VOcliente.Operacion = ClienteVO.BUSCAR;
        VOcliente           = (ClienteVO)BLcliente.execute(VOcliente);
        if (VOcliente.Cliente_razonSocial != null)
        {
            lblRazonSocial.Text      = VOcliente.Cliente_razonSocial;
            lblDireccionCliente.Text = VOcliente.Cliente_calle;
            lblTelefonoCliente.Text  = VOcliente.Cliente_TelefonoContacto;
        }

        VOtipoCambio.MonedaId  = VOcotizacion.TipoMoneda;
        VOtipoCambio.Operacion = TipoCambioVO.BUSCAR;
        VOtipoCambio           = (TipoCambioVO)BLtipoCambio.execute(VOtipoCambio);

        lblNotas.Text = VOcotizacion.Notas.ToString().ToUpper();

        if (VOtipoCambio.Descripcion != null)
        {
            lblMoneda.Text  = VOtipoCambio.Descripcion;
            lblMoneda2.Text = VOtipoCambio.Descripcion;
        }

        lblCondicion1.Text = "Los Precios anteriores están en " + lblMoneda2.Text + ", al tipo de cambio del día de pago (con excepción de los indicados en M.N).";
        lblCondicion2.Text = "Condiciones de pago:" + lblCondicionesPago.Text;
        lblCondicion3.Text = "LAB:" + lblLAB.Text;
        lblCondicion4.Text = "TODA CANCELACIÓN CAUSARA UN CARGO DEL 30% SOBRE EL MONTO DEL PEDIDO.";
        lblCondicion5.Text = "EXISTENCIA SUJETA AL DIA DE FECHA DE COTIZACION, SALVO PREVIA VENTA.";

        lblCondicion4.Font.Bold = true;
        lblCondicion5.Font.Bold = true;
        lblCondicion4.Font.Size = 10;
        lblCondicion5.Font.Size = 8;
        lblCondicion3.Font.Size = 8;
        lblCondicion2.Font.Size = 8;
        lblCondicion1.Font.Size = 8;


        if (lblMoneda.Text == "PESOS")
        {
            lblCondicion1.Text = "Condiciones de pago:" + lblCondicionesPago.Text;
            lblCondicion2.Text = "LAB:" + lblLAB.Text;
            lblCondicion3.Text = "TODA CANCELACIÓN CAUSARA UN CARGO DEL 30% SOBRE EL MONTO DEL PEDIDO.";
            lblCondicion4.Text = "EXISTENCIA SUJETA AL DIA DE FECHA DE COTIZACION, SALVO PREVIA VENTA.";

            lblCondicion3.Font.Bold = true;
            lblCondicion4.Font.Bold = true;
            lblCondicion3.Font.Size = 10;
            lblCondicion4.Font.Size = 8;
            lblCondicion2.Font.Size = 8;
            lblCondicion1.Font.Size = 8;
            lblCondicion5.Visible   = false;
        }
        else
        {
            lblCondicion1.Text = "Los Precios anteriores están en " + lblMoneda2.Text + ", sujeto al tipo de cambio del día de pago.";
            lblCondicion2.Text = "Condiciones de pago:" + lblCondicionesPago.Text;
            lblCondicion3.Text = "LAB:" + lblLAB.Text;
            lblCondicion4.Text = "TODA CANCELACIÓN CAUSARA UN CARGO DEL 30% SOBRE EL MONTO DEL PEDIDO.";
            lblCondicion5.Text = "EXISTENCIA SUJETA AL DIA DE FECHA DE COTIZACION, SALVO PREVIA VENTA.";

            lblCondicion4.Font.Bold = true;
            lblCondicion5.Font.Bold = true;
            //lblCondicion4.Font.Size = 10;
            //lblCondicion5.Font.Size = 7;
            //lblCondicion3.Font.Size = 8;
            //lblCondicion2.Font.Size = 8;
            //lblCondicion1.Font.Size = 8;
            lblCondicion4.Font.Size = 10;
            lblCondicion5.Font.Size = 8;
            lblCondicion3.Font.Size = 8;
            lblCondicion2.Font.Size = 8;
            lblCondicion1.Font.Size = 8;
        }


        //InfoSessionVO infoSession = (InfoSessionVO)Session["InfoSession"];
        //if (Int32.Parse(infoSession.getValor(InfoSessionVO.OFICINA).ToString()) == 2)
        //{
        if (intLogoComponentes == 0)
        {
            Image1.ImageUrl = "~/Imagenes/caida1.JPG";


            lblCuenta1.Text = "BBVA MX : No. Cuenta 0448265798 / Cbe. Interbancaria 012700004482657983";
            lblCuenta2.Text = "BBVA DLLS : No. Cuenta 0448265828 / Cbe. Interbancaria 012700004482658283";
            lblCuenta3.Text = "BANAMEX MX : No. Cuenta 5492531 / Cbe. Interbancaria 002700038354925318";
            lblCuenta4.Text = "BANAMEX DLLS : No. Cuenta 9440978 / Cbe. Interbancaria 002700038394409784";
        }
        if (intLogoComponentes == 1)
        {
            Image1.ImageUrl = "~/Imagenes/caidaCalvekComponentes.JPG";

            lblCuenta1.Text = "BBVA MX : No. Cuenta 0188427836 / Cbe. Interbancaria 012700001884278361";
            lblCuenta2.Text = "BBVA DLLS : No. Cuenta 0188588643 / Cbe. Interbancaria 012700001885886435";
            lblCuenta3.Text = "BANAMEX MX : No. Cuenta 2504076 / Cbe. Interbancaria 002700700325040767";
            lblCuenta4.Text = "BANAMEX DLLS : No. Cuenta 9442067 / Cbe. Interbancaria 002700038394420670";
        }
        if (intLogoComponentes == 2)
        {
            Image1.ImageUrl = "~/Imagenes/caidaCalvekBajio.JPG";

            lblCuenta1.Text = "BBVA MX : No. Cuenta 0191998102 / Cbe. Interbancaria 012700001919981028";
            lblCuenta2.Text = "BBVA DLLS : No. Cuenta 0191998153 / Cbe. Interbancaria 012700001919981536";
            lblCuenta3.Text = "BANAMEX MX : No. Cuenta 2162880 / Cbe. Interbancaria 002700700521628802";
            lblCuenta4.Text = "BANAMEX DLLS : No. Cuenta 9442180 / Cbe. Interbancaria 002700038394421801";
        }



        //}
    }