コード例 #1
0
 public override OperationResult execute(Direct_Response_UsersDbEntities entities)
 {
     if ((this.user != null) && !string.IsNullOrEmpty(this.user.Username) &&
         !string.IsNullOrEmpty(this.user.Password) &&
         !string.IsNullOrEmpty(this.user.Full_Name) &&
         !string.IsNullOrEmpty(this.user.Email) &&
         !string.IsNullOrEmpty(this.user.Image))
     {
         entities.UserInsert(this.user.Username, this.user.Password, this.user.Email, this.user.Full_Name, this.user.Image);
     }
     return(base.execute(entities));
 }
コード例 #2
0
        public override OperationResult execute(Direct_Response_UsersDbEntities entities)
        {
            IEnumerable <UserDb> ieUsers;

            if ((this.Criteria == null) || (this.Criteria.Username == null) &&
                (this.Criteria.Password == null))
            {
                ieUsers = from user in entities.Users
                          select new UserDb
                {
                    User_Id   = user.User_Id,
                    Username  = user.Username,
                    Password  = user.Password,
                    Email     = user.Email,
                    Full_Name = user.Full_name,
                    Image     = user.Image
                }
            }
            ;
            else
            {
                ieUsers = from user in entities.Users
                          where ((this.Criteria.Username == null) ? true :
                                 this.Criteria.Username == user.Username) &&
                          ((this.Criteria.Password == null) ? true :
                           this.Criteria.Password == user.Password)
                          select new UserDb
                {
                    User_Id   = user.User_Id,
                    Username  = user.Username,
                    Password  = user.Password,
                    Email     = user.Email,
                    Full_Name = user.Full_name,
                    Image     = user.Image
                };
            }
            UserDb[]        array = ieUsers.ToArray();
            OperationResult obj   = new OperationResult();

            obj.DbItems = array;
            obj.Status  = true;
            return(obj);
        }
コード例 #3
0
 public abstract OperationResult execute(Direct_Response_UsersDbEntities entities);