コード例 #1
0
        protected void ImprimirFormatoPDF()
        {
            string prefijo = Request.QueryString["pref"];
            string numero  = Request.QueryString["num"];

            Utils.MostrarAlerta(Response, "Se ha creado la devolución de la factura del proveedor con prefijo: " + prefijo + " y número: " + numero + "");

            formatoFactura = new FormatosDocumentos();
            try
            {
                formatoFactura.Prefijo = prefijo;
                formatoFactura.Numero  = Convert.ToInt32(numero);
                formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + prefijo + "'");

                if (formatoFactura.Codigo != string.Empty)
                {
                    if (formatoFactura.Cargar_Formato())
                    {
                        Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                    }
                }
                formatoFactura.Codigo = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + prefijo + "'");
                if (formatoFactura.Codigo != string.Empty)
                {
                    if (formatoFactura.Cargar_Formato())
                    {
                        Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                    }
                }
            }
            catch
            {
                lb.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
            }
        }
コード例 #2
0
        protected void RealizarDevolucion(Object Sender, EventArgs e)
        {
            if (ddlVINDev.Items.Count == 0)
            {
                Utils.MostrarAlerta(Response, "No se ha seleccionado algun vehículo para devolver.\\nRevise Por Favor");
                return;
            }
            uint      numPDVeh        = 0;
            Recepcion recepcionNota   = new Recepcion();
            DateTime  fechaDevolucion = Convert.ToDateTime(tbDate.Text);

            string error = Recepcion.DevolverVehiculoProveedor(ddlVINDev.SelectedValue, ddlNotDevProv.SelectedValue, HttpContext.Current.User.Identity.Name, ref numPDVeh, txtobsv.Text, fechaDevolucion);

            if (error != "")
            {
                Utils.MostrarAlerta(Response, "" + (error.Split('*'))[0] + ".\\nRevise Por Favor");
                lb.Text += "<br>" + (error.Split('*'))[1];
            }
            else if (numPDVeh != 0)
            {
                string numeroNota = DBFunctions.SingleData("SELECT MFAC_NUMEORDEPAGO FROM MVEHICULO WHERE MVEH_INVENTARIO = " + ddlVINDev.SelectedValue.ToString() + " ");
                contaOnline.contabilizarOnline(ddlNotDevProv.SelectedValue.ToString(), Convert.ToInt32(numeroNota.ToString()), fechaDevolucion, "");

                // Mostrar el formato de la NOTA DE LA DEVOLUCION
                Utils.MostrarAlerta(Response, "Se ha creado la devolucion de la factura del proveedor con prefijo " + ddlNotDevProv.SelectedValue.ToString() + " y número " + numeroNota.ToString() + "");

                formatoFactura = new FormatosDocumentos();
                try
                {
                    formatoFactura.Prefijo = ddlNotDevProv.SelectedValue.ToString();
                    formatoFactura.Numero  = Convert.ToInt32(numeroNota.ToString());
                    formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + ddlNotDevProv.SelectedValue.ToString() + "'");

                    if (formatoFactura.Codigo != string.Empty)
                    {
                        if (formatoFactura.Cargar_Formato())
                        {
                            Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                        }
                    }
                    formatoFactura.Codigo = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + ddlNotDevProv.SelectedValue.ToString() + "'");
                    if (formatoFactura.Codigo != string.Empty)
                    {
                        if (formatoFactura.Cargar_Formato())
                        {
                            Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                        }
                    }
                }
                catch
                {
                    lb.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
                }

                Response.Redirect("" + indexPage + "?process=Vehiculos.DevolucionPedidoProveedor&pref=" + ddlNotDevProv.SelectedValue + "&num=" + numeroNota);
            }
        }
コード例 #3
0
        protected void Page_Load(object Sender, EventArgs e)
        {
            Session.Clear();
            if (Request.QueryString["cruce"] != null)
            {
                tipoRecibo.Items[0].Text = "Lógica de Cliente ó Notas Crédito Proveedor";
                tipoRecibo.Items[1].Text = "Lógica de Proveedor ó Notas Débito Clientes";
                tipoRecibo.Items.RemoveAt(2);
                descripcionEncabezado.InnerText = "Lógica de Cruce a Aplicar: ";
            }

            if (!IsPostBack)
            {
                if (Request.QueryString["pre"] != null && Request.QueryString["num"] != null && Request.QueryString["tip"] != null)
                {
                    if (Request.QueryString["tip"] == "RC")
                    {
                        Utils.MostrarAlerta(Response, "Se ha creado el recibo de caja con prefijo " + Request.QueryString["pre"] + " y número " + Request.QueryString["num"] + "");
                    }
                    else if (Request.QueryString["tip"] == "CE")
                    {
                        Utils.MostrarAlerta(Response, "Se ha creado el comprobante de egreso con prefijo " + Request.QueryString["pre"] + " y número " + Request.QueryString["num"] + "");
                    }
                    else if (Request.QueryString["tip"] == "RP")
                    {
                        Utils.MostrarAlerta(Response, "Se ha creado el recibo provisional con prefijo " + Request.QueryString["pre"] + " y número " + Request.QueryString["num"] + "");
                    }
                    try
                    {
                        formatoRecibo.Prefijo = Request.QueryString["pre"];
                        formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["num"]);
                        formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pre"] + "'");
                        if (formatoRecibo.Codigo != string.Empty)
                        {
                            if (formatoRecibo.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                            }
                        }
                        formatoRecibo.Codigo = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pre"] + "'");
                        if (formatoRecibo.Codigo != string.Empty)
                        {
                            if (formatoRecibo.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=500');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lb.Text += "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes + "<br>" + "El recibo puede ser impreso por la opción Impresion<br>";
                    }
                }
            }
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         txtFecha.Text = DateTime.Now.ToString("yyyy-MM-dd");
         bind.PutDatasIntoDropDownList(almacen, "SELECT palm_almacen,palm_descripcion FROM palmacen where (pcen_centcart is not null  or pcen_centteso is not null) and tvig_vigencia='V' order by palm_descripcion;");
         almacen.Items.Insert(0, "Seleccione:");
         if (Request.QueryString["prefD"] != null && Request.QueryString["numD"] != null)
         {
             Response.Write("<script language:javascript>alert('Se ha creado el documento " + Request.QueryString["prefD"] + "-" + Request.QueryString["numD"] + "');</script>");
             try
             {
                 formatoConsignacion         = new FormatosDocumentos();
                 formatoConsignacion.Prefijo = Request.QueryString["prefD"];
                 formatoConsignacion.Numero  = Convert.ToInt32(Request.QueryString["numD"]);
                 formatoConsignacion.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefD"] + "'");
                 if (formatoConsignacion.Codigo != string.Empty)
                 {
                     if (formatoConsignacion.Cargar_Formato())
                     {
                         Response.Write("<script language:javascript>w=window.open('" + formatoConsignacion.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                     }
                 }
             }
             catch
             {
                 lb.Text += "Error al generar la impresión. Detalles : " + formatoConsignacion.Mensajes + "<br>";
             }
         }
     }
 }
コード例 #5
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     // Introducir aquí el código de usuario para inicializar la página
     if (!IsPostBack)
     {
         DatasToControls bind = new DatasToControls();
         //bind.PutDatasIntoDropDownList(ddlPreOT,"SELECT pdoc_codigo,pdoc_codigo CONCAT ' - ' CONCAT pdoc_nombre FROM dbxschema.pdocumento WHERE tdoc_tipodocu='OT'");
         Utils.llenarPrefijos(Response, ref ddlPreOT, "%", "%", "OT");
         //bind.PutDatasIntoDropDownList(ddlNumOT,"SELECT mord_numeorde FROM dbxschema.morden WHERE pdoc_codigo='"+ddlPreOT.SelectedValue+"'");
         if (Request["prefOT"] != null && Request["prefOT"] != string.Empty && Request["numOT"] != null && Request["numOT"] != string.Empty)
         {
             try
             {
                 formatoRecibo.Prefijo = Request["prefOT"];
                 formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["numOT"]);
                 formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefOT"] + "'");
                 if (formatoRecibo.Codigo != string.Empty)
                 {
                     if (formatoRecibo.Cargar_Formato())
                     {
                         Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                     }
                 }
             }
             catch
             {
                 //lbInfo.Text+="Error al generar la impresión. Detalles : "+formatoRecibo.Mensajes+"<br>";
                 Utils.MostrarAlerta(Response, "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes.Replace("'", "") + "");
             }
         }
     }
 }
