Пример #1
0
        protected void Fun_Buscar_Registro()
        {
            string secuencia = Funciones.Fun_Eliminar_Letras_DeString(Txtregistro.Text);

            //MessageBox.Show(Funciones.Fun_Convierte_String_aEntrero(secuencia).ToString());
            if (Txtregistro.Fun_SQL_Buscar_SecuenciaRegistro("SELECT * from cxcdbfregistro where tiporegistro=1 and REPLACE(secuencia,SUBSTRING(secuencia,PATINDEX('%[^0-9]%', secuencia),1),'')=" + Funciones.Fun_Convierte_String_aEntrero(secuencia)))
            {
                DataSet ds = Txtregistro._Dataset;


                Txtcodigocliente.Text       = ds.Tables[0].Rows[0]["idcliente"].ToString();
                Dtpfechavencimiento.MinDate = new DateTime(1753, 6, 20);
                Dtpfechavencimiento.Value   = Convert.ToDateTime(ds.Tables[0].Rows[0]["fechavencimiento"]);
                Dtpfecha.Value     = Convert.ToDateTime(ds.Tables[0].Rows[0]["fecha"]);
                Txtreferencia.Text = ds.Tables[0].Rows[0]["referencia"].ToString();
                Txtitbis.Text      = ds.Tables[0].Rows[0]["totalitbis"].ToString();
                Txttotal.Text      = ds.Tables[0].Rows[0]["total"].ToString();
                Txtexcento.Text    = ds.Tables[0].Rows[0]["totalexento"].ToString();
                Txtgravado16.Text  = ds.Tables[0].Rows[0]["totalgravado16"].ToString();
                Txtgravado18.Text  = ds.Tables[0].Rows[0]["totalgravado18"].ToString();
                //Dtpfecha.validancf(Txtncf);
                Mskncf.Text             = ds.Tables[0].Rows[0]["ncf"].ToString();
                Txtcodigovendedor.Text  = ds.Tables[0].Rows[0]["idvendedor"].ToString();
                Txtcomentrio.Text       = ds.Tables[0].Rows[0]["comentario"].ToString();
                Cmbmoneda.SelectedValue = ds.Tables[0].Rows[0]["idmoneda"].ToString();
                Fun_Buscar_Cliente();
                Fun_Buscar_Vendedor();
                Fun_Buscar_Detalle_Registro(Funciones.Fun_Convierte_String_aEntrero(ds.Tables[0].Rows[0]["idregistro"].ToString()));
            }
        }
Пример #2
0
        protected void Fun_Buscar_Registro()
        {
            if (_OpcionSQL == "Modificar")
            {
                string secuencia = Funciones.Fun_Eliminar_Letras_DeString(Txtregistro.Text);

                if (Txtregistro.Fun_SQL_Buscar_SecuenciaRegistro("SELECT * from cxcdbfregistro where tiporegistro=1 and REPLACE(secuencia,SUBSTRING(secuencia,PATINDEX('%[^0-9]%', secuencia),1),'')=" + Funciones.Fun_Convierte_String_aEntrero(secuencia)))
                {
                    DataSet ds = Txtregistro._Dataset;


                    if (Funciones.Fun_Convierte_String_aDecimal(ds.Tables[0].Rows[0]["balance"].ToString()) == Funciones.Fun_Convierte_String_aDecimal(ds.Tables[0].Rows[0]["total"].ToString()))
                    {
                        Txtregistro.Enabled         = false;
                        BtnBuscarRegistro.Visible   = false;
                        Txtcodigocliente.Text       = ds.Tables[0].Rows[0]["idcliente"].ToString();
                        Dtpfechavencimiento.MinDate = new DateTime(1753, 6, 20);
                        Dtpfechavencimiento.Value   = Convert.ToDateTime(ds.Tables[0].Rows[0]["fechavencimiento"]);
                        Dtpfecha.Value     = Convert.ToDateTime(ds.Tables[0].Rows[0]["fecha"]);
                        Txtreferencia.Text = ds.Tables[0].Rows[0]["referencia"].ToString();
                        Txtitbis.Text      = ds.Tables[0].Rows[0]["totalitbis"].ToString();
                        Txttotal.Text      = ds.Tables[0].Rows[0]["total"].ToString();
                        Txtexcento.Text    = ds.Tables[0].Rows[0]["totalexento"].ToString();
                        Txtgravado16.Text  = ds.Tables[0].Rows[0]["totalgravado16"].ToString();
                        Txtgravado18.Text  = ds.Tables[0].Rows[0]["totalgravado18"].ToString();
                        //Dtpfecha.validancf(Txtncf);
                        Mskncf.Text             = ds.Tables[0].Rows[0]["ncf"].ToString();
                        Txtcodigovendedor.Text  = ds.Tables[0].Rows[0]["idvendedor"].ToString();
                        Txtcomentrio.Text       = ds.Tables[0].Rows[0]["comentario"].ToString();
                        Cmbmoneda.SelectedValue = ds.Tables[0].Rows[0]["idmoneda"].ToString();
                        Fun_Buscar_Cliente();
                        Fun_Buscar_Vendedor();
                        Fun_Buscar_Detalle_Registro(Funciones.Fun_Convierte_String_aEntrero(ds.Tables[0].Rows[0]["idregistro"].ToString()));
                    }
                    else
                    {
                        Mensajes.Msgb_Tiene_Movimiento_No_Modificar();
                        Funciones.Fun_Limpiar_Formulario(MainPanel);
                        Txtregistro.Focus();
                    }
                }
                else
                {
                    Funciones.Fun_Limpiar_Formulario(MainPanel);
                }
            }
        }
Пример #3
0
        protected void Fun_Buscar_Nota_Debcre()
        {
            string secuencia = Funciones.Fun_Eliminar_Letras_DeString(Txtregistro.Text);

            if (Txtregistro.Fun_SQL_Buscar_SecuenciaRegistro("SELECT * from cxcdbfdebcre where REPLACE(secuencia,SUBSTRING(secuencia,PATINDEX('%[^0-9]%', secuencia),1),'')=" + Funciones.Fun_Convierte_String_aEntrero(secuencia)))
            {
                DataSet ds = Txtregistro._Dataset;

                Txtcodigocliente.Text   = ds.Tables[0].Rows[0]["idcliente"].ToString();
                Dtpfecha.Value          = Convert.ToDateTime(ds.Tables[0].Rows[0]["fecha"]);
                Txtreferencia.Text      = ds.Tables[0].Rows[0]["referencia"].ToString();
                Txtsubtotal.Text        = ds.Tables[0].Rows[0]["gravado"].ToString();
                Txttotal.Text           = ds.Tables[0].Rows[0]["total"].ToString();
                Txtitbis.Text           = ds.Tables[0].Rows[0]["itbis"].ToString();
                Txtcodigovendedor.Text  = ds.Tables[0].Rows[0]["idvendedor"].ToString();
                Cmbmoneda.SelectedValue = ds.Tables[0].Rows[0]["idmoneda"].ToString();
                Txtbalance.Text         = ds.Tables[0].Rows[0]["balancecliente"].ToString();
                Mskncf.Text             = ds.Tables[0].Rows[0]["ncf"].ToString();
                Txtconcepto.Text        = ds.Tables[0].Rows[0]["concepto"].ToString();
                Fun_Buscar_Cliente();
                Fun_Buscar_Vendedor();
                Fun_Buscar_Detalle_Registro(Funciones.Fun_Convierte_String_aEntrero(ds.Tables[0].Rows[0]["idregistro"].ToString()));
            }
        }