Exemplo n.º 1
0
        public EngineeringNoteInfo Get(int ID)
        {
            var entity = this._DB.Get(ID);

            var info = new EngineeringNoteInfo(entity);

            info.Engineering = this._PMContext.EngineeringEntity.Find(entity.EngineeringID);

            return(info);
        }
Exemplo n.º 2
0
 public EngineeringNoteEntity(EngineeringNoteInfo Info)
 {
     this.ID            = Info.ID;
     this.EngineeringID = Info.EngineeringID;
     this.Content       = Info.Content;
     this.NoteType      = Info.NoteType;
     this.NoteDate      = Info.NoteDate;
     this.UserID        = Info.UserID;
     this.IsDeleted     = Info.IsDeleted;
 }
Exemplo n.º 3
0
        public int Add(EngineeringNoteInfo EngineeringNote)
        {
            var entity = new EngineeringNoteEntity(EngineeringNote);

            entity.IsDeleted = false;
            entity.NoteDate  = DateTime.Now;
            this._DB.Add(entity);

            if (EngineeringNote.AttachIDs != null)
            {
                foreach (var attachID in EngineeringNote.AttachIDs)
                {
                    AddAttach(entity.ID, attachID);
                }
            }

            // 给指定接收人发送提醒
            if (EngineeringNote.ReceiveUsers != null)
            {
                foreach (var userID in EngineeringNote.ReceiveUsers)
                {
                    _INotificationService.Add(new NotificationInfo()
                    {
                        CreateDate  = DateTime.Now,
                        EffectDate  = DateTime.Now, // 生效日期
                        Title       = string.Format("工程记事:{0}", (EnumEngineeringNoteType)EngineeringNote.NoteType),
                        Info        = EngineeringNote.Content,
                        ReceiveUser = userID,
                        SendUser    = EngineeringNote.UserID,
                        SourceID    = entity.ID,
                        SourceName  = "EngineeringNote",
                        SourceTag   = "Note",
                    });
                }
            }

            return(entity.ID);
        }
Exemplo n.º 4
0
 public int Create(EngineeringNoteInfo Info)
 {
     Info.UserID = int.Parse(base.User.Identity.Name);
     return(this._IEngineeringNoteService.Add(Info));
 }
Exemplo n.º 5
0
 public void Start(int ID, EngineeringNoteInfo Reason)
 {
     this._IEngineeringService.Start(ID, int.Parse(base.User.Identity.Name));
 }
Exemplo n.º 6
0
 public void Stop(int ID, EngineeringNoteInfo Reason)
 {
     this._IEngineeringService.Stop(ID, int.Parse(base.User.Identity.Name), Reason.Content, Reason.ReceiveUsers);
 }