public void SendNotificationToReporter(bool isApproved) { SupervisorNotificationDTO req = new ClassLibrary.DTO.SupervisorNotificationDTO(); req.SenderId = (currentUserid != 0) ? currentUserid : 1; req.ReceiverId = SupervisorNotificationDTO.SenderId; req.ResponseToId = SupervisorNotificationDTO.SupervisorNoticationId; DateTime dtNow = DateTime.Now; req.NotificationTime = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, dtNow.Hour, dtNow.Minute, dtNow.Second, dtNow.Millisecond); req.DangerousViolatorDetails = new SupervisorNotificationReportDangerousDTO() { PlateNumber = SupervisorNotificationDTO.DangerousViolatorDetails.PlateNumber, PlateAuthority = SupervisorNotificationDTO.DangerousViolatorDetails.PlateAuthority, PlateColor = SupervisorNotificationDTO.DangerousViolatorDetails.PlateColor, PlateKind = SupervisorNotificationDTO.DangerousViolatorDetails.PlateKind, BusinessRuleId = SupervisorNotificationDTO.DangerousViolatorDetails.BusinessRuleId, NotificationText = Comments, Lat = SupervisorNotificationDTO.DangerousViolatorDetails.Lat, Lon = SupervisorNotificationDTO.DangerousViolatorDetails.Lon, }; req.Status = isApproved ? SupervisorNotificationStatus.Approved : SupervisorNotificationStatus.Rejected; var saveNotification = client.SaveSupervisorNotificationAsync(req); saveNotification.ContinueWith(x => SaveNotificationResult(x.Result, isApproved, req)); }
private void SubmitExecute() { ResponseMsg = string.Empty; string closeMsg = Properties.Resources.strAlertOpRoomConfMsg; //string closeMsg = Utility.GetLang() == "en" ? "Are you sure, want to Alert the Operation Room?" : "؟"; MessageBoxControl.MessageBoxUserControl closeMsgBox = new MessageBoxUserControl(closeMsg, true); //closeMsgBox.Owner = Window.GetWindow(this); closeMsgBox.ShowDialog(); var res = closeMsgBox.GetResult(); if (res == true) { SupervisorNotificationDTO req = new SupervisorNotificationDTO(); req.SenderId = currentUserId; req.ReceiverId = client.GetSupervisorId(); DateTime dtNow = DateTime.Now; //req.NotificationTime = dtNow; req.NotificationTime = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, dtNow.Hour, dtNow.Minute, dtNow.Second, dtNow.Millisecond); req.IsNoticed = false; if (DangerousVehicleDetailsDTOobj != null) { req.DangerousViolatorDetails = new SupervisorNotificationReportDangerousDTO(); req.DangerousViolatorDetails.NotificationText = ReportMessage; req.DangerousViolatorDetails.PlateNumber = DangerousVehicleDetailsDTOobj.PlateNumber; req.DangerousViolatorDetails.PlateKind = DangerousVehicleDetailsDTOobj.PlateKind; req.DangerousViolatorDetails.PlateColor = DangerousVehicleDetailsDTOobj.PlateColor; req.DangerousViolatorDetails.PlateAuthority = DangerousVehicleDetailsDTOobj.PlateSource; } var saveRes = client.SaveSupervisorNotificationAsync(req); saveRes.ContinueWith(x => AlertOperationRoomResult(x.Result)); //AddBusinessRuleResult(true); } }