Archive for September 22, 2008

Passing variables for a image between Javascript and PHP for web2

Try a javascript image object:

var myImage = new Image();
myImage.src = “http://mydomain.xxx/myfile.php?x=” +x+ “&y=” +y”;

then you can use $_GET[x]  in myfile.php to take the variable

Advertisements

September 22, 2008 at 7:55 am Leave a comment

Janus gridEX click event c#

Useful query c# adonet

private void gridEX1_Click(object sender, EventArgs e)
{

//get position

int i = this.gridEX1.SelectedItems[0].Position;

//get id from column(0) and row position  ( dataset)

string id=  gridEX1.GetRow(i).Cells[0].Text;

}

September 22, 2008 at 7:43 am Leave a comment

Function field value is egual in .net c#

private static bool fieldValuesAreEqual(object[] lastValues, DataRow currentRow, string[] fieldNames)
{
bool areEqual = true;

for (int i = 0; i < fieldNames.Length; i++)
{
if (lastValues[i] == null || !lastValues[i].Equals(currentRow[fieldNames[i]]))
{
areEqual = false;
break;
}
}

return areEqual;
}

September 22, 2008 at 7:38 am Leave a comment

SQL create a procedure with update and insert a other table

CREATE PROCEDURE dbo.sp_UpdateLibList
@TableId     as numeric(18,0),
@descr1     as nvarchar(2048),
@descr2    as nvarchar(2048) = ‘ ‘,
@reftableid     as numeric(18,0),
@seealso     as nvarchar(2048),
@newsee    as numeric(18,0),
@UserID     as numeric(18,0)
AS
BEGIN
DECLARE    @Event_ID as Numeric(18,0),
@Table_Code     as nvarchar(50)

SET NOCOUNT ON
select @Table_Code = ( select Top 1 Table_Code from LibTables where Field_Code = ( select fieldcode from liblist where tableid = @tableid) )
if @Table_Code is not null
begin
UPDATE LibList
SET     descr1         = @descr1 ,
descr2         = @descr2 ,
reftableid     = @reftableid,
seealso        = @seealso,
newsee        = @newsee
WHERE tableid        = @tableid

INSERT INTO LibEvent ( Event_Type, TableId, Table_Code)
VALUES ( ‘U’, @TableId, @Table_Code )
SELECT @Event_ID = @@IDENTITY

INSERT INTO UserEvents ( [User_ID], Event_ID )
VALUES ( @UserID, @Event_ID )
end
END

September 22, 2008 at 7:35 am Leave a comment


September 2008
M T W T F S S
« Aug   Oct »
1234567
891011121314
15161718192021
22232425262728
2930