예제 #1
0
 private void cvTitle_ServerValidate(object source, ServerValidateEventArgs args)
 {
     args.IsValid = true;
     if (FolderId > 0)
     {
         DirectoryInfo diCur = fs.GetDirectory(FolderId);
         if (diCur.ParentDirectoryId > 0)
         {
             DirectoryInfo di = fs.GetDirectory(diCur.Parent, txtTitle.Text);
             if (di != null && di.Id != FolderId)
             {
                 args.IsValid = false;
             }
         }
     }
     if (ParentFolderId > 0)
     {
         if (fs.DirectoryExist(txtTitle.Text, ParentFolderId))
         {
             args.IsValid = false;
         }
         else
         {
             args.IsValid = true;
         }
     }
 }