Ejemplo n.º 1
0
        protected void btnAdd_documento_click(object sender, EventArgs args)
        {
            ListItem li = lst_documento_recibido.Items.FindByValue(ddlDocumento.SelectedValue);

            if (li == null)
            {
                int IdDcumento = 0;
                int.TryParse(ddlDocumento.SelectedValue, out IdDcumento);
                if (!VSLstED.Exists(p => p.Id_documento == IdDcumento))
                {
                    Entrada_documento oED = new Entrada_documento();
                    oED.Id_documento = IdDcumento;
                    oED.Referencia   = txt_referencia_documento.Text;
                    VSLstED.Add(oED);
                    li = new ListItem(ddlDocumento.SelectedItem.Text + " -> " + txt_referencia_documento.Text, ddlDocumento.SelectedValue);
                    lst_documento_recibido.Items.Add(li);
                    int Id_documento = 0;
                    int.TryParse(ddlDocumento.SelectedValue, out Id_documento);
                    Cliente_documento oCD = VSLstCDE.Find(p => p.Id_documento == Id_documento);
                    if (oCD != null)
                    {
                        oCD.IsAdd = true;
                    }
                }
            }
            txt_referencia_documento.Text = string.Empty;
            //validaDocRequeridos();
            up_consolidada.Update();
        }
Ejemplo n.º 2
0
        private void clienteRequiereDocumentos(int IdCliente)
        {
            try
            {
                VSLstCDE = CatalogCtrl.Cliente_DocumentoFillLstByCliente(IdCliente);

                hfReferencia.Value         = string.Empty;
                hfIdDocReq.Value           = "0";
                hfMascara.Value            = string.Empty;
                rfvReferencia.Enabled      = false;
                rfvReferencia.ErrorMessage = string.Empty;

                ControlsMng.fillDocumento(ddlDocumento);

                if (VSLstCDE.Count > 0)
                {
                    Documento    oD    = new Documento();
                    DocumentoMng oDMng = new DocumentoMng();
                    oD.Id             = VSLstCDE.First().Id_documento;
                    oDMng.O_Documento = oD;
                    oDMng.selById();
                    hfIdDocReq.Value           = oD.Id.ToString();
                    hfReferencia.Value         = oD.Nombre + ":";
                    hfMascara.Value            = oD.Mascara;
                    rfvReferencia.Enabled      = true;
                    rfvReferencia.ErrorMessage = "Es necesario capturar: " + oD.Nombre;
                    ddlDocumento.Items.Remove(ddlDocumento.Items.FindByValue(oD.Id.ToString()));
                }
            }
            catch
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        protected void btnRem_documento_click(object sender, EventArgs args)
        {
            ListItem li          = lst_documento_recibido.SelectedItem;
            int      IdDocumento = 0;

            int.TryParse(li.Value, out IdDocumento);

            if (IdDocumento == 1 && bool.Parse(hfEsCompartida.Value))
            {
                return;
            }

            VSLstED.Remove(VSLstED.Find(p => p.Id_documento == IdDocumento));
            lst_documento_recibido.Items.Remove(li);
            Cliente_documento oCD = VSLstCDE.Find(p => p.Id_documento == IdDocumento);
            //if (oCD != null)
            //    oCD.IsAdd = false;
            //validaDocRequeridos();
        }