示例#1
0
 public ContractType GetByID(int _contractTypeID)
 {
     ContractTypeDAC _contractTypeComponent = new ContractTypeDAC();
      IDataReader reader = _contractTypeComponent.GetByIDContractType(_contractTypeID);
      ContractType _contractType = null;
      while(reader.Read())
      {
          _contractType = new ContractType();
          if(reader["ContractTypeID"] != DBNull.Value)
              _contractType.ContractTypeID = Convert.ToInt32(reader["ContractTypeID"]);
          if(reader["Name"] != DBNull.Value)
              _contractType.Name = Convert.ToString(reader["Name"]);
      _contractType.NewRecord = false;             }             reader.Close();
      return _contractType;
 }
示例#2
0
 public List<ContractType> GetAll()
 {
     ContractTypeDAC _contractTypeComponent = new ContractTypeDAC();
      IDataReader reader =  _contractTypeComponent.GetAllContractType().CreateDataReader();
      List<ContractType> _contractTypeList = new List<ContractType>();
      while(reader.Read())
      {
      if(_contractTypeList == null)
          _contractTypeList = new List<ContractType>();
          ContractType _contractType = new ContractType();
          if(reader["ContractTypeID"] != DBNull.Value)
              _contractType.ContractTypeID = Convert.ToInt32(reader["ContractTypeID"]);
          if(reader["Name"] != DBNull.Value)
              _contractType.Name = Convert.ToString(reader["Name"]);
      _contractType.NewRecord = false;
      _contractTypeList.Add(_contractType);
      }             reader.Close();
      return _contractTypeList;
 }
示例#3
0
 public bool Update(ContractType contracttype ,int old_contractTypeID)
 {
     ContractTypeDAC contracttypeComponent = new ContractTypeDAC();
     return contracttypeComponent.UpdateContractType( contracttype.ContractTypeID,  contracttype.Name,  old_contractTypeID);
 }
示例#4
0
 public bool Insert(ContractType contracttype)
 {
     ContractTypeDAC contracttypeComponent = new ContractTypeDAC();
     return contracttypeComponent.InsertNewContractType( contracttype.ContractTypeID,  contracttype.Name);
 }