mpnut
MIS
- Aug 27, 2003
- 242
I am very very new to C# (and programming in general) so forgive me if I stumble a little. Here is my code:
int ticket_locked_by()
{
int lockedby;
int mine;
string sqlock = @"SELECT ti_locked_by FROM tickets WHERE ti_id = $id";
sqlock = sqlock.Replace("$id", Convert.ToString(id));
lockedby = Convert.ToInt32(sqlock);
mine = security.user.usid;
if (lockedby == mine)
return 1;
else
return 0;
}
Then I try to get the returned value (either 1 or 0) with:
void Page_Load(Object sender, EventArgs e)
{
if (ticket_locked_by = 1)
{
sub.Value = "LOCKED";
}
else
{
sub.Value = "Unlocked";
}
}
But I get the "cannot assign to 'ticket_locked_by' because it is a method group. I have done some research and I see that you can't assign value to a method group. So how/what can I get ticket_locked_by to be a value or 1 or 0?
int ticket_locked_by()
{
int lockedby;
int mine;
string sqlock = @"SELECT ti_locked_by FROM tickets WHERE ti_id = $id";
sqlock = sqlock.Replace("$id", Convert.ToString(id));
lockedby = Convert.ToInt32(sqlock);
mine = security.user.usid;
if (lockedby == mine)
return 1;
else
return 0;
}
Then I try to get the returned value (either 1 or 0) with:
void Page_Load(Object sender, EventArgs e)
{
if (ticket_locked_by = 1)
{
sub.Value = "LOCKED";
}
else
{
sub.Value = "Unlocked";
}
}
But I get the "cannot assign to 'ticket_locked_by' because it is a method group. I have done some research and I see that you can't assign value to a method group. So how/what can I get ticket_locked_by to be a value or 1 or 0?