Exemplo n.º 1
0
 /// <summary>
 /// Retrieves Get Total Rows of InvoiceDetail
 /// </summary>
 /// <returns>Int32 type object</returns>
 public Int32 GetRowCount()
 {
     using (InvoiceDetailDataAccess data = new InvoiceDetailDataAccess(ClientContext))
     {
         return(data.GetRowCount());
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Retrieve list of InvoiceDetail  by query String.
 /// <param name="query"></param>
 /// </summary>
 /// <returns>List of InvoiceDetail</returns>
 public InvoiceDetailList GetByQuery(String query)
 {
     using (InvoiceDetailDataAccess data = new InvoiceDetailDataAccess(ClientContext))
     {
         return(data.GetByQuery(query));
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Retrieve list of InvoiceDetail  by PageRequest.
 /// <param name="request"></param>
 /// </summary>
 /// <returns>List of InvoiceDetail</returns>
 public InvoiceDetailList GetPaged(PagedRequest request)
 {
     using (InvoiceDetailDataAccess data = new InvoiceDetailDataAccess(ClientContext))
     {
         return(data.GetPaged(request));
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Retrieve list of InvoiceDetail.
 /// no parameters required to be passed in.
 /// </summary>
 /// <returns>List of InvoiceDetail</returns>
 public InvoiceDetailList GetAll()
 {
     using (InvoiceDetailDataAccess data = new InvoiceDetailDataAccess(ClientContext))
     {
         return(data.GetAll());
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Retrieve InvoiceDetail data using unique ID
 /// </summary>
 /// <param name="_Id"></param>
 /// <returns>InvoiceDetail Object</returns>
 public InvoiceDetail Get(Int32 _Id)
 {
     using (InvoiceDetailDataAccess data = new InvoiceDetailDataAccess(ClientContext))
     {
         return(data.Get(_Id));
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Delete operation for InvoiceDetail
 /// <param name="_Id"></param>
 /// <returns></returns>
 private bool Delete(Int32 _Id)
 {
     using (InvoiceDetailDataAccess data = new InvoiceDetailDataAccess(ClientContext))
     {
         // return if code > 0
         return(data.Delete(_Id) > 0);
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// Retrieve list of InvoiceDetail.
        /// </summary>
        /// <param name="fillChild"></param>
        /// <returns>List of InvoiceDetail</returns>
        public InvoiceDetailList GetAll(bool fillChild)
        {
            InvoiceDetailList invoiceDetailList = new InvoiceDetailList();

            using (InvoiceDetailDataAccess data = new InvoiceDetailDataAccess(ClientContext))
            {
                invoiceDetailList = data.GetAll();
            }
            if (fillChild)
            {
                foreach (InvoiceDetail invoiceDetailObject in invoiceDetailList)
                {
                    FillInvoiceDetailWithChilds(invoiceDetailObject, fillChild);
                }
            }
            return(invoiceDetailList);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Update base of InvoiceDetail Object.
        /// Data manipulation processing for: new, deleted, updated InvoiceDetail
        /// </summary>
        /// <param name="invoiceDetailObject"></param>
        /// <returns></returns>
        public bool UpdateBase(InvoiceDetail invoiceDetailObject)
        {
            // use of switch for different types of DML
            switch (invoiceDetailObject.RowState)
            {
            // insert new rows
            case BaseBusinessEntity.RowStateEnum.NewRow:
                return(Insert(invoiceDetailObject));

            // delete rows
            case BaseBusinessEntity.RowStateEnum.DeletedRow:
                return(Delete(invoiceDetailObject.Id));
            }
            // update rows
            using (InvoiceDetailDataAccess data = new InvoiceDetailDataAccess(ClientContext))
            {
                return(data.Update(invoiceDetailObject) > 0);
            }
        }
Exemplo n.º 9
0
 /// <summary>
 /// Insert new invoiceDetail.
 /// data manipulation for insertion of InvoiceDetail
 /// </summary>
 /// <param name="invoiceDetailObject"></param>
 /// <returns></returns>
 private bool Insert(InvoiceDetail invoiceDetailObject)
 {
     // new invoiceDetail
     using (InvoiceDetailDataAccess data = new InvoiceDetailDataAccess(ClientContext))
     {
         // insert to invoiceDetailObject
         Int32 _Id = data.Insert(invoiceDetailObject);
         // if successful, process
         if (_Id > 0)
         {
             invoiceDetailObject.Id = _Id;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }