Esempio n. 1
0
 public bool Insert(AddressType addresstype)
 {
     int autonumber = 0;
     AddressTypeDAC addresstypeComponent = new AddressTypeDAC();
     bool endedSuccessfuly = addresstypeComponent.InsertNewAddressType( ref autonumber,  addresstype.Name,  addresstype.RowGuid,  addresstype.ModifiedDate);
     if(endedSuccessfuly)
     {
         addresstype.AddressTypeId = autonumber;
     }
     return endedSuccessfuly;
 }
Esempio n. 2
0
 public AddressType GetByID(int _addressTypeId)
 {
     AddressTypeDAC _addressTypeComponent = new AddressTypeDAC();
      IDataReader reader = _addressTypeComponent.GetByIDAddressType(_addressTypeId);
      AddressType _addressType = null;
      while(reader.Read())
      {
          _addressType = new AddressType();
          if(reader["AddressTypeId"] != DBNull.Value)
              _addressType.AddressTypeId = Convert.ToInt32(reader["AddressTypeId"]);
          if(reader["Name"] != DBNull.Value)
              _addressType.Name = Convert.ToString(reader["Name"]);
          if(reader["RowGuid"] != DBNull.Value)
              _addressType.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _addressType.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _addressType.NewRecord = false;             }             reader.Close();
      return _addressType;
 }
Esempio n. 3
0
 public List<AddressType> GetAll()
 {
     AddressTypeDAC _addressTypeComponent = new AddressTypeDAC();
      IDataReader reader =  _addressTypeComponent.GetAllAddressType().CreateDataReader();
      List<AddressType> _addressTypeList = new List<AddressType>();
      while(reader.Read())
      {
      if(_addressTypeList == null)
          _addressTypeList = new List<AddressType>();
          AddressType _addressType = new AddressType();
          if(reader["AddressTypeId"] != DBNull.Value)
              _addressType.AddressTypeId = Convert.ToInt32(reader["AddressTypeId"]);
          if(reader["Name"] != DBNull.Value)
              _addressType.Name = Convert.ToString(reader["Name"]);
          if(reader["RowGuid"] != DBNull.Value)
              _addressType.RowGuid = new Guid(reader["RowGuid"].ToString());
          if(reader["ModifiedDate"] != DBNull.Value)
              _addressType.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
      _addressType.NewRecord = false;
      _addressTypeList.Add(_addressType);
      }             reader.Close();
      return _addressTypeList;
 }
Esempio n. 4
0
        public bool Insert( string Name,  Guid RowGuid,  DateTime ModifiedDate)
        {
            AddressTypeDAC addresstypeComponent = new AddressTypeDAC();
            int AddressTypeId = 0;

            return addresstypeComponent.InsertNewAddressType( ref AddressTypeId,  Name,  RowGuid,  ModifiedDate);
        }
Esempio n. 5
0
 public void Delete(int Original_AddressTypeId)
 {
     AddressTypeDAC addresstypeComponent = new AddressTypeDAC();
     addresstypeComponent.DeleteAddressType(Original_AddressTypeId);
 }
Esempio n. 6
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     AddressTypeDAC addresstypecomponent = new AddressTypeDAC();
     return addresstypecomponent.UpdateDataset(dataset);
 }
Esempio n. 7
0
 public bool Update( string Name,  Guid RowGuid,  DateTime ModifiedDate,  int Original_AddressTypeId)
 {
     AddressTypeDAC addresstypeComponent = new AddressTypeDAC();
     return addresstypeComponent.UpdateAddressType( Name,  RowGuid,  ModifiedDate,  Original_AddressTypeId);
 }
Esempio n. 8
0
 public bool Update(AddressType addresstype ,int old_addressTypeId)
 {
     AddressTypeDAC addresstypeComponent = new AddressTypeDAC();
     return addresstypeComponent.UpdateAddressType( addresstype.Name,  addresstype.RowGuid,  addresstype.ModifiedDate,  old_addressTypeId);
 }