コード例 #6
0
        protected void Page_Load(object Sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DatasToControls bind = new DatasToControls();
                bind.PutDatasIntoDropDownList(almacen, "SELECT palm_almacen,palm_descripcion FROM palmacen where (pcen_centcart is not null  or pcen_centteso is not null) and TVIG_VIGENCIA = 'V' order by palm_descripcion;");
                if (almacen.Items.Count > 1)
                {
                    almacen.Items.Insert(0, "Seleccione..");
                }

                bind.PutDatasIntoDropDownList(tipoConsignacion, "SELECT tcau_codigo,tcau_nombre FROM ttipoconsignacion WHERE tcau_codigo<>8");
                if (tipoConsignacion.Items.Count > 1)
                {
                    tipoConsignacion.Items.Insert(0, "Seleccione..");
                }

                //    bind.PutDatasIntoDropDownList(prefijoDocumento, "SELECT pdoc_codigo,pdoc_descripcion FROM pdocumento WHERE tdoc_tipodocu='CS' and tvig_vigencia = 'V' ");
                else
                {
                    Cambiar_Accion(null, null);
                }
                holderConsignacionCC.Visible = holderDevolucionCC.Visible = holderRemisionFinanciera.Visible = holderDevolucionFinanciera.Visible = holderTrasladoCCCarta.Visible = holderTrasladoCCCheque.Visible = holderNotasBancarias.Visible = holderChequesProveedores.Visible = false;
                valorConsignado.Text         = totalEfectivo.Text = "$0.00";
                if (Request.QueryString["prefD"] != null && Request.QueryString["numD"] != null)
                {
                    Utils.MostrarAlerta(Response, "Se ha creado el documento " + Request.QueryString["prefD"] + "-" + Request.QueryString["numD"] + "");
                    try
                    {
                        formatoConsignacion         = new FormatosDocumentos();
                        formatoConsignacion.Prefijo = Request.QueryString["prefD"];
                        formatoConsignacion.Numero  = Convert.ToInt32(Request.QueryString["numD"]);
                        formatoConsignacion.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefD"] + "'");
                        if (formatoConsignacion.Codigo != string.Empty)
                        {
                            if (formatoConsignacion.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoConsignacion.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lb.Text += "Error al generar la impresión. Detalles : " + formatoConsignacion.Mensajes + "<br>";
                    }
                }
            }
            // este cargue solo debe aplicarlo unicamente al proceso seleccionado
            holderConsignacionCC.Controls.Add(LoadControl(pathToControls + "AMS.Tesoreria.ConsignaCheques.ConsignacionCC.ascx"));
            holderDevolucionCC.Controls.Add(LoadControl(pathToControls + "AMS.Tesoreria.ConsignaCheques.DevolucionCC.ascx"));
            holderRemisionFinanciera.Controls.Add(LoadControl(pathToControls + "AMS.Tesoreria.ConsignaCheques.RemCheqFinan.ascx"));
            holderDevolucionFinanciera.Controls.Add(LoadControl(pathToControls + "AMS.Tesoreria.ConsignaCheques.DevCheqFinan.ascx"));
            holderTrasladoCCCarta.Controls.Add(LoadControl(pathToControls + "AMS.Tesoreria.ConsignaCheques.TrasFondosCCCarta.ascx"));
            holderTrasladoCCCheque.Controls.Add(LoadControl(pathToControls + "AMS.Tesoreria.ConsignaCheques.TrasFondosCCCheque.ascx"));
            holderNotasBancarias.Controls.Add(LoadControl(pathToControls + "AMS.Tesoreria.ConsignaCheques.NotasBancarias.ascx"));
            holderChequesProveedores.Controls.Add(LoadControl(pathToControls + "AMS.Tesoreria.ConsignaCheques.EntrChequesProv.ascx"));
        }
コード例 #7
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                proceso = Request.QueryString["accion"]; //LEE el parametrs si es ELIMINACION para BORRAR de todo lado la factura
                ViewState["eliminar"] = proceso;
                DatasToControls bind = new DatasToControls();
                bind.PutDatasIntoDropDownList(prefijoPedidoOtro, string.Format(Documento.DOCUMENTOSTIPO, "PC"));
                if (prefijoPedidoOtro.Items.Count > 1)
                {
                    prefijoPedidoOtro.Items.Insert(0, "Seleccione:..");
                }
                else
                {
                    bind.PutDatasIntoDropDownList(numeroPedidoOtro,
                                                  @"SELECT MPV.mped_numepedi  
					 FROM mpedidovehiculo MPV, masignacionvehiculo MAV, mvehiculo MVH  
					 WHERE MPV.test_tipoesta=30 AND MPV.pdoc_codigo='"                     + prefijoPedidoOtro.SelectedValue + @"' AND MAV.pdoc_codigo=MPV.pdoc_codigo AND MAV.mped_numepedi = MPV.mped_numepedi AND MAV.mveh_inventario = MVH.mveh_inventario AND MVH.test_tipoesta = 40  
					 ORDER BY MPV.mped_numepedi;"                    );
                }
                bind.PutDatasIntoDropDownList(prefijoDevoluciones, "SELECT p.pdoc_codigo, p.pdoc_codigo CONCAT ' - ' CONCAT p.pdoc_nombre FROM pdocumento as P, pdocumentohecho as PH WHERE p.tdoc_tipodocu = 'NC' and PH.tpro_proceso in ('VN','VU') AND P.PDOC_CODIGO = PH.PDOC_CODIGO and pdoc_numefina > pdoc_numeinic and pdoc_ultidocu < pdoc_numefina");
                if (prefijoDevoluciones.Items.Count == 0)
                {
                    Utils.MostrarAlerta(Response, "No se ha configurado el prefijo para las devoluciones de factura cliente. Revise Por Favor.");
                }
                string notaAcceDescrip = "";
                if (Request.QueryString["prefNotaAcce"] != null && Request.QueryString["prefNotaAcce"] != "")
                {
                    notaAcceDescrip = " Nota credito por Accesorios generada: " + Request.QueryString["prefNotaAcce"] + "-" + Request.QueryString["numNotaAcce"];
                    FormatosDocumentos formatoRecibo = new FormatosDocumentos();
                    formatoRecibo.Prefijo = Request.QueryString["prefNotaAcce"];
                    formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefNotaAcce"] + "'");
                    formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["numNotaAcce"].ToString());
                    if (formatoRecibo.Cargar_Formato())
                    {
                        Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                    }
                }
                if (Request.QueryString["prefPed"] != null)
                {
                    Utils.MostrarAlerta(Response, "Factura de Cliente Devuelta Exitosamente, pedido: " + Request.QueryString["prefPed"] + "-" + Request.QueryString["ped"] + ". Nota credito generada: " + Request.QueryString["prefNota"] + "-" + Request.QueryString["numNota"] + notaAcceDescrip + "");
                    FormatosDocumentos formatoRecibo = new FormatosDocumentos();
                    formatoRecibo.Prefijo = Request.QueryString["prefNota"];
                    formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefNota"] + "'");
                    formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["numNota"].ToString());
                    if (formatoRecibo.Cargar_Formato())
                    {
                        Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                    }
                }

                // "&prefNotaAcce=" + pedidoDevolucion.PrefNotaAccesorios + "&numNotaAcce=" + pedidoDevolucion.NumeNotaAccesorios);
                imglupa.Attributes.Add("OnClick", "ModalDialog(" + numeroPedidoOtro.ClientID + ",'SELECT rtrim(cast(MPV.mped_numepedi as char(10))) as Pedido FROM mpedidovehiculo MPV, masignacionvehiculo MAV, mvehiculo MVH WHERE MPV.test_tipoesta=30 AND MPV.pdoc_codigo=\\'" + prefijoPedidoOtro.SelectedValue + "\\' AND MAV.pdoc_codigo=MPV.pdoc_codigo AND MAV.mped_numepedi = MPV.mped_numepedi AND MAV.mveh_inventario = MVH.mveh_inventario AND MVH.test_tipoesta <> 60 ORDER BY MPV.mped_numepedi ' ,new Array() );");
                fechNota.Text = DateTime.Now.ToString("yyyy-MM-dd");
            }
        }
コード例 #8
0
        protected void btnAceptar_Click(object sender, System.EventArgs e)
        {
            int contador = 0;

            formatoRecibo.Prefijo = ddlPrefijo.SelectedValue;
            formatoRecibo.Numero  = Convert.ToInt32(tbnumero.Text);
            formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + ddlPrefijo.SelectedValue + "'");

            if (formatoRecibo.Codigo != string.Empty)
            {
                if (formatoRecibo.Cargar_Formato())
                {
                    try
                    {
                        Utils.MostrarPDF(Response, formatoRecibo.Documento, 800);
                    }catch { contador++; }
                }

                //Response.Write("<script language:javascript>w=window.open('../aspx/AMS.Web.ModalPDF.aspx?rpt=" + formatoRecibo.Documento.Replace("../rptgen/","") + "', '','HEIGHT=650,WIDTH=800');</script>");
                //Response.Write("<script language:javascript>w=window.open('"+formatoRecibo.Documento+"','','HEIGHT=600,WIDTH=800');</script>");
            }
            formatoRecibo.Codigo = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + ddlPrefijo.SelectedValue + "'");
            if (formatoRecibo.Codigo != string.Empty)
            {
                if (formatoRecibo.Cargar_Formato())
                {
                    try
                    {
                        Utils.MostrarPDF(Response, formatoRecibo.Documento, 700);
                    }
                    catch { contador++; }
                }

                //Response.Write("<script language:javascript>w=window.open('../aspx/AMS.Web.ModalPDF.aspx?rpt=" + formatoRecibo.Documento.Replace("../rptgen/", "") + "', '','HEIGHT=650,WIDTH=758');</script>");
                //Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=700');</script>");
            }
            if (contador > 1)
            {
                Utils.MostrarAlerta(Response,
                                    "No se pudo cargar el Reporte: " + formatoRecibo.Codigo + "-" + formatoRecibo.Prefijo + "-" + formatoRecibo.Numero +
                                    ". Por favor contactar al administrador del sistema.");
            }
        }
コード例 #9
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!IsPostBack)
     {
         DatasToControls bind = new DatasToControls();
         //bind.PutDatasIntoDropDownList(prefFact,"SELECT pdoc_codigo, pdoc_nombre FROM pdocumento WHERE tdoc_tipodocu='FC'");
         Utils.llenarPrefijos(Response, ref prefFact, "%", "%", "FC");
         //Fecha de la factura
         fecha.SelectedDate = DateTime.Now;
         fechFactura.Text   = fecha.SelectedDate.Date.ToString("yyyy-MM-dd");
         if (Request["prefF"] != null && Request["numF"] != null)
         {
             Utils.MostrarAlerta(Response, "Se ha creado la factura " + Request["prefF"] + " - " + Request["numF"] + "");
             // impresion del formato
             try
             {
                 formatoFactura.Prefijo = Request["prefF"];
                 formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["numF"]);
                 formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefF"] + "' ");
                 if (formatoFactura.Codigo != string.Empty)
                 {
                     if (formatoFactura.Cargar_Formato())
                     {
                         Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=800,WIDTH=800');</script>");
                     }
                 }
                 formatoFactura.Codigo = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefF"] + "' ");
                 if (formatoFactura.Codigo != string.Empty)
                 {
                     if (formatoFactura.Cargar_Formato())
                     {
                         Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                     }
                 }
             }
             catch
             {
                 lb.Text += "Error al generar la impresión. Detalles : " + formatoFactura.Mensajes + "<br>" + "El recibo puede ser impreso por la opción Impresion<br>";
             }
         }
     }
 }
コード例 #10
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!IsPostBack)
     {
         DatasToControls bind = new DatasToControls();
         bind.PutDatasIntoDropDownList(almacen, "SELECT palm_almacen,palm_descripcion FROM palmacen where (pcen_centcart is not null  or pcen_centteso is not null) and tvig_vigencia='V' order by palm_descripcion;");
         if (Request.QueryString["prefD"] != null && Request.QueryString["numD"] != null)
         {
             Response.Write("<script language:javascript>alert('Se ha creado el documento " + Request.QueryString["prefD"] + "-" + Request.QueryString["numD"] + "');</script>");
             try
             {
                 formatoConsignacion         = new FormatosDocumentos();
                 formatoConsignacion.Prefijo = Request.QueryString["prefD"];
                 formatoConsignacion.Numero  = Convert.ToInt32(Request.QueryString["numD"]);
                 formatoConsignacion.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefD"] + "'");
                 if (formatoConsignacion.Codigo != string.Empty)
                 {
                     if (formatoConsignacion.Cargar_Formato())
                     {
                         Response.Write("<script language:javascript>w=window.open('" + formatoConsignacion.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                     }
                 }
             }
             catch
             {
                 lb.Text += "Error al generar la impresión. Detalles : " + formatoConsignacion.Mensajes + "<br>";
             }
         }
         if (!DBFunctions.RecordExist("SELECT pdoc_codigo,pdoc_descripcion FROM pdocumento WHERE tdoc_tipodocu='AT' and tvig_vigencia = 'V' "))
         {
             Response.Write("<script language:javascript>alert('No hay documentos del tipo AT definidos para anulación');</script>");
             prefijoDocumento.Enabled = false;
             prefijoDocumento.Enabled = false;
             aceptar.Enabled          = false;
         }
         else
         {
             //bind.PutDatasIntoDropDownList(prefijoDocumento, "SELECT pdoc_codigo,pdoc_descripcion FROM pdocumento WHERE tdoc_tipodocu='AT' and tvig_vigencia = 'V' ORDER BY pdoc_descripcion ");
             Utils.llenarPrefijos(Response, ref prefijoDocumento, "%", "%", "AT");
             if (prefijoDocumento.Items.Count > 1)
             {
                 prefijoDocumento.Items.Insert(0, "Seleccione:");
             }
             else
             {
                 prefijoDocumento_SelectedIndexChanged(sender, e);
             }
             //        numeroTesoreria.Text = DBFunctions.SingleData("SELECT pdoc_ultidocu+1 FROM pdocumento WHERE pdoc_codigo='" + prefijoDocumento.SelectedValue + "'");
             prefijoDocumento.Enabled = true;
             aceptar.Enabled          = true;
         }
     }
     holderAnulaciones.Controls.Add(LoadControl(pathToControls + "AMS.Tesoreria.ConsignaCheques.Anulaciones.ascx"));
 }
