Vous êtes sur la page 1sur 75

Parte II

Proyecto 1
Un administrador financiero
personal
Capítulo 14

Diseño del administrador


financiero personal
Relaciones entre tipos y grupos
Grupo Tipo Haber Tipo Debe

Activos X

Pasivos X

Ingresos X

Gastos X
Tabla Groups

Las transacciones financieras


se clasifican dentro de estos
grupos.

Cada cuenta del plan


contable especificará el grupo
al cual pertenece.

Tipos
A: Activos L: Pasivos
I: Ingresos E: Gastos
Tabla de cuentas principales
Es necesario crear una cuenta principal para cada cuenta de
ingresos, gastos, activos y pasivos que desee utilizar. Esto se
denomina Plan de Cuentas.
Balance de
apertura
Grupo
Balance de cierre

Tipo: A, L, I, E
Tipo de comprobante:
Bancario
Ventas
compras

Fecha de comprobante

Comentarios

Referencia
Primera cuenta principal de débito o
crédito

Importe de débito

Número de documento
Número de serie

Importe de crédito

Segunda cuenta principal de débito o


crédito
Registra la selección de cuenta realizada por el usuario.
Capítulo 15

Diseño del administrador


financiero personal
El plan de cuentas
P_masters
create procedure p_masters

@code_value integer = null,


@code_display varchar(30),
@code_category integer = NULL ,
@type char(1)= NULL,
@opening money = 0 ,
@closing money =0,
@group_name varchar(30) = NULL
as
Comentarios
/********************************************************************************
*
This procedures creates or updates a new master record. If a null
code_value is passed, a record is inserted else the record is updated.
You can
pass either the code of the group or the descriptive name of the group.
Example passing the code of the group (604):
execute p_masters 1,' Petty Cash a/c' ,604, 'A',0,0 ,NULL
Example passing the name of the group(Cash a/c):
p_masters 1,'Petty Cash a/c' ,604, 'A',0,0,'Cash a/c'
*********************************************************************************
**/
Declaración de variables
DECLARE @flag integer
DECLARE @oldType as char(1)
DECLARE @grCode_value integer
DECLARE @grType as char(1)
Si se pasa un code_value null
entonces se insertará una cuenta
de otra manera se actualizará.
IF isnull(@code_value,0) = 0
-----------If code value = 0 then INSERT a new record ------------------
BEGIN
IF Datalength(@group_name) > 1
Begin
---- If the group_name is provided look up group
------details using the descriptive name

SELECT @grtype = type ,


@grCode_value = code_value
from Groups
WHERE code_display = rtrim(@group_name)
End
Else
---If a numeric code_value of the group is provided,
---look up the group details using it

Begin

SELECT @grtype = type ,


@grCode_value = code_value
from Groups
WHERE code_value = @code_category

End

Insert into masters(code_category,code_display,type,opening,closing)


Values(@grCode_value ,@code_display,@grtype,isnull(@opening,0),isnull(@closing,0))
IF @@ERROR != 0
begin
GOTO doerror
END
END
Actualiza registro
ELSE
----------UPDATE a record if a code_value is passed
---------
BEGIN
Update masters
Set code_category = @code_category,
code_display = @code_display,
--type = @type, don't allow update of type
opening =@opening,
closing =@closing
Where code_value =@code_value
IF @@ERROR != 0
begin
GOTO doerror
END
END
Fin del procedimiento
SELECT 0
GOTO doreturn
doerror:

Return - 100
doreturn:
RETURN 0
Capítulo 16

Transacciones
P_trans
create procedure p_trans

@date datetime , Parámetros


@ref varchar(30) = NULL,
@dr_amount money = 0,
@cr_amount money =0,
@posted_to integer,
@id char(3),
@doc_no integer = NULL,
@narr varchar(150) = NULL
Comentarios
as
/************************************************************
Author: Hersh Bhasin
This procedure creates or modifies a transaction record.
Each transaction record will have a entry in tr_header and
two records (a debit and a credit record) in the tranasaction table.
Usage:
To Insert a record:
call with a null doc_no to insert
example : exec p_trans @date="01/01/2001", @ref="test",
@code_value = 1, @dr_amount = 10, @cr_amount=0,
@posted_to = "Sales a/c" ,@id="RPT",@doc_no=Null
To modify a record:
call with an existing doc_no:
example : exec p_trans @date="01/01/2001", @ref="test",
@code_value = 1, @dr_amount = 10, @cr_amount=0,
@posted_to = "Sales a/c" ,@id="RPT",@doc_no=50
******************************************************************/
Variables
DECLARE @ll_doc integer
DECLARE @ret integer
DECLARE @code_value integer
Selección de cuenta
/*
Get the selected cash/bank account:
The user makes a selection from
selection.aspx
and tblselection is updated with the
code_value
*/
Select @code_value = selection from
tblSelection
Begin Transaction
BEGIN TRANSACTION

