Exemple #1
0
 public void AddUserSchemeShareExpert(string userId, int shortIndex, CopyOrderSource source)
 {
     using (var manager = new BDFXManager())
     {
         var entity = manager.QueryUserSchemeShareExpertByUserId(userId, source);
         if (entity == null)
         {
             entity            = new UserSchemeShareExpert();
             entity.ExpertType = source;
             entity.ShowSort   = shortIndex;
             entity.IsEnable   = true;
             entity.CreateTime = DateTime.Now;
             entity.UserId     = userId;
             manager.AddUserSchemeShareExpert(entity);
         }
         else
         {
             entity.ExpertType = source;
             entity.ShowSort   = shortIndex;
             entity.UserId     = userId;
             manager.UpdateUserSchemeShareExpert(entity);
         }
     }
 }
Exemple #2
0
 public UserSchemeShareExpert QueryUserSchemeShareExpertByUserId(string userId, CopyOrderSource source)
 {
     Session.Clear();
     return(Session.Query <UserSchemeShareExpert>().FirstOrDefault(s => s.UserId == userId && s.ExpertType == source));
 }