예제 #1
0
        protected void Fun_Buscar_Recibo_Ingreso()
        {
            string secuencia = Funciones.Fun_Eliminar_Letras_DeString(Txtcobro.Text);

            if (Txtcobro.Fun_SQL_Buscar_SecuenciaRegistro("SELECT * from cxcdbfcobro where REPLACE(secuencia,SUBSTRING(secuencia,PATINDEX('%[^0-9]%', secuencia),1),'')=" + Funciones.Fun_Convierte_String_aEntrero(secuencia)))
            {
                DataSet ds = Txtcobro._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();
                Txttotalcargo.Text          = ds.Tables[0].Rows[0]["totalcargo"].ToString();
                Txttotalcob.Text            = ds.Tables[0].Rows[0]["total"].ToString();
                Txttotaldescuento.Text      = ds.Tables[0].Rows[0]["totaldescuento"].ToString();
                Txttotalretencionisr.Text   = ds.Tables[0].Rows[0]["totalretencionisr"].ToString();
                Txttotalretencionitbis.Text = ds.Tables[0].Rows[0]["totalretencionitbis"].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();
                Fun_Buscar_Cliente();
                Fun_Buscar_Vendedor();
                Fun_Buscar_Detalle_Registro(Funciones.Fun_Convierte_String_aEntrero(ds.Tables[0].Rows[0]["idcobro"].ToString()));
            }
        }
예제 #2
0
        protected void Fun_Buscar_Cobro_Adelantado()
        {
            string secuencia = Funciones.Fun_Eliminar_Letras_DeString(Txtcobro.Text);

            if (Txtcobro.Fun_SQL_Buscar_SecuenciaRegistro("SELECT * from cxcdbfcobroadelantado where REPLACE(secuencia,SUBSTRING(secuencia,PATINDEX('%[^0-9]%', secuencia),1),'')=" + Funciones.Fun_Convierte_String_aEntrero(secuencia)))
            {
                DataSet ds = Txtcobro._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();
                Txtmonto.Text           = ds.Tables[0].Rows[0]["monto"].ToString();
                Cmbmoneda.SelectedValue = ds.Tables[0].Rows[0]["idmoneda"].ToString();
                Txtconcepto.Text        = ds.Tables[0].Rows[0]["concepto"].ToString();
                Fun_Buscar_Cliente();
            }
        }
        protected void Fun_Buscar_Cobro_Adelantado()
        {
            if (_OpcionSQL == "Modificar")
            {
                string secuencia = Funciones.Fun_Eliminar_Letras_DeString(Txtcobro.Text);

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


                    if (Funciones.Fun_Convierte_String_aDecimal(ds.Tables[0].Rows[0]["balance"].ToString()) == Funciones.Fun_Convierte_String_aDecimal(ds.Tables[0].Rows[0]["monto"].ToString()))
                    {
                        Txtcobro.Enabled        = false;
                        BtnBuscarCobro.Visible  = false;
                        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();
                        Txtmonto.Text           = ds.Tables[0].Rows[0]["monto"].ToString();
                        Txtconcepto.Text        = ds.Tables[0].Rows[0]["concepto"].ToString();
                        Cmbmoneda.SelectedValue = ds.Tables[0].Rows[0]["idmoneda"].ToString();
                        Fun_Buscar_Cliente();
                    }
                    else
                    {
                        Mensajes.Msgb_Tiene_Movimiento_No_Modificar();
                        Funciones.Fun_Limpiar_Formulario(MainPanel);
                        Txtcobro.Focus();
                    }
                }
                else
                {
                    Funciones.Fun_Limpiar_Formulario(MainPanel);
                }
            }
        }