IF isnull(@doc_no,0) = 0
--INSERT--
BEGIN
--SafeGuard : Check if tranaction with same ref# exists. If so dont insert
select @ret = count(*) from tr_header where ref = @ref
if @ret > 0
BEGIN
--raiserror (53000, 1,16)
GOTO doerror
END

Select @ll_doc = isnull(max(doc_no),0)+1 from tr_header


IF @@ERROR != 0
begin
GOTO doerror
END
END
Delete
ELSE
--UPDATE__
BEGIN
SELECT @ll_doc = @doc_no

delete from transactions where


doc_no = @doc_no
IF @@ERROR != 0
begin
GOTO doerror
END
delete from tr_header where
doc_no = @doc_no
IF @@ERROR != 0
begin
GOTO doerror
END
END
Insert
BEGIN

INSERT INTO tr_header ( id, date,ref, doc_no ,narr) VALUES


(@id, isnull(@date,getdate()),@ref, @ll_doc, @narr)
IF @@ERROR != 0
begin
GOTO doerror
END

INSERT INTO transactions ( doc_no, dr_amount, cr_amount,


code_value, sr_no,posted_to )
VALUES
( @ll_doc, isnull(@dr_amount,0), ISNULL(@cr_amount,0),
@code_value, 1 ,@posted_to)
IF @@ERROR != 0
begin
GOTO doerror
END

INSERT INTO transactions ( doc_no, dr_amount, cr_amount,


code_value, sr_no, posted_to )
VALUES
( @ll_doc, ISNULL(@cr_amount,0),ISNULL(@dr_amount,0),
@posted_to, 2 ,@code_value)

IF @@ERROR != 0
begin
GOTO doerror
END

END
Fin de procedimiento
COMMIT TRANSACTION
SELECT 0
GOTO doreturn
doerror:

Rollback TRANSACTION
doreturn:
RETURN 0
SELECT -100

GO
On Transactions For insert…
CREATE TRIGGER insert_mstr
ON transactions for insert
As
Declare @sql varchar(200)
DECLARE @mtype char(1)
DECLARE @amount money

SELECT @mtype = masters.type


FROM masters, inserted
WHERE ( masters.code_value = inserted.code_value )

