Exemple #1
0
        private void RecorrerGridObtenerMenorValor()
        {
            decimal inSaldoMin = 10000000000;
            int     inCount    = 0;

            if (listView.Items.Count == 0)
            {
                lblSaldo.Content = "0";
                return;
            }
            foreach (var item in listView.Items)
            {
                //DataGridRow row = (DataGridRow)dataGridCert.ItemContainerGenerator.ContainerFromItem(item);
                //inSaldoMinNuevo = Convert.ToInt32(((TextBox)dataGridCert.Columns[7].GetCellContent(row)).Text);
                inCount++;
                if (inCount > 9)
                {
                    continue;
                }
                usp_LisSaldoCertificado_Result oC = new usp_LisSaldoCertificado_Result();

                oC = (usp_LisSaldoCertificado_Result)item;

                decimal inSaldoMinNuevo = 0;
                inSaldoMinNuevo = Convert.ToDecimal(oC.SALDO_CALCULADO);
                inSaldoMin      = inSaldoMinNuevo < inSaldoMin ? inSaldoMinNuevo : inSaldoMin;
            }
            lblSaldo.Content             = inSaldoMin;
            _regGi.lblSaldoCerGI.Content = inSaldoMin == 10000000000 ? 0 : inSaldoMin;
        }
Exemple #2
0
        } // FIN usp_InsGuiaIngresoCabecera

        private void RecorrerGridObtenerMenorValor(string IdCliente, string cosecha)
        {
            decimal inSaldoMin = 10000000000;

            var      lst      = _CertificadoVSPClient.usp_LisSaldoCertificado(Convert.ToInt32(IdCliente), cosecha).ToList();
            ListView listView = new ListView();

            listView.ItemsSource = lst;

            int inCount = 0;

            //foreach (var item in dataGridCert.Items)
            if (listView.Items.Count == 0)
            {
                lblSaldoCerGI.Content = "0";
                return;
            }
            foreach (var item in listView.Items)
            {
                //DataGridRow row = (DataGridRow)dataGridCert.ItemContainerGenerator.ContainerFromItem(item);
                //inSaldoMinNuevo = Convert.ToInt32(((TextBox)dataGridCert.Columns[7].GetCellContent(row)).Text);
                inCount++;
                if (inCount > 8)
                {
                    continue;
                }
                usp_LisSaldoCertificado_Result oC = new usp_LisSaldoCertificado_Result();
                oC = (usp_LisSaldoCertificado_Result)item;

                decimal inSaldoMinNuevo = 0;
                inSaldoMinNuevo = Convert.ToDecimal(oC.SALDO_CALCULADO);
                inSaldoMin      = inSaldoMinNuevo < inSaldoMin ? inSaldoMinNuevo : inSaldoMin;
            }
            lblSaldoCerGI.Content = inSaldoMin;
        }
Exemple #3
0
        private void listView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            /*Objetivo: Concatenar los id y descrip de los certificados seleccionados*/
            var selected = listView.SelectedItems;
            usp_LisSaldoCertificado_Result oC = new usp_LisSaldoCertificado_Result();

            if (selected == null)
            {
                return;
            }

            _regGi.lblHiddenDescCert.Content = "";
            _regGi.lblHiddenIdCert.Content   = "";
            for (int i = 0; i < selected.Count; i++)
            {
                oC = new usp_LisSaldoCertificado_Result();
                oC = (usp_LisSaldoCertificado_Result)selected[i];
                _regGi.lblHiddenDescCert.Content += oC.DESCRIPCION.ToString() + "|";
                _regGi.lblHiddenIdCert.Content   += oC.IDCERTIFICADOVSP.ToString() + "|";
            }

            var Oselected = selected;
        }