User Profile & Activity

Jakub Pukovec Member
Posted: June 20, 2013 7:43 AM
The stored procedure p_WebSchedulerResources_ins properly inserts new resources row to the database and returns new ResourceID (@@IDENTITY) and this identity value is returned from the Insert method of ResourceAdapter. There is nothing wrong with the resource related functionaly.
Later, ther is a problem with EventsAdapter - Update method as this method automatically takes old ResourceID (not the updated one). So the new record is not updated.
I need to refresh page manually and the it stars working properly.
So I believe only the problem here is the new resourceID is not properly sent between ResourcesAdapter and EventsAdapter.

Thanks,
Jakub
Posted: June 19, 2013 12:44 PM
I'm now stuck with the following problem:
I programmatically enter data row to Resources table and return the new ResourceID - I explicitly call ResourcesTableAdapter.Insert method from EventsTableAdapter and return ResourceID as return value from ResourcesTableAdapter.Insert method.
But after I try to update the newly entered event later, the ResourceID is not updated - I always get lower ResourceID than the last entered in the EventsTableAdapter.Update method...

The problem is probably I crate new instance of ResourcesTableAdapter explicitly (as I need to get access to ResourcesTableAdapter from EventsTableAdapter)...
(new WebSchedulerResourcesTableAdapter()).Insert(-1, _userID, "User", null, "#00AA00");

Please, is there any way to access the existing instance of ResourcesTableAdapter from EventsTableAdapter?

Source code attached.

Thank you,
Jakub
Posted: June 17, 2013 11:41 AM

Ok, this is solved. The problem was related to the return value of the custom Insert metod in the EventsTableAdapter.

return (int)command.ExecuteScalar()

needs to be changed to

return Convert.ToInt32(command.ExecuteScalar())

Posted: June 14, 2013 5:50 AM
Unfortunately I'm unable to create any ClientSideEvent handler (via properties tab in designer). I'm getting well know "Object reference not set to an instance of an object" exception any time when trying to create client side event handler.
I've installed WebScheduler, IsDataSource and ISLinqDataSource tools using trial version webuistudio2012r2web.exe.

Do you have an idea what might be a problem? I also tried to uninstall and re-install the plugin and registered SmartWebResources.
The same issue when trying to create client event handlers via Component Designer 2.0 (Component Type: WebScheduler.NET 3.0)

Thanks,
Jakub
Posted: June 13, 2013 9:25 AM
Hi Bernard,

I've got another related problem. Say we might have dozens thousands users. Is there any way to forbid/disallow user to select resource manually?
I'd need to add a record to resources table automatically on first user's hit. My idea is to extend Resources table to contain UserID. This approach would allow me to pair user events with users the events belong to.
Every user should see only his/her event and no user should have an opportunity to select resource manually.
So I'd like to hide resources view (possible to do by setting DisplayResourcesTable to false) and also I'd like to disable / hide the resourceid dropdown in "create new event" flyout. I'd like to fill the resourceID programatically based on the retrieved UserID - getting resourceID programatically based on UserID via stored procedure and then filtering events programatically by the retrieved resourceID.
Thus users would automatically see ONLY events that were entered under their own UserID.
Is this possible to do or are there any suitable alternatives?

Thank you,
Jakub
Posted: June 11, 2013 3:00 AM
Hi Bernard,

thank you for your answer. Yes, you're right. I don't know why I omitted the resources table. From some reason I was in some illusion that this table is intended for something slightly different. But this wasn't true.

Thanks again,
Regards,
Jakub
All times are GMT -5. The time now is 1:49 PM.
Previous Next