SELECT *
into #temp
from inserted
On Transactions For insert
If @mtype = 'A' or @mtype = 'E'
BEGIN
SELECT @amount = ISNULL(#temp.dr_amount,0) -
ISNULL(#temp.cr_amount,0)
FROM #temp
END
ELSE
BEGIN
SELECT @amount = ISNULL(#temp.cr_amount,0) -
ISNULL(#temp.dr_amount,0)
FROM #temp
END
UPDATE MASTERS
SET closing = closing + @amount
FROM masters, #temp
WHERE ( masters.code_value = #temp.code_value )
On Transactions For update…
CREATE TRIGGER update_mstr ON transactions
for update
as
Declare @sql varchar(200)
DECLARE @mtype char(1)
DECLARE @amount money

SELECT @mtype = masters.type


FROM masters, inserted
WHERE ( masters.code_value = inserted.code_value )

SELECT *
into #temp
from inserted

SELECT *
into #t2
from deleted
On Transactions For update…
If @mtype = 'A' or @mtype = 'E'
BEGIN
SELECT @amount =
ISNULL(#temp.dr_amount,0) -
ISNULL(#temp.cr_amount,0)
- ISNULL(#t2.dr_amount,0) +
isnull(#t2.cr_amount ,0)
FROM #temp, #t2
WHERE #temp.code_value = #t2.code_value
END
ELSE
BEGIN
SELECT @amount =
ISNULL(#temp.cr_amount,0) -
ISNULL(#temp.dr_amount,0)
- ISNULL(#t2.cr_amount,0) +
isnull(#t2.dr_amount ,0)
FROM #temp, #t2
WHERE #temp.code_value = #t2.code_value
END
On Transactions For update
UPDATE Masters
SET Closing = Closing + @amount
FROM masters, #temp
WHERE ( masters.code_value =
#temp.code_value )
On Transactions For delete ….

CREATE TRIGGER delete_mstr


ON transactions for delete
As
Declare @sql varchar(200)
DECLARE @mtype char(1)
DECLARE @mmonth char(3)
DECLARE @amount money
DECLARE @mstr_amount money
On Transactions For delete….

SELECT *
into #temp
from deleted
On Transactions For delete….
UPDATE Masters
SET Closing = isnull(Closing,0)-
(ISNULL(t.dr_amount,0)-
ISNULL(t.cr_amount,0))
FROM masters m, #temp t
WHERE m.code_value = t.code_value
AND m.type in("A","E")

UPDATE Masters
SET Closing = isnull(Closing,0)-
(ISNULL(t.cr_amount,0) - ISNULL(t.dr_amount,0))
FROM masters m, #temp t
WHERE m.code_value = t.code_value
AND m.type in("I","L")
Objetivo
• Mostrar, en una lista, en las que se incluyen
todas las cuentas principales de tarjeta de
crédito, a la vista, o bancarias, que se han
definido en el sistema.
• El usuario selecciona la cuenta financiera
apropiada con la que se desee trabajar y luego
hace clic en un botón Submit. De esta forma se
desplaza hasta la página web de transacciones
que es donde realmente se lleva a cabo el
proceso.
Import
<%@ Import Namespace="System.Data"
%>
<%@ Import
Namespace="System.Data.SqlClient" %>
Variables
<html>
<script language="VB" runat="server">
Dim myConnection As SqlConnection
Dim myCommand As SqlDataAdapter
Dim ds As New DataSet
Dim ConnStr As String
Dim SQL As String
Load
Sub Page_Load(Source As Object, E As
EventArgs)
ConnStr = "Data Source=(local);Initial
Catalog=ASPNET;Integrated Security=True;"
myConnection = New
OleDbConnection(ConnStr)
if NOT (isPostBack)
rebind
end if
End Sub
Submit
Sub SubmitBtn_Click(sender As Object, e As EventArgs)
Session("TheSelectionText")= Selection.SelectedItem.Text
Session("TheSelectionValue")= Selection.SelectedItem.Value
Response.Redirect("Transactions.aspx")

End Sub
Rebind
Sub ReBind()
'DataSetCommand
SQL = "Select * from masters where
code_category in (604,605) order by
code_display"
myCommand = New OleDbDataAdapter(SQL,
myConnection)
'utilice el método Fill de DataSetCommand
para completar el conjunto de datos
myCommand.Fill(ds, "Masters")

Selection.DataSource=ds.Tables("Masters").Def
aultView
Selection.DataBind()
End Sub
Controles
<body>
<h3><font face="Verdana">Financial Account
Selection</font></h3>
<form runat="server" >
Select Cash or Bank Account :</B>
<asp:DropDownList DataTextField = "code_display"
DataValueField = "code_value" id="selection" runat="server" />
<asp:Button text="Go" runat="server" OnClick="SubmitBtn_Click"
/>
</form>
</body>
</html>
Objetivo
• Permite a los usuarios añadir y modificar
registros.
Import
<%@Page Language="VB"
Inherits="BaseClass"
Src="transactions.vb" %>
<%@ Import Namespace="System.Data"
%>
<%@ Import
Namespace="System.Data.SqlClient" %>
Variables
• <html>
• <script language="VB" runat="server">
• Sub Grid1_Update(sender As Object, e As
DataGridCommandEventArgs)
• Dim sql As string
• Dim vdate As String
• Dim ref As String
• Dim code_value As String
• Dim dr_amt As String
• Dim cr_amt As String
• Dim posted_display As String
• Dim id As String
• Dim narr As String
• Dim myTextBox As TextBox
Valor clave
'Éste el el valor clave : Recuperado del DataKey, dado que se trata
de un campo de sólo lectura
Dim doc_no as string =
Grid1.DataKeys.Item(E.Item.ItemIndex).ToString
myTextBox = E.Item.FindControl("edit_date")
vdate = trim(mytextbox.text)
myTextBox = E.Item.FindControl("edit_ref")
ref = trim(mytextbox.text)
myTextBox = E.Item.FindControl("edit_dr_amt")
dr_amt = trim(mytextbox.text)
myTextBox = E.Item.FindControl("edit_cr_amt")
cr_amt = trim(mytextbox.text)
myTextBox = E.Item.FindControl("edit_posted_display")
posted_display= trim(mytextbox.text)
myTextBox = E.Item.FindControl("edit_narr")
narr = trim(mytextbox.text)
Procedimiento almacenado
'Ahroa ejecute el procedimiento almacenado

sql = "Execute p_trans @date = '" + vdate+ "' ,@ref= '"


sql = sql + ref + "', @dr_amount ="
sql = sql + dr_amt + ",@cr_amount = "
sql = sql + cr_amt +" , @posted_to = " +
posted_display + " ,"
sql = sql + "@id = 'RPT', @doc_no = " + doc_no + ",
@narr= '" + narr+ "'"
RunSql(sql)
rebind()
End Sub
Add_Click
Sub add_click(Source As Object, E As EventArgs)
Dim sql As string
sql = "Execute p_trans @date = '" + adate.text + "' ,"
sql = sql + "@ref= '" + aref.text + "', @dr_amount = "
sql = sql + adr_amount.text + ",@cr_amount = "
sql = sql + acr_amount.text +" , @posted_to = '"
sql = sql + aposted_display.SelectedItem.value + "' ,"
sql = sql + "@id = 'RPT', @doc_no = NULL" + ", @narr= '"
sql = sql + anarr.text + "'"
RunSql(sql)
rebind()
hidePanel()
End Sub
Nueva transacción
Sub add_show(Source As Object, E As
EventArgs)
AddPanel.visible = true
End Sub
Delete
Sub Grid1_delete(sender As Object, e As
DataGridCommandEventArgs)
Dim doc_no As string =
Grid1.DataKeys.Item(E.Item.ItemIndex).ToString
Dim sql As string
sql = " Delete from transactions where doc_no = " +
cstr(doc_no)
sql = sql + " Delete from tr_header where doc_no = " +
cstr(doc_no)
RunSql(sql)
rebind()
End Sub
</script>
Hipervínculos
<body style="font: 10pt verdana">
<form runat="server">
<asp:ValidationSummary runat=server
headertext="There were errors on the page:" />
<h3><font face="Verdana"> Transactions for
<asp:Label id="title" runat="server"/>
</font></h3>
<asp:HyperLink runat="server" Text="Financial Account Selection "
NavigateUrl="selection.aspx"></asp:HyperLink>&nbsp
<asp:HyperLink runat="server" Text="Masters"
NavigateUrl="masters3.aspx">
</asp:HyperLink>&nbsp
<asp:HyperLink runat="server" Text="Trial Balance"
NavigateUrl="TrialBalance.aspx">
</asp:HyperLink>&nbsp
<asp:HyperLink runat="server" Text="Home"
NavigateUrl="default.aspx">
</asp:HyperLink>
Tabla
<table width="95%">
<tr><td>
<asp:Button id="Addshow" visible = "false"
text="New Transaction"
onclick="add_show" runat="server" />
</td></tr>
<hr>
<tr>
<td valign="top">
Datagrid …
<asp:DataGrid id="Grid1" runat="server"
AutoGenerateColumns="false"
BackColor="White"
BorderWidth="1px" BorderStyle="Solid"
BorderColor="Tan"
CellPadding="2" CellSpacing="0"
Font-Name="Verdana" Font-Size="8pt"
OnEditCommand="Grid1_Edit"
OnCancelCommand="Grid1_Cancel"
OnUpdateCommand="Grid1_Update"
OnDeleteCommand = "Grid1_delete"
DataKeyField="doc_no">
Datagrid...columns
<Columns>
<asp:EditCommandColumn
EditText="Edit"
CancelText="Cancel"
UpdateText="OK"
ItemStyle-Wrap="false"
HeaderText="Edit"
HeaderStyle-Wrap="false"/>
<asp:ButtonColumn Text="Delete" CommandName="Delete"
HeaderText="Delete"/>
<asp:BoundColumn HeaderText="Doc #" ReadOnly="true"
DataField="doc_no"/>
<asp:TemplateColumn HeaderText="Ref" >
Datagrid..templates
<ItemTemplate>
<asp:Label Text='<%# Container.DataItem("ref") %>' runat="server"/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="edit_ref" Text='<%# Container.DataItem("ref") %>'
runat="server"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Date" >
<ItemTemplate>
<asp:Label Text='<%# Container.DataItem("date") %>' runat="server"
/>
</ItemTemplate>
<EditItemTemplate >
<asp:TextBox id="edit_date" BorderStyle="None" Readonly="True"
Text='<%# Container.DataItem("date") %>' runat="server" />
</EditItemTemplate>
</asp:TemplateColumn>
Datagrid…Template
<asp:TemplateColumn HeaderText="Payee" >
<ItemTemplate>
<asp:Label Text='<%# Container.DataItem("posted_display") %>'
runat="server"/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="edit_posted_display"
Text='<%# Container.DataItem("posted_to") %>'
runat="server" ReadOnly="true" BorderStyle="None" />
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Narration" >
<ItemTemplate>
<asp:Label Text='<%# Container.DataItem("narr") %>'
runat="server"/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="edit_narr" Text='<%# Container.DataItem("narr")
%>'
runat="server"/>
</EditItemTemplate>
</asp:TemplateColumn>
Datagrid … template
<asp:TemplateColumn HeaderText="Deposit" >
<ItemTemplate>
<asp:Label Text='<%# Container.DataItem("dr_amount") %>'
runat="server"/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="edit_dr_amt"
Text='<%# Container.DataItem("dr_amount") %>' runat="server"/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Payment" >
<ItemTemplate>
<asp:Label Text='<%# Container.DataItem("cr_amount") %>'
runat="server"/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox id="edit_cr_amt"
Text='<%# Container.DataItem("cr_amount") %>' runat="server"/>
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
Datagrid
<HeaderStyle BackColor="DarkRed"
ForeColor="White" Font-Bold="true">
</HeaderStyle>
<ItemStyle ForeColor="DarkSlateBlue">
</ItemStyle>
<AlternatingItemStyle BackColor="Beige">
</AlternatingItemStyle>
</asp:DataGrid>
</td>
Lógica de inserción…
<td valign="top">
<!---- lógica de inserción de fila-------------->
<asp:Panel id="AddPanel" runat="server" Visible="false">
<table style="font: 8pt verdana">
<tr>
<td colspan="2" bgcolor="#aaaadd" style="font:10pt verdana">
Add a New Transaction:</td>
</tr>
<tr>
<td nowrap>Date (Required): </td>
<td><asp:TextBox id="adate" runat="server" value = "" /></td>
<td> <asp:RequiredFieldValidator runat=server
controltovalidate=adate
errormessage="Date is required.">*
</asp:RequiredFieldValidator></td>
</tr>
Lógica de inserción…
<tr>
<td nowrap>Reference (Required/ must be unique): </td>
<td><asp:TextBox id="aref" value = "" runat="server" /></td>
<td> <asp:RequiredFieldValidator runat=server
controltovalidate=aref
errormessage="A unique reference # is required.">*
</asp:RequiredFieldValidator></td>
</tr>
<tr>
<td nowrap>Account Posted To: </td>
<td><asp:DropDownList DataTextField = "code_display"
DataValueField = "code_value" id="aposted_display" runat="server" /></td>
</tr>
<tr>
<td nowrap>Narration: </td>
<td><asp:TextBox id="anarr" value = "" runat="server" /></td>
</tr>
<tr>
<td nowrap>Deposit Amount: </td>
<td><asp:TextBox id="adr_amount" value = 0 runat="server" /></td>
</tr>
Lógica de inserción
<tr>
<td nowrap>Payment Amount: </td>
<td><asp:TextBox id="acr_amount" value = 0 runat="server"
/></td>
</tr>
<tr>
<td style="padding-top:15">
<asp:Button id="SubmitDetailsBtn" text="Submit"
onclick="add_Click"
runat="server" />
</td>
</tr>
</table>
</asp:Panel>
<!-------------Fin de lógica de inserción -------->
Fin de la página
</td>
</tr>
</table>
<hr>
<asp:Label id="Message" runat="server"/>
</form>
</body>
</html>
Imports
Option Strict Off
Imports System
Imports System.Collections
Imports System.Text
Imports System.Data
Imports System.Data.OleDb
Imports System.Web.UI
Imports System.Web.UI.WebControls
Variables
Public Class BaseClass
Inherits System.Web.UI.Page
protected Grid1 as DataGrid
Protected Message as label, title as label
Protected aposted_display as dropdownlist, selection as dropdownlist
Protected AddPanel as Panel
Protected adate as TextBox, aref as TextBox, adr_amount as TextBox
Protected acr_amount as TextBox , anarr as TextBox
Protected addshow as button
Dim myConnection As OleDbConnection
Dim myCommand As OleDbDataAdapter
Dim ds As New DataSet
Dim ConnStr As String
Dim SQL As String
Page_Load
Sub Page_Load(Source As Object, E As EventArgs)
ConnStr = "Data Source=(local);Initial Catalog=ASPNET;Integrated
Security=True;"
myConnection = New OleDbConnection(ConnStr)
if NOT (isPostBack)
dim code as string, display as string
'alternativa para la versión RC. Aparentemente, el Request.Form
'no funcionaba en la versión RC
'code = Request.Form("Selection")
'title.text = code
code = Session("TheSelectionValue")
title.text = Session("TheSelectionText")
if code = "" then
response.redirect("selection.aspx")
end if
UpdateSelection(code)
rebind
end if
End Sub
Rebind
Sub ReBind()
SQL = " select m.code_value,m.code_display,t.*, h.* ,"
sql = sql + "(select code_display from masters where code_value = t.posted_to) as
posted_display"
sql = sql + " from tr_header h,transactions t, masters m "
sql = sql + " where t.doc_no = h.doc_no "
sql = sql + " and m.code_value = t.code_value"
sql = sql + " and m.code_value = (select selection from tblSelection)"
myCommand = New OleDbDataAdapter(SQL, myConnection)
'utilice el método Fill para completar el conjunto de datos
myCommand.Fill(ds, "transactions")
'Vinculación a una cuadrícula
Grid1.DataSource=ds.Tables("transactions").DefaultView
Grid1.DataBind()
'complete la lista desplegable de selección de cuentas
'visible en el modo agregar
SQL = "Select * from masters where code_value <> "
SQL = SQL + " (select selection from tblSelection)"
myCommand = New OleDbDataAdapter(SQL, myConnection)
myCommand.Fill(ds, "masters")
aposted_display.DataSource=ds.Tables("masters").DefaultView
aposted_display.DataBind()
addshow.visible = true
End Sub
Grid1_Edit
Sub Grid1_Edit(Sender As Object, E As
DataGridCommandEventArgs)
Grid1.EditItemIndex = E.Item.ItemIndex
ReBind()
End Sub
Grid1_Cancel
• Sub Grid1_Cancel(Sender As Object, E
As DataGridCommandEventArgs)
• Grid1.EditItemIndex = -1
• ReBind()
• End Sub
RunSql
Sub RunSql(vsql as string)
try
'sql = "Execute p_test " + vkey
Dim mycommand2 As New OleDbCommand(vsql,myConnection)
myConnection.Open()
myCommand2.ExecuteNonQuery()
myConnection.Close()
'desactive la edición
Grid1.EditItemIndex = -1
Catch ex As OleDbException
' error SQL
Dim errItem As OleDbError
Dim errString As String
For Each errItem In ex.Errors
errString += ex.Message + "<br/>"
Next
Message.Style("color") = "red"
Response.write("DataBase Error :" + errString)
catch myException as Exception
Response.Write("Exception: " + myException.ToString())
Message.Style("color") = "red"
Finally
message.text = vsql
end try
End sub
HidePanel
sub hidePanel()
if AddPanel.visible = true then
AddPanel.visible = false
'restablezca los valores
adate.text = ""
aref.text = ""
adr_amount.text = ""
acr_amount.text = ""
anarr.text = ""
end if
end sub
UpdateSelection
Sub UpdateSelection(vselection)
sql = "delete from tblSelection "
sql = sql + " insert into
tblSelection(selection)"
sql = sql + " values('" + vselection + "')"
runSql(sql)
End Sub
End Class

Vous aimerez peut-être aussi