Esempio n. 1
0
        public static Request MapRequestDTOToRequest(this RequestDTO requestDTO)
        {
            var request = new Request();

            request.EGN       = requestDTO.EGN;
            request.RequestIp = requestDTO.RequestIp;
            return(request);
        }
Esempio n. 2
0
        //------------------------------------------------------------------------------------------------------------------------------------------
        public List <DTO.RequestDTO> SelectAllAuthorByDataReader()
        {
            List <DTO.RequestDTO> list = new List <DTO.RequestDTO>();
            string        strCmd       = "select_all_request";
            SqlDataReader rd           = _DataProvicer.ExecuteQueryWithDataReader(strCmd, CommandType.StoredProcedure);

            if (rd.HasRows)
            {
                while (rd.Read())
                {
                    DTO.RequestDTO dto = new DTO.RequestDTO
                    {
                        ReqID       = rd.GetString(0),
                        UserID      = rd.GetString(1),
                        BookTitleID = rd.GetString(2),
                        ReqDate     = rd.GetDateTime(3),
                        ReqStatus   = rd.GetInt32(4)
                    };
                    list.Add(dto);
                }
            }
            return(list);
        }
Esempio n. 3
0
        //------------------------------------------------------------------------------------------------------------------------------------------
        public DTO.RequestDTO SearchRequestByRequestID(string id)
        {
            string        strCmd = "e_select_request_by_req_id";
            SqlParameter  ID     = new SqlParameter("@ReqID", id);
            SqlDataReader rd     = _DataProvicer.ExecuteQueryWithDataReader(strCmd, CommandType.StoredProcedure, ID);

            if (rd.HasRows)
            {
                if (rd.Read())
                {
                    DTO.RequestDTO dto = new DTO.RequestDTO
                    {
                        ReqID       = rd.GetString(0),
                        UserID      = rd.GetString(1),
                        BookTitleID = rd.GetString(2),
                        ReqDate     = rd.GetDateTime(3),
                        ReqStatus   = rd.GetInt32(4)
                    };
                    return(dto);
                }
            }
            return(null);
        }
Esempio n. 4
0
 public bool UpdateRequest(string id, int status)
 {
     DTO.RequestDTO dto = this.SearchRequestByRequestID(id);
     dto.ReqStatus = status;
     return(dao.UpdateRequest(dto));
 }