コード例 #11
0
        protected void Page_Init(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["pref"] != null && Request.QueryString["num"] != null)
                {
                    FormatosDocumentos formatoRecibo = new FormatosDocumentos();
                    formatoRecibo.Prefijo = Request.QueryString["pref"];
                    formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pref"] + "'");
                    formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["num"].ToString());
                    if (formatoRecibo.Cargar_Formato())
                    {
                        Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                    }
                    if (Request.QueryString["falloDoc"] == "1")
                    {
                        Utils.MostrarAlerta(Response, "Se ha realizado el proceso correctamente!! pero por un eror desconocido no ha sido posible archivar los documentos soporte, por favor contacte a ECAS");
                    }
                }

                DatasToControls bind = new DatasToControls();
                string          yr   = DBFunctions.SingleData("SELECT pano_ano FROM ccontabilidad");
                Int16           año  = Convert.ToInt16(yr);
                bind.PutDatasIntoDropDownList(year, "SELECT pano_ano, PANO_DETALLE FROM pano where pano_ano >= " + año + " order by 1 desc");
                DatasToControls.EstablecerDefectoDropDownList(year, yr);
                bind.PutDatasIntoDropDownList(month, "SELECT pmes_mes, pmes_nombre FROM pmes WHERE pmes_mes != 0 AND pmes_mes != 13 order by 1");
                string mt = DBFunctions.SingleData("SELECT pmes_mes FROM ccontabilidad");
                DatasToControls.EstablecerDefectoDropDownList(month, DBFunctions.SingleData("SELECT pmes_nombre FROM pmes WHERE pmes_mes=" + mt + ""));
                //month.SelectedIndex=month.Items.IndexOf(new ListItem(mt,mt));
                maVig.Text = "  " + month.SelectedItem + " - " + yr + " ";
                // Descarta los documentos que no esten vigentes y tambien los que NO son contables como las ordenes de trabajo o producción, cotizaciones y pedidos
                bind.PutDatasIntoDropDownList(typeDoc, "SELECT pdoc_codigo,pdoc_codigo concat ' - ' concat pdoc_nombre FROM pdocumento where tvig_vigencia='V' and tdoc_tipodocu not in ('CT','CV','PC','PV','PI','OP','OT') order by pdoc_CODIGO");
                //Utils.llenarPrefijos(Response, ref typeDoc, "%", "%", "%");
                //bind.PutDatasIntoDropDownList(typePlant, "SELECT pdoc_codigo,pdoc_codigo concat ' - ' concat pdoc_nombre FROM pdocumento where tvig_vigencia is null or tvig_vigencia='V' order by pdoc_nombre");
                Utils.llenarPrefijos(Response, ref typePlant, "%", "%", "%");
                bind.PutDatasIntoDropDownList(compPlant, "SELECT mcom_numedocu FROM mcomprobante WHERE pdoc_codigo='" + typePlant.SelectedValue + "'");
                string pathToImports = ConfigurationManager.AppSettings["PathToImports"] + "comprobantes";
                //DatasToControls bind4 = new DatasToControls("");
                //bind.BindFromDirIntoLB(compCOBOL, pathToImports);
                IFormatProvider culture = new System.Globalization.CultureInfo("es-CO", true);
                DateTime        nd      = DateTime.Now;
                try{ nd = new DateTime(Convert.ToInt16(year.SelectedValue), Convert.ToInt16(month.SelectedValue), 1); }catch {};
                //Button1.Attributes.Add("onclick","return ValidarFechaIngresoComprobante();");

                /*  validador de vigencia de documentos
                 *  PDOC_CODIGO ||'-'||PDOC_NOMBRE ||' LA RESOLUCION DE FACTURACION ESTA POR ACABARSE, FALTAN ' || (PDOC_NUMEFINA - PDOC_ULTIDOCU) ||' DOCUMENTOS'
                 *  FROM PDOCUMENTO WHERE (PDOC_NUMEFINA - PDOC_ULTIDOCU) IN (100,75,50,25,15,10,5,4,3,2,1) AND TDOC_TIPODOCU = 'FC';
                 *
                 *  SELECT PDOC_CODIGO||'-'|| PDOC_NOMBRE||' LA FECHA RESOLUCION DE FACTURACION ESTA POR VENCERSE, FALTAN ', DAYS(CURRENT DATE) -DAYS(PDOC_FINFECHRESOFACT) , ' DIAS'
                 *  FROM PDOCUMENTO WHERE (DAYS(CURRENT DATE) -DAYS(PDOC_FINFECHRESOFACT)) IN (30,20,15,10,5,4,3,2,1) AND TDOC_TIPODOCU = 'FC';
                 *
                 */
            }
        }
コード例 #12
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["pref"] != null && Request.QueryString["num"] != null)
                {
                    try
                    {
                        formatoRecibo.Prefijo = Request.QueryString["pref"];
                        formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["num"]);
                        formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pref"] + "'");
                        if (formatoRecibo.Codigo != string.Empty)
                        {
                            if (formatoRecibo.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                        formatoRecibo.Prefijo = Request.QueryString["pref"];
                        formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["num"]);
                        formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pref"] + "'");
                        if (formatoRecibo.Codigo != string.Empty)
                        {
                            if (formatoRecibo.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lb.Text += "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes + "<br>";
                    }
                }

                lb.Text = "";
            }
        }
コード例 #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Introducir aquí el código de usuario para inicializar la página
            this.Page.SmartNavigation = true;
            if (!Page.IsPostBack)
            {
                DatasToControls bind = new DatasToControls();
                bind.PutDatasIntoDropDownList(ddlEmbarque,
                                              "SELECT DISTINCT MEM.MEMB_SECUENCIA, MEM.MEMB_NUMEEMBA " +
                                              "FROM MEMBARQUE MEM,DEMBARQUECKD DEM " +
                                              "WHERE MEM.MEMB_SECUENCIA=DEM.MEMB_SECUENCIA AND MEM.PEST_ESTADO='P';");
                //bind.PutDatasIntoDropDownList(ddlPrefDoc,"SELECT pdoc_codigo from pdocumento where tdoc_tipodocu='FP';");
                Utils.llenarPrefijos(Response, ref ddlPrefDoc, "%", "%", "FP");
                txtFecha.Text = DateTime.Now.ToString("yyyy-MM-dd");
                CargarVehiculos();
                ddlEmbarque_SelectedIndexChanged(ddlEmbarque, e);
                ddlPrefDoc_SelectedIndexChanged(ddlPrefDoc, e);
                if (Request.QueryString["upd"] != null)
                {
                    Utils.MostrarAlerta(Response, "Se han nacionalizado los vehiculos.");
                }

                #region Reportes
                if (Request.QueryString["pref"] != null && Request.QueryString["num"] != null)
                {
                    FormatosDocumentos formatoFactura = new FormatosDocumentos();
                    Utils.MostrarAlerta(Response, "Se ha generado la factura con prefijo " + Request.QueryString["pref"] + " y número " + Request.QueryString["num"] + "");
                    try
                    {
                        formatoFactura.Prefijo = Request.QueryString["pref"];
                        formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["num"]);
                        formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pref"] + "'");
                        if (formatoFactura.Codigo != string.Empty)
                        {
                            if (formatoFactura.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lblInfo.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
                    }
                }
                #endregion Reportes
            }
        }
コード例 #14
0
        protected void generarInforme2(string prefijo, string numero)
        {
            FormatosDocumentos formatoRecibo = new FormatosDocumentos();

            try
            {
                formatoRecibo.Prefijo = prefijo;
                formatoRecibo.Numero  = Convert.ToInt32(numero);
                formatoRecibo.Codigo  = "FORSOLVEH";
                if (formatoRecibo.Cargar_Formato())
                {
                    Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                }
            }
            catch
            {
                lb.Text += "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes + "<br>";
            }
        }
コード例 #15
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.Page.SmartNavigation = true;
     Ajax.Utility.RegisterTypeForAjax(typeof(AMS_Vehiculos_DevolucionPedidoMayor));
     if (!IsPostBack)
     {
         DatasToControls bind = new DatasToControls();
         txtFechaFac.Text = DateTime.Now.ToString("yyyy-MM-dd");
         MostrarPanel(plcInfoFact);
         bind.PutDatasIntoDropDownList(ddlAlmacen, "SELECT palm_almacen, palm_descripcion FROM dbxschema.palmacen where (pcen_centvvn is not null  or pcen_centvvu is not null) and TVIG_VIGENCIA = 'V' order by palm_descripcion;");
         bind.PutDatasIntoDropDownList(prefijoFactura, "SELECT pd.pdoc_codigo, pd.pdoc_codigo concat ' - ' concat pd.pdoc_nombre FROM dbxschema.pdocumento pd, pdocumentohecho pdh WHERE pd.tdoc_tipodocu='NC' AND pd.pdoc_codigo=pdh.pdoc_codigo AND pdh.palm_almacen='" + ddlAlmacen.SelectedValue + "' AND pdh.tpro_proceso='VN';");
         //bind.PutDatasIntoDropDownList(ddlFacturaD,"SELECT pd.pdoc_codigo, pd.pdoc_codigo concat ' - ' concat pd.pdoc_nombre FROM dbxschema.pdocumento pd, pdocumentohecho pdh WHERE pd.tdoc_tipodocu='FC' AND pd.pdoc_codigo=pdh.pdoc_codigo AND pdh.tpro_proceso='VN';");
         Utils.llenarPrefijos(Response, ref ddlFacturaD, "VN", "%", "FC");
         bind.PutDatasIntoDropDownList(ddlIVAFletes, "SELECT PIVA_PORCIVA,PIVA_DECRETO FROM PIVA ORDER BY PIVA_PORCIVA;");
         CambioTipoFacturacion(sender, e);
         //Impresion
         if (Request.QueryString["prefFC"] != null)
         {
             Utils.MostrarAlerta(Response, "Se ha creado la devolucion de cliente por venta mayor con prefijo " + Request.QueryString["prefFC"] + " y el número " + Request.QueryString["numFC"] + ".");
             FormatosDocumentos formatoRecibo = new FormatosDocumentos();
             try
             {
                 formatoRecibo.Prefijo = Request.QueryString["prefFC"];
                 formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["numFC"]);
                 formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefFC"] + "'");
                 if (formatoRecibo.Codigo != string.Empty)
                 {
                     if (formatoRecibo.Cargar_Formato())
                     {
                         Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                     }
                 }
             }
             catch
             {
                 lb.Text += "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes + "<br>";
             }
         }
     }
 }
コード例 #16
0
        protected void Page_Load(object sender, System.EventArgs e)
		{
			if(!IsPostBack)
			{
                
				if(Request.QueryString["subprocess"]=="Fact")
				{
					plRow1.Visible = true;
					if(Request.QueryString["factGen"] != null)
					{
                        Utils.MostrarAlerta(Response, "Se ha creado la factura con prefijo " + Request.QueryString["prefF"] + " y número " + Request.QueryString["numF"] + ".!");
						formatoFactura=new FormatosDocumentos();
						try
						{
							formatoFactura.Prefijo=Request.QueryString["prefF"];
							formatoFactura.Numero=Convert.ToInt32(Request.QueryString["numF"]);
							formatoFactura.Codigo=DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='"+Request.QueryString["prefF"]+"'");
							if(formatoFactura.Codigo!=string.Empty)
							{
								if(formatoFactura.Cargar_Formato())
									Response.Write("<script language:javascript>w=window.open('"+formatoFactura.Documento+"','','HEIGHT=600,WIDTH=800');</script>");
							}
						}
						catch
						{
							lb.Text="Error al generar el formato. Detalles : <br>"+formatoFactura.Mensajes;
						}
					}
				}
				else if(Request.QueryString["subprocess"]=="Mod")
				{
					plRow2.Visible = true;
					DatasToControls bind = new DatasToControls();
					bind.PutDatasIntoDropDownList(this.ddlNLis,"SELECT mlis_numero FROM mlistaempaque ORDER BY 1");
					btnFacturar.Text = "Modificar";
				}
			}
		}
