public void UpdateDocument(DocoUser user, DocoDocument document) { //var validatorResult = document.Validation(); //if (validatorResult.IsValid) //{ // Traverse<DocoDocument>(user.UserFolder,document.DocId.ToString(),(x,y)=>x.DocId.ToString() == y,x=> // { // x.DocContent=document.DocContent; // x.LastSavedBy=user.UserName; // x.SavedAt=DateTime.Now; // x.DocVersion = x.DocVersion.IncreaseVersion(); // } // ); // _userService.Update(user); // _activitiyLogService.AddNewLogRecord( // new ActivityLog // { // AType = ActivityLog.ActivityType.UpdateDocumentName, // LogContent = "Updated Document Content", // LogTime = DateTime.Now, // UserName = user.UserName, // UserId = user.UserId.ToString() // }); //} }
public DocoUser Insert(DocoUser user) { ValidationResult = user.Validation(); if ( !ValidationResult.IsValid) { return null; } return _docoDb.Insert(user); }
public bool Update(DocoUser user) { ValidationResult = user.Validation(); if (!ValidationResult.IsValid) { return false; } _docoDb.Save(user); return true; }
public static DocoUser CreateDocoUser(string userName) { var user = new DocoUser { Email = "*****@*****.**", Name = "Ali ", Surname = "TTTT", UserName = userName, }; return user; }
public bool Delete(DocoUser user) { user.IsDeleted = true; return Update(user); }