Dear all,
I am learning Event Receiver for quite sometime and I am having some knowledge in c# and its methods etc.
I have a doubt in using - item is being deleted event receiver
Scenario lists:-
List A :- RegistrationList
RegID - 10-105
First Name - Ganesh
Last Name - K
E-Mail Address Ganesh.K@ifmr.co.in
Phone Number - 89097890
SessID Readonly field
List B:- SessionList
SessID SharePoint 2010 Advanced for Developers-10
Courses Title - SharePoint 2010 Advanced for Developers
Trainer - x
Training Venue - LA
Register Info - 3
Total Seats Info - 5
Open Seats Info - 2
Start Date - 3/23/2015
End Date 3/27/2015
Scenario:-
List A :- RegistrationList
List B:- SessionList
If RegistrationList - List Item is being deleted I want to deduct 1 from sessionlist in Register Info field. I want the string rID - Registrations ID - first two characters should match the last two characters of Sess ID. In this case it is 10
I am just thinking of this code will work - error in GetItemById:-
if (properties.ListTitle == "Registrations")
{
//SPWeb currentWeb = properties.Web;
//SPList rList = currentWeb.Lists["Registrations"];
//SPListItem rItem = rList.GetItemById
string rID = properties.ListItem["RegID"].ToString();
rID = rID.Remove(rID.Length - 3);
SPWeb currentWeb = properties.Web;
SPList sList = currentWeb.Lists["Session List"];
SPListItem sItem = sList.GetItemById(rID);
}
Let me know.
Warm Regards,
Sathya