public override void ItemUpdated(SPItemEventProperties properties) { base.ItemUpdated(properties); try { int itemID = Convert.ToInt32(properties.ListItemId); NotOvertimeManagementDAL notovertimeDAL = new NotOvertimeManagementDAL(properties.WebUrl); OverTimeManagementDetailDAL overTimeManagementDetailDAL = new OverTimeManagementDetailDAL(properties.WebUrl); var item = notovertimeDAL.GetByID(itemID); string url = string.Empty; if (item != null) { if (item.ApprovalStatus.Equals("1")) { var notOverTimeRequestEmail = string.Format("{0}/_vti_bin/Services/Email/EmailService.svc/SendNotOverTimeRequestEmail/{1}/{2}", properties.WebUrl, itemID, "BOD"); var delegationNotOverTimeRequestEmail = string.Format("{0}/_vti_bin/Services/Email/EmailService.svc/SendDelegationNotOverTimeRequestEmail/{1}/{2}", properties.WebUrl, itemID, "BOD"); SendEmail(notOverTimeRequestEmail); SendEmail(delegationNotOverTimeRequestEmail); } else if (item.ApprovalStatus.Equals("Approved")) { // udpate overtimeDetail var overtimeDetail = overTimeManagementDetailDAL.GetOvertimeEmployeeByDate(item.Requester.LookupId, item.Date).Where(x => x.ApprovalStatus != null && x.ApprovalStatus.LookupValue == "true").SingleOrDefault(); if (overtimeDetail != null) { overtimeDetail.Task = WORKCONTENT; overtimeDetail.SummaryLinks = string.Format(URL, itemID); overTimeManagementDetailDAL.BulkUpdate(new List <OverTimeManagementDetail>() { overtimeDetail }); } } } } catch (Exception ex) { ULSLogging.Log(new SPDiagnosticsCategory("STADA - NotOvertime Event Receiver - ItemUpdated fn", TraceSeverity.Unexpected, EventSeverity.Error), TraceSeverity.Unexpected, string.Format(CultureInfo.InvariantCulture, "{0}:{1}", ex.Message, ex.StackTrace)); } }