Beispiel #1
0
        private void MostrarRegistro(string ACFid)
        {
            try
            {
                DataTable dat = NacfTRNt_terrenodetalle.Buscar(ACFid);

                //ACFdescripcion.Text= dat.Rows[0]["ACFdescripcion"].ToString();

                if (dat.Rows.Count > 0)
                {
                    DataRow row = dat.Rows[0];
                    txtRVAcodigo.Text = Convert.ToString(row["RVAcodigo"]);
                    //guardo datos en variables
                    //txtACFid.Text = Convert.ToString(row["ACFid"]);
                    //txtACFdescripcion.Text = Convert.ToString(row["ACFdescripcion"]);
                }
                else
                {
                    MessageBox.Show("Registro Nuevo", "Nuevo");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
Beispiel #2
0
        private void GrabarDGV()
        {
            int x331, x332, x333;

            if ((x331 = dgv331.Rows.Count) > 0)
            {
                try
                {
                    foreach (DataGridViewRow row in dgv331.Rows)
                    {
                        string Rta = string.Empty;

                        Rta = NacfTRNt_terrenodetalle.Insertar(
                            Convert.ToString(row.Cells[18].Value)   //CRSnombrepredio
                            , Convert.ToString(row.Cells[3].Value)  //CRScentropoblado
                            , ""                                    //, Convert.ToString(row.Cells[xxx].Value)   //CRSdepartamento
                            , ""                                    //, Convert.ToString(row.Cells[xxx].Value)   //CRSinterior
                            , ""                                    //, Convert.ToString(row.Cells[xxx].Value)   //CRScarretera
                            , ""                                    //, Convert.ToString(row.Cells[xxx].Value)   //CRSkilometro
                            , Convert.ToString(row.Cells[6].Value)  //ACFArea
                            , Convert.ToString(row.Cells[7].Value)  //ACFvalor
                            , ""                                    //, Convert.ToString(row.Cells[xxx].Value)   //ACFtc
                            , Convert.ToString(row.Cells[8].Value)  //ACFvalorSoles
                            , Convert.ToString(row.Cells[9].Value)  //ACFValorDolar
                            , Convert.ToString(row.Cells[10].Value) //ACFValorAnt0
                            , "80"                                  //, Convert.ToString(row.Cells[xxx].Value)   //ACFVutilniff --- valor por defecto 80
                            , Convert.ToString(row.Cells[12].Value) //ACFNetopcga
                            , Convert.ToString(row.Cells[13].Value) //ACFvalorATri
                            , Convert.ToString(row.Cells[19].Value) //ACFid
                            , Convert.ToString(row.Cells[20].Value) //ACFdiferencia
                            , Convert.ToString(row.Cells[21].Value) //ACFDifTemDedu
                            , Convert.ToString(row.Cells[22].Value) //ACFDifTemGrav
                            , ""                                    //, Convert.ToString(row.Cells[xxx].Value)   //ACFTasaIR
                            , Convert.ToString(row.Cells[24].Value) //ACFSaldoDeducible
                            , Convert.ToString(row.Cells[25].Value) //ACFSaldoGravable
                            , txtRVAcodigo.Text                     //, Convert.ToString(row.Cells[xxx].Value)   //RVAcodigo
                            , Convert.ToString(row.Cells[5].Value)  //ACFUbicacion
                            );

                        if (Rta.Equals("OK"))
                        {
                            //MessageBox.Show("Datos agregados");
                        }
                        else
                        {
                            //MessageBox.Show("Datos No Agregados");
                            break;
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Terranos Ingresados");
                }
            }

            if ((x332 = dgv332.Rows.Count) > 0)
            {
            }

            if ((x333 = dgv333.Rows.Count) > 0)
            {
            }
        }