コード例 #17
0
        protected void Generar_Formato_Salida(Object Sender, EventArgs e)
        {
            if (vehiculo.Items.Count > 0)
            {
                //string prefPedido = DBFunctions.SingleData("SELECT pdoc_codigo FROM masignacionvehiculo WHERE mveh_inventario="+vehiculo.SelectedValue+"");
                //string numePedi = DBFunctions.SingleData("SELECT mped_numepedi FROM masignacionvehiculo WHERE mveh_inventario="+vehiculo.SelectedValue+"");

                DataSet ds = new DataSet();
                DBFunctions.Request(ds, IncludeSchema.NO, "SELECT pdoc_codigo,mped_numepedi FROM masignacionvehiculo WHERE mveh_inventario=" + vehiculo.SelectedValue);
                int lastRow = ds.Tables[0].Rows.Count - 1;

                string prefPedido = ds.Tables[0].Rows[lastRow][0].ToString();
                string numePedi   = ds.Tables[0].Rows[lastRow][1].ToString();

                try
                {
                    formatoRecibo.Prefijo = prefPedido;
                    formatoRecibo.Numero  = Convert.ToInt32(numePedi);
                    formatoRecibo.Codigo  = "FORENTRVEH";
                    if (formatoRecibo.Codigo != string.Empty)
                    {
                        if (formatoRecibo.Cargar_Formato())
                        {
                            Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                        }
                    }
                }
                catch
                {
                    lb.Text += "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes + "<br>";
                }
                //Response.Redirect("" + indexPage + "?process=Vehiculos.EntregaVehiculosFormulario&prefPedi="++"&numePedi="++"&tipPro=G&numeDocu="+numeDocu+"");
            }
            else
            {
                Utils.MostrarAlerta(Response, "No se ha escogido ningún vehículo");
            }
        }
コード例 #18
0
        protected void ImprimirFormato(Object prefijo, Object numero)
        {
            FormatosDocumentos formatoFactura = new FormatosDocumentos();

            try
            {
                formatoFactura.Prefijo = Convert.ToString(prefijo);
                formatoFactura.Numero  = Convert.ToInt32(numero);
                formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + formatoFactura.Prefijo + "'");
                if (formatoFactura.Codigo != string.Empty)
                {
                    if (formatoFactura.Cargar_Formato())
                    {
                        Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                    }
                }
            }
            catch
            {
                //   lblError.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
                //  Response.Write("<script language:javascript>alert('Error al generar el formato.');</script>");
            }
        }
コード例 #19
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Ajax.Utility.RegisterTypeForAjax(typeof(RemisionAlmacenes));

            if (!IsPostBack)
            {
                if (Request["prefRem"] != String.Empty && Request["numRem"] != String.Empty)
                {
                    formatoRecibo.Prefijo = Request["prefRem"];
                    formatoRecibo.Numero  = Convert.ToInt32(Request["numRem"]);
                    formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM pdocumento WHERE pdoc_codigo='" + Request["prefRem"] + "'");
                    if (formatoRecibo.Cargar_Formato())
                    {
                        Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                    }
                }
                Session.Clear();
                DatasToControls bind = new DatasToControls();
                //bind.PutDatasIntoDropDownList(ddlPrefRemi,"SELECT pdoc_codigo, pdoc_nombre FROM pdocumento WHERE tdoc_tipodocu='RA' AND TVIG_VIGENCIA = 'V'");
                Utils.llenarPrefijos(Response, ref ddlPrefRemi, "%", "%", "RA");
                bind.PutDatasIntoDropDownList(ddlAlmaOrigen, "SELECT palm_almacen, palm_descripcion FROM palmacen WHERE PCEN_CENTINV IS NOT NULL and tvig_vigencia='V' ORDER BY PALM_DESCRIPCION");
                bind.PutDatasIntoDropDownList(ddlAlmaDestino, "SELECT palm_almacen, palm_descripcion FROM palmacen WHERE PCEN_CENTINV IS NOT NULL and tvig_vigencia='V' ORDER BY PALM_DESCRIPCION");
                bind.PutDatasIntoDropDownList(ddlVendedor, "SELECT pven_codigo, pven_nombre FROM pvendedor WHERE tvend_codigo='VM' and pven_vigencia = 'V'");
                tbNumRemi.Text = DBFunctions.SingleData("SELECT pdoc_ultidocu + 1 FROM pdocumento WHERE pdoc_codigo='" + ddlPrefRemi.SelectedValue + "'");
                PrepararDtItems();
                BindDgItems();
            }
            if (Session["dtItems"] == null)
            {
                this.PrepararDtItems();
            }
            else
            {
                dtItems = (DataTable)Session["dtItems"];
            }
        }
コード例 #20
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Ajax.Utility.RegisterTypeForAjax(typeof(AMS.Vehiculos.PedidoClientes));
            if (Request.QueryString["cont"] == "1")
            {
                txtContrasena.Visible = false;
                lContrasena.Visible   = false;
            }
            if (Request.QueryString["modificado"] == "1")
            {
                Utils.MostrarAlerta(Response, "Pedido Modificado Exitosamente");
            }

            if (!IsPostBack)
            {
                DatasToControls bind           = new DatasToControls();
                string          modificaPedido = "";
                try
                {
                    modificaPedido = DBFunctions.SingleData("select cveh_modifica from DBXSCHEMA.CVEHICULOS;");
                }
                catch (Exception err)
                { }

                if (modificaPedido == "N")
                {
                    plcVendedor.Visible = true;
                }
                else
                {
                    Cambio_Prefijo(null, null);
                    bind.PutDatasIntoDropDownList(prefijoDocumento, string.Format(Documento.DOCUMENTOSTIPO, "PC"));
                    if (prefijoDocumento.Items.Count > 1)
                    {
                        prefijoDocumento.Items.Insert(0, "Seleccione:");
                    }
                }

                string nitCliente = "", nitClienteAlterno = "";

                if (Request.QueryString["cod_vend"] != null)
                {
                    bind.PutDatasIntoDropDownList(ddlVendedorAutenticacion, "select pven_codigo, pven_nombre from pvendedor where pven_codigo = '" + Request.QueryString["cod_vend"] + "'");
                    validaDatos(sender, e);
                }
                else
                {
                    bind.PutDatasIntoDropDownList(ddlVendedorAutenticacion, AMS.Vehiculos.Vendedores.VENDEDORESVEHICULOS);
                }
                if (Request.QueryString["prefP"] != null)
                {
                    Utils.MostrarAlerta(Response, "Se ha creado el pedido de cliente vehiculo con prefijo " + Request.QueryString["prefP"] + " y el número " + Request.QueryString["numped"] + ".");
                    try
                    {
                        formatoRecibo.Prefijo = Request.QueryString["prefP"];
                        formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["numped"]);
                        formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefP"] + "'");
                        if (formatoRecibo.Codigo != string.Empty)
                        {
                            if (formatoRecibo.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                        imprimir_carta(Request.QueryString["prefP"], Request.QueryString["numped"]);
                    }
                    catch
                    {
                        lb.Text += "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes + "<br>";
                    }

                    try
                    {
                        DataSet datosNit = new DataSet();
                        DBFunctions.Request(datosNit, IncludeSchema.NO, "Select mnit_nit,mnit_nit2 from DBXSCHEMA.MPEDIDOVEHICULO MP WHERE PDOC_CODIGO = '" + formatoRecibo.Prefijo + "' AND MPED_NUMEPEDI = " + formatoRecibo.Numero + " ");
                        if (datosNit.Tables.Count == 1 && datosNit.Tables[0].Rows[0][0].ToString() != "")
                        {
                            nitCliente        = datosNit.Tables[0].Rows[0][0].ToString();
                            nitClienteAlterno = datosNit.Tables[0].Rows[0][1].ToString();
                        }
                    }
                    catch
                    {
                        nitCliente        = "";
                        nitClienteAlterno = "";
                    }
                    // ActualizarFichaCliente(nitCliente, nitClienteAlterno);  se está reventando ver porque
                }
            }
            if (Request.QueryString["nitCli"] != null && Request.QueryString["nombreCli"] != null) // && Request.QueryString["idDBCli"] != null
            {
                //string fecha1 = DateTime.Now.AddMonths(-6).ToString("yyyy-MM-dd");
                //string fecha2 = DateTime.Now.ToString("yyyy-MM-dd");

                //si esta persona ya le hicieron el Habeas data en un rango de 6 meses a partir de hoy, no es necesario volverle a hacer el Habeas data
                //if (DBFunctions.RecordExist("SELECT MNIT_NIT FROM MBASEDATOS WHERE MNIT_NIT = '" + Request.QueryString["nitCli"] + "' AND MBAS_FECHA BETWEEN '" + fecha1 + "' AND '" + fecha2 + "' AND "))
                //{
                //    return;
                //}
                Session["tipoDB"]    = "FV"; // Request.QueryString["idDBCli"];
                Session["nit"]       = Request.QueryString["nitCli"];
                Session["nombre"]    = Request.QueryString["nombreCli"];
                plcAutorizar.Visible = true;
                autorizar.Visible    = true;
                plcAutorizar.Controls.Add(LoadControl(pathToControls + "AMS.Tools.AutorizacionCliente.ascx"));
                string baseNit = DBFunctions.SingleData("select MNIT_NIT from mbasedatos where TBAS_CODIGO  ='" + Session["tipoDB"] + "' AND MNIT_NIT = '" + Session["nit"] + "' ");
                if (baseNit != "" || (Session["finAutorizar"] != null && IsPostBack))
                {
                    plcAutorizar.Visible = false;
                    autorizar.Visible    = false;
                }
            }

            imglupa.Attributes.Add("OnClick", "ModalDialog(" + numeroPedido.ClientID + ",'SELECT rtrim(CAST(mped_numepedi as char(10))) as pedido FROM mpedidovehiculo WHERE pdoc_codigo=\\'" + prefijoDocumento.SelectedValue + "\\' AND test_tipoesta not in (40,60) order by mped_numepedi' ,new Array() );");
        }
コード例 #21
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Introducir aquí el código de usuario para inicializar la página
            Page.SmartNavigation = true;
            if (!Page.IsPostBack)
            {
                DatasToControls bind = new DatasToControls();
                bind.PutDatasIntoDropDownList(ddlCuentaEditar, "SELECT PCUE_CODIGO, PCUE_NOMBRE CONCAT ' (' CONCAT PCUE_CODIGO CONCAT ' - ' CONCAT PCUE_NUMERO CONCAT ')' FROM PCUENTACORRIENTE ORDER BY PCUE_NOMBRE;");
                bind.PutDatasIntoDropDownList(ddlCreditoEditar, "SELECT MOBL_NUMERO FROM MOBLIGACIONFINANCIERA WHERE PCUE_CODIGO='" + ddlCuentaEditar.SelectedValue + "' ORDER BY MOBL_NUMERO;");

                bind.PutDatasIntoDropDownList(ddlCuenta, "SELECT PCUE_CODIGO, PCUE_NOMBRE CONCAT ' (' CONCAT PCUE_CODIGO CONCAT ' - ' CONCAT PCUE_NUMERO CONCAT ')' FROM PCUENTACORRIENTE ORDER BY PCUE_NOMBRE;");
                //bind.PutDatasIntoDropDownList(ddlDocumento,"SELECT PDOC_CODIGO, PDOC_NOMBRE FROM PDOCUMENTO WHERE TDOC_TIPODOCU='ND' ORDER BY PDOC_NOMBRE;");
                Utils.llenarPrefijos(Response, ref ddlDocumento, "%", "%", "ND");
                lblNumDocumento.Text = DBFunctions.SingleData("SELECT PDOC_ULTIDOCU+1 FROM PDOCUMENTO WHERE PDOC_CODIGO='" + ddlDocumento.SelectedValue + "';");

                bind.PutDatasIntoDropDownList(ddlAlmacen, "SELECT PALM_ALMACEN, PALM_DESCRIPCION FROM PALMACEN where (pcen_centcart is not null  or pcen_centteso is not null) and tvig_vigencia='V' order by palm_descripcion;");
                bind.PutDatasIntoDropDownList(ddlTipoCredito, "SELECT PCRE_CODIGO, PCRE_NOMBRE FROM PCREDITOBANCARIO ORDER BY PCRE_NOMBRE;");
                bind.PutDatasIntoDropDownList(ddlTipoTasa, "SELECT PTAS_CODIGO, PTAS_NOMBRE concat ' (' concat rtrim(char(ptas_monto)) concat ')' FROM PTASACREDITO ORDER BY PTAS_NOMBRE;");
                bind.PutDatasIntoDropDownList(ddlCondicion, "SELECT TCON_CODIGO, TCON_NOMBRE FROM TCONDICIONCREDITOBANCARIO ORDER BY TCON_NOMBRE;");
                CrearTablas();
                Bind();
                if (Request.QueryString["upd"] != null)
                {
                    Response.Write("<script language:javascript>alert('Las obligaciones financieras se han actualizado');</script>");

                    if (Request["prf"] != null && Request["num"] != null)
                    {
                        FormatosDocumentos formatoFactura = new FormatosDocumentos();
                        try
                        {
                            formatoFactura.Prefijo = Request.QueryString["prf"];
                            formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["num"]);
                            formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prf"] + "'");
                            if (formatoFactura.Codigo != string.Empty)
                            {
                                if (formatoFactura.Cargar_Formato())
                                {
                                    Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                                }
                            }

                            formatoFactura.Codigo = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prf"] + "'");
                            if (formatoFactura.Codigo != string.Empty)
                            {
                                if (formatoFactura.Cargar_Formato())
                                {
                                    Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                                }
                            }
                        }
                        catch
                        {
                            lblInfo.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
                        }
                    }
                }
            }
            else
            {
                dtDesembolsos = (DataTable)ViewState["DT_DESEMBOLSOS"];
                dtPagos       = (DataTable)ViewState["DT_PAGOS"];
            }
        }
