Exemple #1
0
 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()
     //            });
     //}
 }
Exemple #2
0
        public DocoUser Insert(DocoUser user)
        {
            ValidationResult = user.Validation();
            if ( !ValidationResult.IsValid)
            {
                return null;
            }

            return _docoDb.Insert(user);
        }
Exemple #3
0
 public bool Update(DocoUser user)
 {
     ValidationResult = user.Validation();
     if (!ValidationResult.IsValid)
     {
         return false;
     }
     _docoDb.Save(user);
     return true;
 }
Exemple #4
0
 public static DocoUser CreateDocoUser(string userName)
 {
     var user = new DocoUser
     {
         Email = "*****@*****.**",
         Name = "Ali ",
         Surname = "TTTT",
         UserName = userName,
         };
     return user;
 }
Exemple #5
0
 public bool Delete(DocoUser user)
 {
     user.IsDeleted = true;
     return Update(user);
 }