Exemplo n.º 1
0
 public List<VisaRequest> GetAll()
 {
     VisaRequestDAC _visaRequestComponent = new VisaRequestDAC();
      IDataReader reader =  _visaRequestComponent.GetAllVisaRequest().CreateDataReader();
      List<VisaRequest> _visaRequestList = new List<VisaRequest>();
      while(reader.Read())
      {
      if(_visaRequestList == null)
          _visaRequestList = new List<VisaRequest>();
          VisaRequest _visaRequest = new VisaRequest();
          if(reader["VisaRequestID"] != DBNull.Value)
              _visaRequest.VisaRequestID = Convert.ToInt32(reader["VisaRequestID"]);
          if(reader["ConferenceID"] != DBNull.Value)
              _visaRequest.ConferenceID = Convert.ToInt32(reader["ConferenceID"]);
          if(reader["PersonID"] != DBNull.Value)
              _visaRequest.PersonID = Convert.ToInt32(reader["PersonID"]);
          if(reader["Country"] != DBNull.Value)
              _visaRequest.Country = Convert.ToString(reader["Country"]);
          if(reader["City"] != DBNull.Value)
              _visaRequest.City = Convert.ToString(reader["City"]);
          if(reader["Religion"] != DBNull.Value)
              _visaRequest.Religion = Convert.ToString(reader["Religion"]);
          if(reader["JobTitle"] != DBNull.Value)
              _visaRequest.JobTitle = Convert.ToString(reader["JobTitle"]);
          if(reader["Company"] != DBNull.Value)
              _visaRequest.Company = Convert.ToString(reader["Company"]);
          if(reader["PassportAttachment"] != DBNull.Value)
              _visaRequest.PassportAttachment = Convert.ToString(reader["PassportAttachment"]);
          if(reader["IsOrganizationApproved"] != DBNull.Value)
              _visaRequest.IsOrganizationApproved = Convert.ToBoolean(reader["IsOrganizationApproved"]);
          if(reader["IsTaken"] != DBNull.Value)
              _visaRequest.IsTaken = Convert.ToBoolean(reader["IsTaken"]);
          if(reader["VisaAttachment"] != DBNull.Value)
              _visaRequest.VisaAttachment = Convert.ToString(reader["VisaAttachment"]);
      _visaRequest.NewRecord = false;
      _visaRequestList.Add(_visaRequest);
      }             reader.Close();
      return _visaRequestList;
 }
Exemplo n.º 2
0
        public VisaRequest GetAllByConferenceIdPersonId(int ConferenceID,int PersonID)
        {
            VisaRequestDAC _visaRequestComponent = new VisaRequestDAC();
            IDataReader reader = _visaRequestComponent.GetAllVisaRequest(string.Format("ConferenceID = {0} and PersonID = {1}",ConferenceID,PersonID)).CreateDataReader();
            VisaRequest _visaRequest = new VisaRequest();
            while (reader.Read())
            {

                if (reader["VisaRequestID"] != DBNull.Value)
                    _visaRequest.VisaRequestID = Convert.ToInt32(reader["VisaRequestID"]);
                if (reader["ConferenceID"] != DBNull.Value)
                    _visaRequest.ConferenceID = Convert.ToInt32(reader["ConferenceID"]);
                if (reader["PersonID"] != DBNull.Value)
                    _visaRequest.PersonID = Convert.ToInt32(reader["PersonID"]);
                if (reader["Country"] != DBNull.Value)
                    _visaRequest.Country = Convert.ToString(reader["Country"]);
                if (reader["City"] != DBNull.Value)
                    _visaRequest.City = Convert.ToString(reader["City"]);
                if (reader["Religion"] != DBNull.Value)
                    _visaRequest.Religion = Convert.ToString(reader["Religion"]);
                if (reader["JobTitle"] != DBNull.Value)
                    _visaRequest.JobTitle = Convert.ToString(reader["JobTitle"]);
                if (reader["Company"] != DBNull.Value)
                    _visaRequest.Company = Convert.ToString(reader["Company"]);
                if (reader["PassportAttachment"] != DBNull.Value)
                    _visaRequest.PassportAttachment = Convert.ToString(reader["PassportAttachment"]);
                if (reader["IsOrganizationApproved"] != DBNull.Value)
                    _visaRequest.IsOrganizationApproved = Convert.ToBoolean(reader["IsOrganizationApproved"]);
                if (reader["IsTaken"] != DBNull.Value)
                    _visaRequest.IsTaken = Convert.ToBoolean(reader["IsTaken"]);
                if (reader["VisaAttachment"] != DBNull.Value)
                    _visaRequest.VisaAttachment = Convert.ToString(reader["VisaAttachment"]);
                _visaRequest.NewRecord = false;
            } reader.Close();
            return _visaRequest;
        }
Exemplo n.º 3
0
 public bool Update(VisaRequest visarequest ,int old_visaRequestID)
 {
     VisaRequestDAC visarequestComponent = new VisaRequestDAC();
     return visarequestComponent.UpdateVisaRequest( visarequest.ConferenceID,  visarequest.PersonID,  visarequest.Country,  visarequest.City,  visarequest.Religion,  visarequest.JobTitle,  visarequest.Company,  visarequest.PassportAttachment,  visarequest.IsOrganizationApproved,  visarequest.IsTaken,  visarequest.VisaAttachment,  old_visaRequestID);
 }
Exemplo n.º 4
0
 public bool Insert(VisaRequest visarequest)
 {
     int autonumber = 0;
     VisaRequestDAC visarequestComponent = new VisaRequestDAC();
     bool endedSuccessfuly = visarequestComponent.InsertNewVisaRequest( ref autonumber,  visarequest.ConferenceID,  visarequest.PersonID,  visarequest.Country,  visarequest.City,  visarequest.Religion,  visarequest.JobTitle,  visarequest.Company,  visarequest.PassportAttachment,  visarequest.IsOrganizationApproved,  visarequest.IsTaken,  visarequest.VisaAttachment);
     if(endedSuccessfuly)
     {
         visarequest.VisaRequestID = autonumber;
     }
     return endedSuccessfuly;
 }