コード例 #1
0
ファイル: EmailAddressLogic.cs プロジェクト: ramyothman/RBM
 public EmailAddress GetByID(int _emailAddressId)
 {
     EmailAddressDAC _emailAddressComponent = new EmailAddressDAC();
      IDataReader reader = _emailAddressComponent.GetByIDEmailAddress(_emailAddressId);
      EmailAddress _emailAddress = null;
      while(reader.Read())
      {
          _emailAddress = new EmailAddress();
          if(reader["EmailAddressId"] != DBNull.Value)
              _emailAddress.EmailAddressId = Convert.ToInt32(reader["EmailAddressId"]);
          if(reader["BusinessEntityId"] != DBNull.Value)
              _emailAddress.BusinessEntityId = Convert.ToInt32(reader["BusinessEntityId"]);
          if(reader["EmailAddressTypeId"] != DBNull.Value)
              _emailAddress.EmailAddressTypeId = Convert.ToInt32(reader["EmailAddressTypeId"]);
          if(reader["Email"] != DBNull.Value)
              _emailAddress.Email = Convert.ToString(reader["Email"]);
          if(reader["EmailVerified"] != DBNull.Value)
              _emailAddress.EmailVerified = Convert.ToBoolean(reader["EmailVerified"]);
          if(reader["EmailVerificationHash"] != DBNull.Value)
              _emailAddress.EmailVerificationHash = Convert.ToString(reader["EmailVerificationHash"]);
          if(reader["RowGuid"] != DBNull.Value)
              _emailAddress.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _emailAddress.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _emailAddress.NewRecord = false;             }             reader.Close();
      return _emailAddress;
 }
コード例 #2
0
ファイル: EmailAddressLogic.cs プロジェクト: ramyothman/RBM
 public List<EmailAddress> GetAll()
 {
     EmailAddressDAC _emailAddressComponent = new EmailAddressDAC();
      IDataReader reader =  _emailAddressComponent.GetAllEmailAddress().CreateDataReader();
      List<EmailAddress> _emailAddressList = new List<EmailAddress>();
      while(reader.Read())
      {
      if(_emailAddressList == null)
          _emailAddressList = new List<EmailAddress>();
          EmailAddress _emailAddress = new EmailAddress();
          if(reader["EmailAddressId"] != DBNull.Value)
              _emailAddress.EmailAddressId = Convert.ToInt32(reader["EmailAddressId"]);
          if(reader["BusinessEntityId"] != DBNull.Value)
              _emailAddress.BusinessEntityId = Convert.ToInt32(reader["BusinessEntityId"]);
          if(reader["EmailAddressTypeId"] != DBNull.Value)
              _emailAddress.EmailAddressTypeId = Convert.ToInt32(reader["EmailAddressTypeId"]);
          if(reader["Email"] != DBNull.Value)
              _emailAddress.Email = Convert.ToString(reader["Email"]);
          if(reader["EmailVerified"] != DBNull.Value)
              _emailAddress.EmailVerified = Convert.ToBoolean(reader["EmailVerified"]);
          if(reader["EmailVerificationHash"] != DBNull.Value)
              _emailAddress.EmailVerificationHash = Convert.ToString(reader["EmailVerificationHash"]);
          if(reader["RowGuid"] != DBNull.Value)
              _emailAddress.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _emailAddress.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _emailAddress.NewRecord = false;
      _emailAddressList.Add(_emailAddress);
      }             reader.Close();
      return _emailAddressList;
 }
コード例 #3
0
ファイル: EmailAddressLogic.cs プロジェクト: ramyothman/RBM
 public bool Update(EmailAddress emailaddress ,int old_emailAddressId)
 {
     EmailAddressDAC emailaddressComponent = new EmailAddressDAC();
     return emailaddressComponent.UpdateEmailAddress( emailaddress.BusinessEntityId,  emailaddress.EmailAddressTypeId,  emailaddress.Email,  emailaddress.EmailVerified,  emailaddress.EmailVerificationHash,  emailaddress.RowGuid,  DateTime.Now,  old_emailAddressId);
 }
コード例 #4
0
ファイル: EmailAddressLogic.cs プロジェクト: ramyothman/RBM
 public bool Insert(EmailAddress emailaddress)
 {
     int autonumber = 0;
     EmailAddressDAC emailaddressComponent = new EmailAddressDAC();
     bool endedSuccessfuly = emailaddressComponent.InsertNewEmailAddress( ref autonumber,  emailaddress.BusinessEntityId,  emailaddress.EmailAddressTypeId,  emailaddress.Email,  emailaddress.EmailVerified,  emailaddress.EmailVerificationHash,  new Guid(),  DateTime.Now);
     if(endedSuccessfuly)
     {
         emailaddress.EmailAddressId = autonumber;
     }
     return endedSuccessfuly;
 }