public EngineeringSpecialtyEntity(EngineeringSpecialtyInfo Info) { this.ID = Info.ID; this.EngineeringID = Info.EngineeringID; this.SpecialtyID = Info.SpecialtyID; this.Manager = Info.Manager; this.StartDate = Info.StartDate; this.EndDate = Info.EndDate; this.Note = Info.Note; this.ProcessModel = Info.ProcessModel; }
public int Add(EngineeringSpecialtyInfo EngineeringSpecialty) { var entity = new EngineeringSpecialtyEntity(EngineeringSpecialty); this._DB.Add(entity); //foreach (var attachID in EngineeringSpecialty.AttachIDs) //{ // AddAttach(entity.ID, attachID); //} return(entity.ID); }
/// <summary> /// 专业完成 /// </summary> /// <param name="EngineeringID"></param> /// <param name="SpecialtyID"></param> public void Finish(int EngineeringID, long SpecialtyID) { var entity = this._DB.SingleOrDefault(s => s.EngineeringID == EngineeringID && s.SpecialtyID == SpecialtyID); entity.IsDone = true; entity.FinishDate = DateTime.Now; this._DB.Edit(entity); var specInfo = new EngineeringSpecialtyInfo(entity); var eng = specInfo.GetParent(); var users = specInfo.GetParentMainUsers(); if (!users.Contains(entity.Manager)) { users.Add(entity.Manager); } var specEnumInfo = _IEnum.GetEnumItemInfo("System3", "Specialty", SpecialtyID.ToString()); // 工程记事 _IEngineeringNoteService.Add(new EngineeringNoteInfo() { Content = string.Format("{0}完成", specEnumInfo.Text), EngineeringID = entity.EngineeringID, NoteDate = DateTime.Now, NoteType = (int)EnumEngineeringNoteType.完成, UserID = 0 }); // 给每个相关人员发送专业完成提醒 users.ForEach(u => { _INotificationService.Add(new NotificationInfo() { ReceiveUser = u, Head = "专业完成", Title = "专业完成", Info = string.Format("工程:{0},专业:{1}", eng.ObjectText, specEnumInfo.Text), SendUser = 0, CreateDate = DateTime.Now, EffectDate = DateTime.Now, // 生效日期 SourceID = specInfo.ID, SourceName = "EngineeringSpecialty", SourceTag = "Finish", }); }); }
public int Create(EngineeringSpecialtyInfo Info) { return(this._IEngineeringSpecialtyService.Add(Info)); }