コード例 #22
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Tipo = Request.QueryString["actor"];            //carga el tipo de de registro a realizar
            //this.ClearChildViewState();
            LoadDataColumns();
            string nLis1 = Request.QueryString["nped"];             //Numero de lista de empaque

            string[] nLis = nLis1.ToString().Split('-');
            kit     = Request.QueryString["kitPed"]; //Numero de lista de empaque
            AnoA    = Request.QueryString["AnoA"];
            almacen = Request.QueryString["almacen"];
            if (nLis1.Length == 0)//Si no es valido el numero de lista de empaque que no haga nada
            {
                return;
            }

            //string centavos = ConfigurationManager.AppSettings["ManejoCentavos"];
            //if (Utils.EsEntero(centavos))
            //    numDecimales = Convert.ToInt32(centavos);

            try { numDecimales = Convert.ToInt16(DBFunctions.SingleData("select cinv_numedeci from cinventario")); }
            catch (Exception er) { numDecimales = 2; }

            if (!IsPostBack)
            {
                //Impimir trasnferencia:
                if (Request.QueryString["prefPed"] != null)
                {
                    FormatosDocumentos formatoFactura = new FormatosDocumentos();
                    try
                    {
                        formatoFactura.Prefijo = Request.QueryString["prefPed"];
                        formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["numPed"]);
                        formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefPed"] + "'");
                        if (formatoFactura.Codigo != string.Empty)
                        {
                            if (formatoFactura.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lbInfo.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
                    }
                }

                Session.Clear();
                dgItems.EditItemIndex = -1;
                DatasToControls bind = new DatasToControls();
                hdCargoTrans.Value = DBFunctions.SingleData("SELECT DISTINCT MPD.tcar_cargo FROM   dbxschema.mpedidotransferencia MPD INNER JOIN dbxschema.mpedidoitem MPI ON MPD.pped_codigo=MPI.pped_codigo AND MPD.mped_numero=MPI.mped_numepedi INNER JOIN dbxschema.dlistaempaque DLIS ON MPI.pped_codigo=DLIS.pped_codigo AND MPI.mped_numepedi=DLIS.mped_numepedi WHERE DLIS.mlis_numero=" + nLis[0] + "");
                bind.PutDatasIntoDropDownList(ddlAlmacen, "SELECT palm_almacen, palm_descripcion FROM palmacen WHERE PCEN_CENTINV IS NOT NULL and tvig_vigencia='V' ORDER BY PALM_DESCRIPCION");
                bind.PutDatasIntoDropDownList(ddlPIVA, "SELECT piva_porciva, piva_decreto FROM piva order by 2");                                                                   //Porcentaje de IVA
                string tp = DBFunctions.SingleData("SELECT t1.tped_codigo from PPEDIDO as t1, DLISTAEMPAQUE t2 WHERE t1.pped_codigo=t2.pped_codigo and t2.mlis_numero=" + nLis[0]); //Tipo de pedido
                ViewState["tipoPedido"] = tipoPedido = tp;
                PublicarInformacionVendedor(nLis);

                if (tp == "T")
                {
                    //Si es transferencia de taller se trae un documento tipo transferencia de taller y adicionalmente se bloquean los campos de texto de fletes, ni iva de fletes

                    Utils.llenarPrefijos(Response, ref ddlCodDoc, "%", ddlAlmacen.SelectedValue, "TT");
                    txtFlet.Enabled = ddlPIVA.Enabled = false;
                }
                else if (tp == "E")
                {
                    //Si es CONSUMO INTERNO  se trae un documento tipo CONSUMO INTERNO E  y adicionalmente se bloquean los campos de texto de fletes, ni iva de fletes
                    Utils.llenarPrefijos(Response, ref ddlCodDoc, "%", ddlAlmacen.SelectedValue, "CI");
                    txtFlet.Enabled = ddlPIVA.Enabled = false;
                }
                else
                {
                    //Si no es una transferencia se traen documentos de tipo factura cliente
                    //   falta filtrar por almacen
                    Utils.llenarPrefijos(Response, ref ddlCodDoc, "IC", ddlAlmacen.SelectedValue, "FC");
                    txtFlet.Enabled = ddlPIVA.Enabled = true;
                }


                IFormatProvider culture = new System.Globalization.CultureInfo("es-CO", true);
                tbDate.Text = DateTime.Now.GetDateTimeFormats()[6];
                //tbDate.Text = DateTime.Now;
                ds = new DataSet();
                for (int i = 0; i < nLis.Length - 1; i++)
                {
                    DBFunctions.Request(ds, IncludeSchema.NO, "SELECT t1.mnit_nit,t1.mnit_nombres concat ' ' concat t1.mnit_apellidos, t2.palm_almacen from MNIT as t1,MLISTAEMPAQUE as t2 WHERE t1.MNIT_NIT=t2.MNIT_NIT AND t2.MLIS_NUMERO=" + nLis[i] + "");
                    //Observacion (PRIMERA ENCONTRADA EN LOS PEDIDOS DE LA LISTA DE EMPAQUE)
                    txtObs.Text += DBFunctions.SingleData(
                        @"SELECT MP.MPED_OBSERVACION  
		                FROM MPEDIDOITEM MP, DLISTAEMPAQUE DL  
					   WHERE DL.MLIS_NUMERO="                     + nLis[i] + @" AND DL.PPED_CODIGO=MP.PPED_CODIGO AND DL.MPED_NUMEPEDI=MP.MPED_NUMEPEDI  
					FETCH FIRST 1 ROWS ONLY;"
                        );
                }
                try
                {
                    txtNIT.Text  = ds.Tables[0].Rows[0][0].ToString();
                    txtAlm.Text  = ds.Tables[0].Rows[0][2].ToString();
                    txtNITa.Text = ds.Tables[0].Rows[0][1].ToString();
                }
                catch {}
                //Ahora cargamos los dias de plazo que tiene este cliente
                if (DBFunctions.SingleData("SELECT coalesce(mcli_diasplaz,0) FROM mcliente WHERE mnit_nit='" + txtNIT.Text + "'").Length > 0)
                {
                    txtDiasP.Text = DBFunctions.SingleData("SELECT coalesce(mcli_diasplaz,0) FROM mcliente WHERE mnit_nit='" + txtNIT.Text + "'");
                }
                else
                {
                    txtDiasP.Text = "0";
                }

                //txtFlet.Attributes.Add("onkeyup", "NumericMask(" + txtFlet.ClientID + ");");
                txtFlet.Attributes.Add("onkeyup", "CalculoIva(" + txtFlet.ClientID + "," + ddlPIVA.ClientID + "," + tbIvaFlts.ClientID + "," + txtTotIF.ClientID + ",'" + txtTotal.ClientID + "','" + txtGTot.ClientID + "');");
                ddlPIVA.Attributes.Add("onchange", "CambioIva(" + txtFlet.ClientID + "," + ddlPIVA.ClientID + "," + tbIvaFlts.ClientID + "," + txtTotIF.ClientID + ",'" + txtTotal.ClientID + "','" + txtGTot.ClientID + "');");
            }
            txtNumDoc.Text = DBFunctions.SingleData("SELECT pdoc_ultidocu+1 FROM pdocumento WHERE pdoc_codigo='" + ddlCodDoc.SelectedValue + "'");
            tipoPedido     = ViewState["tipoPedido"].ToString();
            if (Session["dtInsertsF"] == null)
            {
                LlenarTabla();
            }
            else
            {
                dtInserts = (DataTable)Session["dtInsertsF"];
                //BindDatas();
            }
            if (dtInserts.Rows.Count == 0)
            {
                LlenarTabla();
            }
        }
コード例 #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Session.Clear();
                if (ddlOpciVehiDetalle.Items.Count <= 0)
                {
                    ddlOpciVehiDetalle.Enabled = false;
                    ddlOpciVehiDetalle.Items.Insert(0, new ListItem("Sin detalle..", "0"));
                }
                try
                {
                    bind.PutDatasIntoDropDownList(ddlPrefijo, "SELECT PDOC_CODIGO, PDOC_NOMBRE FROM PDOCUMENTO WHERE TDOC_TIPODOCU = 'OS'");
                    ddlPrefijo.Items.Insert(0, new ListItem("Seleccione...", string.Empty));
                    bind.PutDatasIntoDropDownList(ddlPrefEdit, "SELECT PDOC_CODIGO, PDOC_NOMBRE FROM PDOCUMENTO WHERE TDOC_TIPODOCU = 'OS'");
                    ddlPrefEdit.Items.Insert(0, new ListItem("Seleccione...", string.Empty));
                }
                catch { }
                string prefijo   = Request.QueryString["codor"];
                string numero    = Request.QueryString["numord"];
                string eliminado = Request.QueryString["Elim"];
                string editado   = Request.QueryString["Edit"];
                if (prefijo != null && numero != null)
                {
                    try
                    {
                        Utils.MostrarAlerta(Response, "se ha creado la orden de tramite con preijo " + Request.QueryString["codor"] + " y numero " + Request.QueryString["numord"] + "");
                        formatoRecibo.Prefijo = Request.QueryString["codor"];
                        formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["numord"]);
                        formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["codor"] + "'");
                        if (formatoRecibo.Codigo != string.Empty)
                        {
                            if (formatoRecibo.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lberror.Text += "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes + "<br>";
                    }
                }
                if (eliminado == "OK")
                {
                    Utils.MostrarAlerta(Response, "Proceso Realizado Satisfactoriamente");
                }
                if (editado == "ok")
                {
                    Utils.MostrarAlerta(Response, "Proceso Realizado Satisfactoriamente");
                }

                this.Preparar_Tabla_Elementos();
                this.Binding_Grilla();
            }
            else
            {
                if (Session["tablaElementos"] == null)
                {
                    this.Preparar_Tabla_Elementos();
                    this.Binding_Grilla();
                }
                else
                {
                    tablaElementos            = (DataTable)Session["tablaElementos"];
                    Session["tablaElementos"] = tablaElementos;
                }
            }
        }
