I try this in ItemAdding, but it isn't work(Gives Null): public override void ItemAdding(SPItemEventProperties properties) { base.ItemAdding(properties);
if (properties.List.Title == "Wpisy")
{
SPList lstOtherList = properties.Web.Lists["Szczegoly"];
DateTime dzienStart = new DateTime();
DateTime dzienStop = new DateTime();
dzienStart = Convert.ToDateTime(properties.AfterProperties["DzienStart"]).ToUniversalTime();
dzienStop = Convert.ToDateTime(properties.AfterProperties["DzienStop"]).ToUniversalTime();
while(dzienStart<=dzienStop){
if (dzienStart.DayOfWeek.ToString() == "Saturday" || dzienStart.DayOfWeek.ToString() == "Sunday")
{
dzienStart = dzienStart.AddDays(1.0);
continue;
}
{
SPListItem item = lstOtherList.Items.Add();
item["Kontrakt"] = properties.AfterProperties["Kontrakt1"];
item["Pracownik"] = properties.AfterProperties["Pracownik1"];
item["Dzien"] = dzienStart;
item["Procenty"] = properties.AfterProperties["Procenty"];
**item["ID z Czas Pracy Wpisy"] = properties.AfterProperties["Id"];**
dzienStart = dzienStart.AddDays(1.0);
item.Update();
}
}
}
}