コード例 #1
0
 public int Update(NtfNotification newNotification)
 {
     NtfNotification oldNotification = RetrieveNotificationById(newNotification.NotificationId);
     context.Entry(oldNotification).State = EntityState.Deleted;
     context.Entry(newNotification).State = EntityState.Modified;
     return context.SaveChanges();           
 }
コード例 #2
0
ファイル: UserRepository.cs プロジェクト: GSA/HRIT-QMS-3.1
 public int CreateUser(SecUser secUser)
 {
     context.SecUser.Add(secUser);
     foreach (var sur in secUser.SecUserRole)
     {
         context.SecUserRole.Add(sur);
     }
     context.SaveChanges();
     return(secUser.UserId);
 }
コード例 #3
0
        internal void addHistory(IAssignable item, User actionTakenByUser, string ActionDescription)
        {
            QmsWorkitemhistory itemHistory = new QmsWorkitemhistory();

            itemHistory.ActionTakenByUserId      = actionTakenByUser.UserId;
            itemHistory.CreatedAt                = DateTime.Now;
            itemHistory.WorkItemId               = item.Id;
            itemHistory.PreviousStatusId         = item.StatusId;
            itemHistory.PreviousAssignedByUserId = item.AssignedByUserId;
            itemHistory.PreviousAssignedToOrgId  = item.AssignedToOrgId;
            itemHistory.PreviousAssignedtoUserId = item.AssignedToUserId;
            itemHistory.ActionDescription        = ActionDescription;
            itemHistory.WorkItemTypeCode         = item.WorkItemType;
            context.Add(itemHistory);
            context.SaveChanges();
        }
コード例 #4
0
        private void sendIndividualMessage(IListable entity, NtfNotificationevent ne, User submitter, QmsWorkitemcomment comment)
        {
            if(submitter.UserId != entity.CreatedByUserId.Value) // if the person doing the action is the originator they don't get a message since they did the action
            {
                NtfNotification notification = new NtfNotification();
                notification.CreatedAt = DateTime.Now;
                notification.HasBeenRead = 0;
                notification.Title = string.Format(ne.TitleTemplate,entity.Id);
                notification.WorkitemId = entity.Id;
                notification.WorkItemTypeCode = WorkItemTypeEnum.CorrectiveActionRequest;
                notification.SendAsEmail = 1;
                notification.NotificationEventId = ne.NotificationEventId;
                notification.Message = entity.Message;
                switch(ne.NotificationEventCode)
                {
                    case CorrectiveActionNotificationType.CA_Assigned:
                        notification.UserId = entity.AssignedToUserId.Value;
//                        notification.Message = string.Format(ne.MessageTemplate,ca.Id, ca.AssignedAt.Value.ToShortDateString(),ca.EmplId,ca.Employee.FullName);
                        break;
                    case CorrectiveActionNotificationType.CA_Created:
                        notification.UserId = entity.CreatedByUserId.Value;
//                        notification.Message = string.Format(ne.MessageTemplate,ca.Id, ca.CreatedAt.ToShortDateString(),ca.EmplId,ca.Employee.FullName);
                        break;
                    case CorrectiveActionNotificationType.CA_Returned:
                        notification.UserId = entity.CreatedByUserId.Value;
//                        notification.Message = string.Format(ne.MessageTemplate,ca.Id, ca.UpdatedAt.Value.ToShortDateString(),ca.EmplId,ca.Employee.FullName);
                        break;
                    case CorrectiveActionNotificationType.CA_Closed:
                        notification.UserId = entity.CreatedByUserId.Value;
//                        notification.Message = string.Format(ne.MessageTemplate,ca.Id, ca.ResolvedAt.Value.ToShortDateString(),ca.EmplId,ca.Employee.FullName);
                        break;                    
                    case CorrectiveActionNotificationType.CA_Withdrawn:
                        notification.UserId = entity.AssignedToUserId.Value;
//                        notification.Message = string.Format(ne.MessageTemplate,ca.Id,  ca.UpdatedAt.Value.ToShortDateString(), ca.EmplId, ca.Employee.FullName);
                        break;
                    default:
                        //not a indivual message type
                        break;
                }
        
                context.Add(notification);
                context.SaveChanges();
            }


            
        }
コード例 #5
0
 public void Insert(QmsKnowledgebase entity)
 {
     context.Add(entity);
     context.SaveChanges();
 }        
コード例 #6
0
 //public int SavePermission(string newPermissionCode, string newPermissionLabel) //(SecPermission secPermission)
 public int SavePermission(SecPermission secPermission)
 {
     context.SecPermission.Add(secPermission);
     context.SaveChanges();
     return(secPermission.PermissionId);
 }
コード例 #7
0
 public int CreateRole(SecRole secRole)
 {
     _context.SecRole.Add(secRole);
     _context.SaveChanges();
     return(secRole.RoleId);
 }
コード例 #8
0
 public int CreatePermission(SecPermission secPermission)
 {
     _context.SecPermission.Add(secPermission);
     _context.SaveChanges();
     return(secPermission.PermissionId);
 }
コード例 #9
0
 public void Save()
 {
     context.SaveChanges();
 }
コード例 #10
0
ファイル: SecOrgRepository.cs プロジェクト: GSA/HRIT-QMS-3.1
 public int CreateOrganization(SecOrg secOrg)
 {
     _context.SecOrg.Add(secOrg);
     _context.SaveChanges();
     return(secOrg.OrgId);
 }
コード例 #11
0
 internal void SaveEntry(SecSecuritylog logEntry)
 {
     context.SecSecuritylog.Add(logEntry);
     context.SaveChanges();
 }
コード例 #12
0
 internal int SaveEmailLog(NtfEmaillog emaillog)
 {
     this.context.Add(emaillog);
     return(context.SaveChanges());
 }
コード例 #13
0
ファイル: ModuleRepository.cs プロジェクト: GSA/HRIT-QMS-3.1
 public int Create(SysModule newModule)
 {
     context.SysModule.Add(newModule);
     context.SaveChanges();
     return(newModule.ModuleId);
 }