コード例 #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Ajax.Utility.RegisterTypeForAjax(typeof(AMS.Vehiculos.RecepcionFisica));

            if (!IsPostBack)
            {
                if (Request.QueryString["ok"] != null)
                {
                    Utils.MostrarAlerta(Response, "Se ha realizado la recepción física correctamente! \\n Prefijo Recepción: " + Request.QueryString["pref"] + " - " + Request.QueryString["num"] + "\\n Prefijo orden: " + Request.QueryString["prefOT"] + " - " + Request.QueryString["numOT"]);
                    try
                    {
                        formatoRecibo.Prefijo = Request.QueryString["pref"];
                        formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["num"]);
                        formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pre"] + "'");
                        if (formatoRecibo.Codigo != string.Empty)
                        {
                            if (formatoRecibo.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=600');</script>");
                            }
                        }
                        formatoRecibo.Prefijo = Request.QueryString["prefOT"];
                        formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["numOT"]);
                        formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefOT"] + "'");
                        if (formatoRecibo.Codigo != string.Empty)
                        {
                            if (formatoRecibo.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=500');</script>");
                            }
                        }
                    }
                    catch
                    {
                        Utils.MostrarAlerta(Response, "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes + "<br>" + "Los formatos pueden ser impresos por la opción Impresión<br>");
                    }
                }

                DatasToControls bind = new DatasToControls();
                bind.PutDatasIntoDropDownList(ddlAlmacen, "SELECT palm_almacen, palm_descripcion FROM palmacen WHERE pcen_centvvn is not null and TVIG_VIGENCIA = 'V' or pcen_centvvu is not null ORDER BY palm_descripcion");
                if (ddlAlmacen.Items.Count > 1)
                {
                    ddlAlmacen.Items.Insert(0, new ListItem("Seleccione...", "0"));
                }

                bind.PutDatasIntoDropDownList(ddlCatalogo, "SELECT PP.PCAT_CODIGO, PP.PCAT_CODIGO || ' - ' || PC.PCAT_DESCRIPCION FROM PCATALOGOVEHICULO PC, PPRECIOVEHICULO PP WHERE PC.PCAT_CODIGO = PP.PCAT_CODIGO; ");
                if (ddlCatalogo.Items.Count > 1)
                {
                    ddlCatalogo.Items.Insert(0, new ListItem("Seleccione...", "0"));
                }

                bind.PutDatasIntoDropDownList(ddlColor, "SELECT pcol_codigo, pcol_descripcion concat ' - [' concat ptip_descripcion concat ']' DESCRIPCION " +
                                              "FROM dbxschema.pcolor pcol inner join dbxschema.ptipopintura ptpi on pcol.ptip_codigo = ptpi.ptip_codigo ORDER BY pcol_descripcion;");
                if (ddlColor.Items.Count > 1)
                {
                    ddlColor.Items.Insert(0, new ListItem("Seleccione...", "0"));
                }

                bind.PutDatasIntoDropDownList(ddlServicio, "SELECT * from tserviciovehiculo ORDER BY tser_tiposerv");
                if (ddlServicio.Items.Count > 1)
                {
                    ddlServicio.Items.Insert(0, new ListItem("Seleccione...", "0"));
                }

                bind.PutDatasIntoDropDownList(ddlOpcion, "SELECT POPC_OPCIVEHI, POPC_OPCIVEHI || ' - ' || POPC_NOMBOPCI FROM DBXSCHEMA.POPCIONVEHICULO");
                if (ddlOpcion.Items.Count > 0)
                {
                    ddlOpcion.Items.Insert(0, new ListItem("Seleccione...", "0"));
                }

                DataSet dtAccesorios = new DataSet();
                //    DBFunctions.Request(dtAccesorios, IncludeSchema.NO, "select PREC_PRECID AS CODIGO, PREC_PRECNOMB AS NOMBRE from precepcionaccesorio;");
                DBFunctions.Request(dtAccesorios, IncludeSchema.NO, "select pacc_codigo as CODIGO, PACC_DESCRIPCION AS NOMBRE FROM paccesorio;");

                if (dtAccesorios != null && dtAccesorios.Tables[0].Rows.Count > 0)
                {
                    grdAccesorios.DataSource = dtAccesorios;
                    grdAccesorios.DataBind();
                }
                else
                {
                    Utils.MostrarAlerta(Response, "Por favor parametrizar los accesorios para registrar en la recepción física del vehículo!");
                }
            }
            else
            {
                string   tales   = Request["__EVENTARGUMENT"];
                string[] otroTal = Request["__EVENTTARGET"].ToString().Split(',');
                if (tales.Length > 0)
                {
                    ViewState["datos"]         = tales;
                    ViewState["posAccesorios"] = otroTal;
                    BtnRegistrar_Click(sender, e);
                }
            }
        }
コード例 #25
0
        //LOAD--------------------------------------------------------
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Ajax.Utility.RegisterTypeForAjax(typeof(AMS_Produccion_EntradasProduccion));
            dtItems = (DataTable)ViewState["dtItems"];
            if (!IsPostBack)
            {
                IFormatProvider culture = new System.Globalization.CultureInfo("es-CO", true);
                bind.PutDatasIntoDropDownList(ddlAlmacen, "SELECT PA.palm_almacen, PA.palm_descripcion FROM PALMACEN PA, MPLANTAS MP WHERE PA.palm_almacen=MP.mpla_codigo;");
                bind.PutDatasIntoDropDownList(ddlVendedor, string.Format(Almacen.VENDEDORESPORALMACEN, ddlAlmacen.SelectedValue));
                //bind.PutDatasIntoDropDownList(ddlPrefE, string.Format(Documento.DOCUMENTOSTIPOHECHO, "FP", "IP", ddlAlmacen.SelectedValue));
                string sede = ddlAlmacen.SelectedValue.ToString();
                Utils.llenarPrefijos(Response, ref ddlPrefE, "IP", sede, "FP");
                if (ddlPrefE.Items.Count > 0)
                {
                    txtNumFacE.Text = DBFunctions.SingleData(string.Format(Documento.PROXIMODOCUMENTO, ddlPrefE.SelectedValue));
                }
                else
                {
                    txtNumFacE.Text = "0";
                    Utils.MostrarAlerta(Response, "Usted NO HO configurado un documento del tipo FACTURA PROVEEDOR para el proceso PROCESOS PRODUCCION en esta sede, configurelo ...! ");
                    return;
                }
                bind.PutDatasIntoDropDownList(ddlPIVA, "SELECT piva_porciva, piva_decreto FROM piva ORDER BY piva_porciva");
                //bind.PutDatasIntoDropDownList(ddlPrefOrden,"SELECT pdoc_codigo from pdocumento where tdoc_tipodocu='OP';");
                Utils.llenarPrefijos(Response, ref ddlPrefOrden, "%", "%", "OP");
                bind.PutDatasIntoDropDownList(ddlNumOrden, "SELECT mord_numeorde from mordenproduccion where pdoc_codigo='" + ddlPrefOrden.SelectedValue + "' and test_estado='A' and mord_tipo='P' order by mord_numeorde;");
                tbDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
                //txtFlet.Attributes.Add("onkeyup","CalculoIva("+txtFlet.ClientID+","+ddlPIVA.ClientID+","+txtTotIF.ClientID+",'"+txtTotal.ClientID+"','"+txtGTot.ClientID+"');");
                //ddlPIVA.Attributes.Add("onchange","CambioIva("+txtFlet.ClientID+","+ddlPIVA.ClientID+","+txtTotIF.ClientID+",'"+txtTotal.ClientID+"','"+txtGTot.ClientID+"');");
                txtFlet.Attributes.Add("onkeyup", "NumericMaskE(this,event);Totales();");
                txtTotalExternos.Attributes.Add("onkeyup", "NumericMaskE(this,event);Totales();");
                txtDesc.Attributes.Add("onkeyup", "NumericMaskE(this,event);Totales();");
                txtIVA.Attributes.Add("onkeyup", "NumericMaskE(this,event);Totales();");
                txtTotal.Attributes.Add("onkeyup", "NumericMaskE(this,event);Totales();");
                ddlPIVA.Attributes.Add("onchange", "Totales();");
                CambiaProceso(sender, e);
                plcTotales.Visible = false;

                //Cierre de orden de producción
                Utils.llenarPrefijos(Response, ref ddlPrefijoAjuste, "%", "%", "AJ");
                ddlPrefijoAjuste_OnSelectedIndexChanged(null, null);

                #region Reportes
                if (Request.QueryString["pref"] != null && Request.QueryString["num"] != null)
                {
                    FormatosDocumentos formatoFactura = new FormatosDocumentos();
                    Utils.MostrarAlerta(Response, "Se ha generado la factura con prefijo " + Request.QueryString["pref"] + " y número " + Request.QueryString["num"] + "");
                    try
                    {
                        formatoFactura.Prefijo = Request.QueryString["pref"];
                        formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["num"]);
                        formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pref"] + "'");
                        if (formatoFactura.Codigo != string.Empty)
                        {
                            if (formatoFactura.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lbInfo.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
                    }
                }

                //Si se cerró la orden de producción
                if (Request.QueryString["act"] != null)
                {
                    Utils.MostrarAlerta(Response, "La orden ha sido cerrada");
                    Imprimir.ImprimirRPT(Response, Request.QueryString["prefA"], Convert.ToInt32(Request.QueryString["numA"]), true);
                }

                #endregion Reportes
            }
        }
コード例 #26
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Ajax.Utility.RegisterTypeForAjax(typeof(LiquidacionOrden));
            TorreControl.Visible = LiquidacionOT.Visible = false;
            tipoProceso          = Request.QueryString["actor"]; //Debe definir el tipo de proceso: Torre de Control / Liquidacion OT
            if (tipoProceso == "T")
            {
                TorreControl.Visible = true;
            }
            else
            {
                if (tipoProceso == "F")
                {
                    LiquidacionOT.Visible = true;
                }
                else
                {
                    TorreControl.Visible = LiquidacionOT.Visible = true;
                }
            }
            //    Session["tipoProceso"] = tipoProceso.ToString();

            //botones q hace la confirmacion de los datos y cancela el boton para q no se produzca. doble facturacion o etc
            if (!IsPostBack)
            {
                double factorDeducible = 0;
                //try
                //{
                //    factorDeducible = Convert.ToDouble(DBFunctions.SingleData("SELECT MFAC_FACTORDEDUCIBLE FROM MFACTURACLIENTETALLER FETCH FIRST 1 ROWS ONLY;"));
                //}
                //catch
                //{
                //    Utils.MostrarAlerta(Response, "NO se ha creado el campo MFAC_FACTORDEDUCIBLE en MF...TALLER, llamar a eCAS antes de continuar !!! ");
                //    return;
                //}

                DatasToControls bind = new DatasToControls();
                //bind.PutDatasIntoDropDownList(tipoDocumento1, "SELECT DISTINCT PD.pdoc_codigo, pdoc_nombre FROM pdocumento PD, MORDEN MO WHERE tdoc_tipodocu='OT' and MO.PDOC_CODIGO = PD.PDOC_CODIGO and mo.test_estado='A' ");
                Utils.llenarPrefijos(Response, ref tipoDocumento1, "%", "%", "OT");
                if (tipoDocumento1.Items.Count > 1)
                {
                    tipoDocumento1.Items.Insert(0, "Seleccione:..");
                }
                //bind.PutDatasIntoDropDownList(tipoDocumento2, "SELECT DISTINCT PD.pdoc_codigo, pdoc_nombre FROM pdocumento PD, MORDEN MO WHERE tdoc_tipodocu='OT' and MO.PDOC_CODIGO = PD.PDOC_CODIGO and mo.test_estado='A' ");
                Utils.llenarPrefijos(Response, ref tipoDocumento2, "%", "%", "OT");
                if (tipoDocumento2.Items.Count > 1)
                {
                    tipoDocumento2.Items.Insert(0, "Seleccione:..");
                }
                bind.PutDatasIntoDropDownList(ordenesPreliquidar, "SELECT mord_numeorde FROM morden WHERE pdoc_codigo = '" + tipoDocumento1.SelectedValue + "'  and mord_estaliqu in ('A','P') and test_estado='A' ORDER BY mord_numeorde");
                int ano = DateTime.Now.Year;
                int mes = DateTime.Now.Month;
                bind.PutDatasIntoDropDownList(ddlOTS, "SELECT DISTINCT MFCT.pdoc_prefordetrab CONCAT '-' CONCAT CAST(MFCT.mord_numeorde AS CHARACTER(6)), PDO.pdoc_nombre CONCAT '-' CONCAT CAST(MFCT.mord_numeorde AS CHARACTER(6)) FROM mfacturaclientetaller MFCT, pdocumento PDO WHERE PDO.pdoc_codigo=MFCT.pdoc_prefordetrab AND MFAC_FECHCREA > (CURRENT DATE - 12 MONTHS); ");
                if (ddlOTS.Items.Count > 1)
                {
                    ddlOTS.Items.Insert(0, "Seleccione:..");
                }
                else
                {
                    CargarFacturas(ddlOTS, ddlFactRel);
                }
                ddlFactRel.Attributes.Add("onchange", "CambioFact(" + ddlFactRel.ClientID + "," + lbCargo.ClientID + ");");
                if (Request.QueryString["prefD"] != null && Request.QueryString["numD"] != null)
                {
                    Utils.MostrarAlerta(Response, "Se ha generado la nota de devolución de taller " + Request.QueryString["prefD"] + "-" + Request.QueryString["numD"] + "");
                    try
                    {
                        formatoRecibo.Prefijo = Request.QueryString["prefD"];
                        formatoRecibo.Numero  = Convert.ToInt32(Request.QueryString["numD"]);
                        formatoRecibo.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefD"] + "'");
                        if (formatoRecibo.Codigo != string.Empty)
                        {
                            if (formatoRecibo.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoRecibo.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lb.Text += "Error al generar la impresión. Detalles : " + formatoRecibo.Mensajes + "<br>";
                    }
                }
                if (Request.QueryString["factOT"] != null)
                {
                    string msg = "Se ha creado la factura con prefijo " + Request.QueryString["prefF1"] + " y numero " + Request.QueryString["numF1"] + " por el cargo " + DBFunctions.SingleData("SELECT tcar_nombre FROM tcargoorden WHERE tcar_cargo='" + Request.QueryString["car1"] + "'").Trim() + ".\\nSe ha creado la factura con prefijo " + Request.QueryString["prefF2"] + " y numero " + Request.QueryString["numF2"] + " por el cargo " + DBFunctions.SingleData("SELECT tcar_nombre FROM tcargoorden WHERE tcar_cargo='" + Request.QueryString["car2"] + "'").Trim() + ");";
                    if (Request.QueryString["factOT"] == "0")
                    {
                        Utils.MostrarAlerta(Response, "Se ha creado la factura con prefijo " + Request.QueryString["prefF"] + " y numero " + Request.QueryString["numF"] + " por el cargo " + DBFunctions.SingleData("SELECT tcar_nombre FROM tcargoorden WHERE tcar_cargo='" + Request.QueryString["car"] + "'").Trim() + ".");
                    }
                    else if (Request.QueryString["factOT"] == "1")
                    {
                        Utils.MostrarAlerta(Response, msg);
                    }
                }
            }
            if (ddlFactRel.Items.Count > 0)
            {
                lbCargo.Text = (ddlFactRel.SelectedValue.Split('-'))[1].Trim();
            }
        }
コード例 #27
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                DatasToControls bind = new DatasToControls();
                //	bind.PutDatasIntoDropDownList(catalogo,CatalogoVehiculos.CATALOGOVEHICULOSENALMACEN);
                //    catalogo.Items.Insert(0, new ListItem("Seleccione el Catálogo...", ""));

                try
                {
                    bind.PutDatasIntoDropDownList(prefijo, "SELECT PDOC_CODIGO,PDOC_NOMBRE FROM PDOCUMENTO WHERE TDOC_TIPODOCU = 'MV'");
                    if (prefijo.Items.Count > 0)
                    {
                        prefijo.Items.Insert(0, new ListItem("Seleccione el Prefijo...", ""));
                    }
                }
                catch
                {
                    Utils.MostrarAlerta(Response, "No ha parametrizado ningun documento del tipo MV");
                }

                bind.PutDatasIntoDropDownList(vinVehiculo, string.Format(Vehiculos.VEHICULOSENALMACEN));
                vinVehiculo.Items.Insert(0, new ListItem("Seleccione el V I N...", ""));

                bind.PutDatasIntoDropDownList(ubicacionVehiculo, "SELECT pubi_codigo, pubi_nombre FROM pubicacion where PUBI_VIGENCIA = 'V' ");
                ubicacionVehiculo.Items.Insert(0, new ListItem("Seleccione la Ubicación...", ""));

                calendar.Text = DateTime.Now.ToString("yyyy-MM-dd");
                //	this.Cargar_Ubicacion_Actual(vinVehiculo.SelectedItem.Text);

                //if (Session["actualizado"] != null)
                if (Request.QueryString["vin"] != null)
                {
                    Utils.MostrarAlerta(Response, "Actualización completa! La nueva ubicación del vehículo: " + Request.QueryString["vin"] + " se ha definido en: " + Request.QueryString["ubicacion"]);
                    Utils.MostrarAlerta(Response, "Se ha creado la factura con prefijo " + Request.QueryString["prefijo"] + " y número " + Request.QueryString["numero"] + "");
                    formatoFactura = new FormatosDocumentos();
                    try
                    {
                        formatoFactura.Prefijo = Request.QueryString["prefijo"];
                        formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["numero"]);
                        formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefijo"] + "'");
                        if (formatoFactura.Codigo != string.Empty)
                        {
                            if (formatoFactura.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                        formatoFactura.Codigo = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefijo"] + "'");
                        if (formatoFactura.Codigo != string.Empty)
                        {
                            if (formatoFactura.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=500,WIDTH=700');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lbInfo.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
                    }
                    Session.Clear();
                }
            }
        }
コード例 #28
0
        protected void guardar_Click(object sender, System.EventArgs e)
        {
            string cc = (String)Session["CC"];

            if (cc == null)
            {
                cc = DBFunctions.SingleData("SELECT PCEN_CENTCART FROM PALMACEN WHERE PALM_ALMACEN = '" + almacen.SelectedValue + "'");
            }
            ArrayList sqlRefs   = new ArrayList();
            DataTable dtramite  = Session["tablaDatosTramite"] as DataTable;
            DataTable dtDatosTr = Session["tablaDatos"] as DataTable;

            if ((DBFunctions.SingleData("SELECT pven_clave FROM pvendedor WHERE pven_codigo='" + ddlVendedor.SelectedValue + "'") != tbClaveVend.Text.Trim()) || (ddlVendedor.SelectedValue == "0"))
            {
                Utils.MostrarAlerta(Response, "La clave de " + ddlVendedor.SelectedItem.Text + " es invalida.\\nRevise Por Favor!");
                return;
            }

            for (int i = 0; i < dtramite.Rows.Count; i++)
            {
                sqlRefs.Add("INSERT INTO DORDENTRAMITEANULACION VALUES('" + dtramite.Rows[i][0] + "'," + dtramite.Rows[i][1] + ",'" + dtramite.Rows[i][9].ToString() + "', 'C','D','',null, '', '' , null, ''," + dtramite.Rows[i][7].ToString() + ", null, '" + dtramite.Rows[i][6].ToString() + "')");
            }

            numero.Text = DBFunctions.SingleData("SELECT pdoc_ultidocu+1 FROM pdocumento WHERE pdoc_codigo='" + prefijoDocumento.SelectedValue + "'");

            sqlRefs.Add("INSERT INTO mfacturacliente VALUES('" + prefijoDocumento.SelectedValue + "'," + numero.Text.ToString() + ",'" + txtNit.Text + "','" + almacen.SelectedValue + "','N','V'," +
                        "'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'," + Convert.ToDouble(txtvalorServ.Text.Substring(1)) + ", " + Convert.ToDouble(txtivaServ.Text.Substring(1)) + ", " + Convert.ToDouble(txtTotalDoc.Text.Substring(1)) + ", 0" +
                        ", 0, 0, 0, 0,'" + cc + "'," +
                        "'Devolucion Tramite','" + ddlVendedor.SelectedValue + "','" + usuario + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "')");

            for (int i = 0; i < dtDatosTr.Rows.Count; i++)
            {
                sqlRefs.Add("INSERT INTO MANULACIONTRAMITE VALUES ('" + prefijoDocumento.SelectedValue + "', " + numero.Text.ToString() + " , '" + dtDatosTr.Rows[i][0] + "', " + dtDatosTr.Rows[i][1] + ")");
                sqlRefs.Add("DELETE FROM MFACTURACLIENTETRAMITE WHERE PDOC_TRAMITE = '" + dtDatosTr.Rows[i][0] + "' AND MORD_NUMEORDE = " + dtDatosTr.Rows[i][1] + "");
                sqlRefs.Add("UPDATE DORDENTRAMITE SET TEST_ESTADO = 'A' WHERE PDOC_CODIGO = '" + dtDatosTr.Rows[i][0] + "' AND MORD_NUMEORDE = " + dtDatosTr.Rows[i][1] + "");
                sqlRefs.Add("UPDATE MORDENTRAMITE SET TEST_ESTADO = 'A' WHERE PDOC_CODIGO = '" + dtDatosTr.Rows[i][0] + "' AND MORD_NUMEORDE = " + dtDatosTr.Rows[i][1] + "");
            }
            sqlRefs.Add("UPDATE PDOCUMENTO SET PDOC_ULTIDOCU = PDOC_ULTIDOCU+1 WHERE PDOC_CODIGO = '" + prefijoDocumento.SelectedValue + "';");

            if (DBFunctions.Transaction(sqlRefs))
            {
                contaOnline.contabilizarOnline(prefijoDocumento.SelectedValue, Convert.ToInt32(numero.Text.ToString()), Convert.ToDateTime(txtFecha.Text), "");
                Utils.MostrarAlerta(Response, "Se ha creado la factura con prefijo " + prefijoDocumento.SelectedValue + " y número " + numero.Text.ToString() + "");
                formatoFactura = new FormatosDocumentos();
                try
                {
                    formatoFactura.Prefijo = prefijoDocumento.SelectedValue;
                    formatoFactura.Numero  = Convert.ToInt32(numero.Text);
                    formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + ddlPrefijo.SelectedValue.ToString() + "'");
                    if (formatoFactura.Codigo != string.Empty)
                    {
                        if (formatoFactura.Cargar_Formato())
                        {
                            Response.Write("<script language:javascript>w=window.open('" + prefijoDocumento.SelectedValue + "','','HEIGHT=600,WIDTH=800');</script>");
                        }
                    }
                    formatoFactura.Codigo = DBFunctions.SingleData("SELECT sfor_codigo2 FROM dbxschema.pdocumento WHERE pdoc_codigo='" + prefijoDocumento.SelectedValue + "'");
                    if (formatoFactura.Codigo != string.Empty)
                    {
                        if (formatoFactura.Cargar_Formato())
                        {
                            Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=500,WIDTH=700');</script>");
                        }
                    }
                    string indexPage = ConfigurationManager.AppSettings["MainIndexPage"];
                    Session.Clear();
                    Response.Redirect("" + indexPage + "?process=Vehiculos.FacturacionTramite&prefD=" + ddlPrefijo.SelectedValue + "&numD=" + numero.Text + "");
                }
                catch
                {
                    lbInfo.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
                }
            }
        }
コード例 #29
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Introducir aquí el código de usuario para inicializar la página
            if (!IsPostBack)
            {
                if (Request["prefOP"] != null && Request["numOP"] != null && Request["prefT"] != null && Request["pDoc"] != null && Request["nDoc"] != null)
                {
                    string strRes = (Request["ens"] != null)?"ensamble":"producción";
                    Utils.MostrarAlerta(Response, "Se ha creado satisfactoriamente la orden de " + strRes + " " + Request["pDoc"] + "-" + Request["nDoc"] + "");
                    //Pedido 1
                    FormatosDocumentos formatoFactura = new FormatosDocumentos();
                    try{
                        formatoFactura.Prefijo = Request.QueryString["pDoc"];
                        formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["nDoc"]);
                        formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pDoc"] + "'");
                        if (formatoFactura.Codigo != string.Empty)
                        {
                            if (formatoFactura.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lb.Text = "Error al generar el formato pedido 1. Detalles : <br>" + formatoFactura.Mensajes;
                    }
                    //Pedido 2
                    formatoFactura = new FormatosDocumentos();
                    if (Request["dbl"] != null && Request.QueryString["dbl"].ToString().Length > 0)
                    {
                        try
                        {
                            formatoFactura.Prefijo = Request.QueryString["prefOP"];
                            formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["numOP"]) - 1;
                            formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pDoc"] + "'");
                            if (formatoFactura.Codigo != string.Empty)
                            {
                                if (formatoFactura.Cargar_Formato())
                                {
                                    Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                                }
                            }
                        }
                        catch
                        {
                            lb.Text = "Error al generar el formato pedido 2. Detalles : <br>" + formatoFactura.Mensajes;
                        }
                    }
                    //Transferencia 1
                    formatoFactura = new FormatosDocumentos();
                    if (Request["numT"] != null && Request.QueryString["numT"].ToString().Length > 0)
                    {
                        try
                        {
                            formatoFactura.Prefijo = Request.QueryString["prefT"];
                            formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["numT"]);
                            formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefT"] + "'");
                            if (formatoFactura.Codigo != string.Empty)
                            {
                                if (formatoFactura.Cargar_Formato())
                                {
                                    Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                                }
                            }
                        }
                        catch
                        {
                            lb.Text = "Error al generar el formato transferencia 1. Detalles : <br>" + formatoFactura.Mensajes;
                        }
                    }
                    //Transferencia 2
                    formatoFactura = new FormatosDocumentos();
                    if (Request["dbl"] != null && Request.QueryString["dbl"].ToString().Length > 0)
                    {
                        try
                        {
                            formatoFactura.Prefijo = Request.QueryString["prefT"];
                            formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["numT"]) - 1;
                            formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["prefT"] + "'");
                            if (formatoFactura.Codigo != string.Empty)
                            {
                                if (formatoFactura.Cargar_Formato())
                                {
                                    Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                                }
                            }
                        }
                        catch
                        {
                            lb.Text = "Error al generar el formato transferencia 2. Detalles : <br>" + formatoFactura.Mensajes;
                        }
                    }
                }

                string campoProg;
                if (Request.QueryString["ens"] != null)
                {
                    Utils.FillDll(ddlPrefijo, "SELECT pdoc_codigo,pdoc_codigo CONCAT '-' CONCAT pdoc_descripcion FROM pdocumento WHERE tdoc_tipodocu='OP' order by pdoc_codigo,pdoc_descripcion", false);
                }
                else
                {
                    Utils.FillDll(ddlPrefijo, "SELECT pdoc_codigo,pdoc_codigo CONCAT '-' CONCAT pdoc_descripcion FROM pdocumento WHERE tdoc_tipodocu='OP' order by pdoc_codigo desc,pdoc_descripcion", false);
                }
                try
                {
                    tbNumero.Text = DBFunctions.SingleData("SELECT max(MORD_NUMEORDE)+1 FROM MORDENPRODUCCION WHERE pdoc_codigo='" + ddlPrefijo.SelectedValue + "'");
                    Utils.FillDll(ddlVendedor, "SELECT pven_codigo, pven_nombre FROM pvendedor WHERE tvend_codigo='VM' AND pven_vigencia='V' order by pven_nombre", false);
                    Utils.FillDll(ddlAlmacen, "SELECT PA.palm_almacen, MP.mpla_funcion FROM PALMACEN PA, MPLANTAS MP WHERE PA.palm_almacen=MP.mpla_codigo order by PA.palm_descripcion;", false);
                    Utils.FillDll(ddlAlmMat, "SELECT PA.palm_almacen, PA.palm_descripcion FROM PALMACEN PA order by PA.palm_descripcion;", false);
                    Utils.FillDll(ddlPedido, "SELECT pped_codigo,pped_nombre FROM ppedido WHERE tped_codigo='T' order by pped_nombre", false);
                    Utils.FillDll(ddlTransferencia, "SELECT pdoc_codigo,pdoc_codigo CONCAT '-' CONCAT pdoc_descripcion FROM pdocumento WHERE tdoc_tipodocu='TT' order by pdoc_codigo,pdoc_descripcion", false);
                    tbFecha.Text = DateTime.Now.ToString("yyyy-MM-dd");
                    if (Request.QueryString["ens"] != null)
                    {
                        ViewState["TIPO"] = "E";
                        lblElemento.Text  = "Catálogo del Vehículo :";
                        campoProg         = "PCAT_CODIGO";
                    }
                    else
                    {
                        ViewState["TIPO"] = "P";
                        lblElemento.Text  = "Código del Item :";
                        campoProg         = "MITE_CODIGO";
                    }

                    //Programa produccion
                    DateTime dttFecha    = DateTime.Now;
                    DateTime dttFecha1   = dttFecha.AddMonths(-1);
                    DateTime dttFecha2   = dttFecha.AddMonths(-2);
                    DateTime dttFecha2h  = dttFecha.AddMonths(-3);
                    DateTime dttFecha2hh = dttFecha.AddMonths(-4);
                    DateTime dttFecha3   = dttFecha.AddMonths(1);
                    DateTime dttFecha4   = dttFecha.AddMonths(2);

                    Utils.FillDll(ddlLote,
                                  "SELECT mprog_numero, mprog_numero from MPROGRAMAPRODUCCION mp " +
                                  "where mp.mprog_consecutivo in (" +
                                  " select dp.mprog_consecutivo " +
                                  " from DPROGRAMAPRODUCCION dp " +
                                  " where " +
                                  " dp.mprog_consecutivo=mp.mprog_consecutivo and " +
                                  " dp." + campoProg + " IS NOT NULL and dp.dprog_cantidad > dp.dprog_total) ORDER BY mprog_numero;", false);
                }
                catch { }
            }
            else
            {
                if (Session["dtProduccion"] != null)
                {
                    dtProduccion = (DataTable)Session["dtProduccion"];
                }
            }
        }
コード例 #30
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Introducir aquí el código de usuario para inicializar la página
            Ajax.Utility.RegisterTypeForAjax(typeof(AMS_Produccion_EntradasEnsambles));
            if (!Page.IsPostBack)
            {
                DatasToControls bind      = new DatasToControls();
                DateTime        dttFecha  = DateTime.Now;
                DateTime        dttFecha1 = dttFecha.AddMonths(-1);
                DateTime        dttFecha2 = dttFecha.AddMonths(-2);
                DateTime        dttFecha3 = dttFecha.AddMonths(1);
                DateTime        dttFecha4 = dttFecha.AddMonths(2);

                IFormatProvider culture = new System.Globalization.CultureInfo("es-CO", true);
                //bind.PutDatasIntoDropDownList(ddlPrefOrden,"SELECT pdoc_codigo from pdocumento where tdoc_tipodocu='OP';");
                Utils.llenarPrefijos(Response, ref ddlPrefOrden, "%", "%", "OP");
                bind.PutDatasIntoDropDownList(ddlNumOrden, "SELECT mord_numeorde from mordenproduccion where pdoc_codigo='" + ddlPrefOrden.SelectedValue + "' and test_estado='A' and mord_tipo='E';");
                bind.PutDatasIntoDropDownList(ddlLote,
                                              "SELECT mprog_numero from MPROGRAMAPRODUCCION " +
                                              "where (mprog_ano=" + dttFecha.Year + " and mprog_mes=" + dttFecha.Month + ") or " +
                                              "(mprog_ano=" + dttFecha1.Year + " and mprog_mes=" + dttFecha1.Month + ") or " +
                                              "(mprog_ano=" + dttFecha2.Year + " and mprog_mes=" + dttFecha2.Month + ") or " +
                                              "(mprog_ano=" + dttFecha3.Year + " and mprog_mes=" + dttFecha3.Month + ") or " +
                                              "(mprog_ano=" + dttFecha4.Year + " and mprog_mes=" + dttFecha4.Month + ");");
                bind.PutDatasIntoDropDownList(ddlAlmacen, "SELECT PA.palm_almacen, PA.palm_descripcion FROM PALMACEN PA, MPLANTAS MP WHERE PA.palm_almacen=MP.mpla_codigo;");
                bind.PutDatasIntoDropDownList(ddlVendedor, string.Format(Almacen.VENDEDORESPORALMACEN, ddlAlmacen.SelectedValue));
                bind.PutDatasIntoDropDownList(ddlPrefE, string.Format(Documento.DOCUMENTOSTIPOHECHO, "FP", "IP", ddlAlmacen.SelectedValue));
                if (ddlPrefE.Items.Count > 0)
                {
                    txtNumFacE.Text = DBFunctions.SingleData(string.Format(Documento.PROXIMODOCUMENTO, ddlPrefE.SelectedValue));
                }
                else
                {
                    txtNumFacE.Text = "0";
                }

                tbDate.Text = DateTime.Now.ToString("yyyy-MM-dd");

                int mes = DateTime.Now.Month;
                if (mes < 6)
                {
                    txtAno.Text = DBFunctions.SingleData("SELECT PANO_ANO FROM CVEHICULOS;");
                }
                else
                {
                    txtAno.Text = (DateTime.Now.Year + 1).ToString();
                }

                if (Request.QueryString["pref"] != null && Request.QueryString["num"] != null)
                {
                    FormatosDocumentos formatoFactura = new FormatosDocumentos();
                    Utils.MostrarAlerta(Response, "Se ha generado la factura con prefijo " + Request.QueryString["pref"] + " y número " + Request.QueryString["num"] + "");
                    try
                    {
                        formatoFactura.Prefijo = Request.QueryString["pref"];
                        formatoFactura.Numero  = Convert.ToInt32(Request.QueryString["num"]);
                        formatoFactura.Codigo  = DBFunctions.SingleData("SELECT sfor_codigo FROM dbxschema.pdocumento WHERE pdoc_codigo='" + Request.QueryString["pref"] + "'");
                        if (formatoFactura.Codigo != string.Empty)
                        {
                            if (formatoFactura.Cargar_Formato())
                            {
                                Response.Write("<script language:javascript>w=window.open('" + formatoFactura.Documento + "','','HEIGHT=600,WIDTH=800');</script>");
                            }
                        }
                    }
                    catch
                    {
                        lbInfo.Text = "Error al generar el formato. Detalles : <br>" + formatoFactura.Mensajes;
                    }
                }
            }

            if (ViewState["COLORES"] == null)
            {
                dtColores = new DataTable();
                dtColores.Columns.Add("PCOL_CODIGO", typeof(string));
                dtColores.Columns.Add("PCOL_DESCRIPCION", typeof(string));
                dtColores.Columns.Add("PCOL_CANTIDAD", typeof(int));
                BindColores();
                ViewState["COLORES"] = dtColores;
            }
            else
            {
                dtColores = (DataTable)ViewState["COLORES"];
            }

            if (ViewState["ENSAMBLES"] != null)
            {
                dtEnsambles = (DataTable)ViewState["ENSAMBLES"];
            }
        }