Exemple #1
0
 public List<PaymentType> GetAll()
 {
     PaymentTypeDAC _paymentTypeComponent = new PaymentTypeDAC();
      IDataReader reader =  _paymentTypeComponent.GetAllPaymentType().CreateDataReader();
      List<PaymentType> _paymentTypeList = new List<PaymentType>();
      while(reader.Read())
      {
      if(_paymentTypeList == null)
          _paymentTypeList = new List<PaymentType>();
          PaymentType _paymentType = new PaymentType();
          if(reader["PaymentTypeID"] != DBNull.Value)
              _paymentType.PaymentTypeID = Convert.ToInt32(reader["PaymentTypeID"]);
          if(reader["Name"] != DBNull.Value)
              _paymentType.Name = Convert.ToString(reader["Name"]);
          if(reader["IsRecurring"] != DBNull.Value)
              _paymentType.IsRecurring = Convert.ToBoolean(reader["IsRecurring"]);
          if(reader["RecurringNumberinDays"] != DBNull.Value)
              _paymentType.RecurringNumberinDays = Convert.ToInt32(reader["RecurringNumberinDays"]);
          if(reader["IsPerItem"] != DBNull.Value)
              _paymentType.IsPerItem = Convert.ToBoolean(reader["IsPerItem"]);
          if(reader["ItemNumber"] != DBNull.Value)
              _paymentType.ItemNumber = Convert.ToInt32(reader["ItemNumber"]);
      _paymentType.NewRecord = false;
      _paymentTypeList.Add(_paymentType);
      }             reader.Close();
      return _paymentTypeList;
 }
Exemple #2
0
 public PaymentType GetByID(int _paymentTypeID)
 {
     PaymentTypeDAC _paymentTypeComponent = new PaymentTypeDAC();
      IDataReader reader = _paymentTypeComponent.GetByIDPaymentType(_paymentTypeID);
      PaymentType _paymentType = null;
      while(reader.Read())
      {
          _paymentType = new PaymentType();
          if(reader["PaymentTypeID"] != DBNull.Value)
              _paymentType.PaymentTypeID = Convert.ToInt32(reader["PaymentTypeID"]);
          if(reader["Name"] != DBNull.Value)
              _paymentType.Name = Convert.ToString(reader["Name"]);
          if(reader["IsRecurring"] != DBNull.Value)
              _paymentType.IsRecurring = Convert.ToBoolean(reader["IsRecurring"]);
          if(reader["RecurringNumberinDays"] != DBNull.Value)
              _paymentType.RecurringNumberinDays = Convert.ToInt32(reader["RecurringNumberinDays"]);
          if(reader["IsPerItem"] != DBNull.Value)
              _paymentType.IsPerItem = Convert.ToBoolean(reader["IsPerItem"]);
          if(reader["ItemNumber"] != DBNull.Value)
              _paymentType.ItemNumber = Convert.ToInt32(reader["ItemNumber"]);
      _paymentType.NewRecord = false;             }             reader.Close();
      return _paymentType;
 }
Exemple #3
0
 public bool Insert(PaymentType paymenttype)
 {
     int autonumber = 0;
     PaymentTypeDAC paymenttypeComponent = new PaymentTypeDAC();
     bool endedSuccessfuly = paymenttypeComponent.InsertNewPaymentType( ref autonumber,  paymenttype.Name,  paymenttype.IsRecurring,  paymenttype.RecurringNumberinDays,  paymenttype.IsPerItem,  paymenttype.ItemNumber);
     if(endedSuccessfuly)
     {
         paymenttype.PaymentTypeID = autonumber;
     }
     return endedSuccessfuly;
 }
Exemple #4
0
 public void Delete(int Original_PaymentTypeID)
 {
     PaymentTypeDAC paymenttypeComponent = new PaymentTypeDAC();
     paymenttypeComponent.DeletePaymentType(Original_PaymentTypeID);
 }
Exemple #5
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     PaymentTypeDAC paymenttypecomponent = new PaymentTypeDAC();
     return paymenttypecomponent.UpdateDataset(dataset);
 }
Exemple #6
0
 public bool Update( string Name,  bool IsRecurring,  int RecurringNumberinDays,  bool IsPerItem,  int ItemNumber,  int Original_PaymentTypeID)
 {
     PaymentTypeDAC paymenttypeComponent = new PaymentTypeDAC();
     return paymenttypeComponent.UpdatePaymentType( Name,  IsRecurring,  RecurringNumberinDays,  IsPerItem,  ItemNumber,  Original_PaymentTypeID);
 }
Exemple #7
0
 public bool Update(PaymentType paymenttype ,int old_paymentTypeID)
 {
     PaymentTypeDAC paymenttypeComponent = new PaymentTypeDAC();
     return paymenttypeComponent.UpdatePaymentType( paymenttype.Name,  paymenttype.IsRecurring,  paymenttype.RecurringNumberinDays,  paymenttype.IsPerItem,  paymenttype.ItemNumber,  old_paymentTypeID);
 }
Exemple #8
0
        public bool Insert( string Name,  bool IsRecurring,  int RecurringNumberinDays,  bool IsPerItem,  int ItemNumber)
        {
            PaymentTypeDAC paymenttypeComponent = new PaymentTypeDAC();
            int PaymentTypeID = 0;

            return paymenttypeComponent.InsertNewPaymentType( ref PaymentTypeID,  Name,  IsRecurring,  RecurringNumberinDays,  IsPerItem,  ItemNumber);
        }