Пример #1
0
 public CABMasterInvoicePreview FetchCABMasterInvoicePreview(CABMasterInvoicePreview getCABMasterInvoicePreview, SafeDataReader dr)
 {
     getCABMasterInvoicePreview.Amount = dr.GetDecimal("Amount");
     getCABMasterInvoicePreview.ACCPACCode = dr.GetString("ACCPACCode");
     getCABMasterInvoicePreview.Description = dr.GetString("Description");
     return getCABMasterInvoicePreview;
 }
Пример #2
0
 public CABMasterInvoicePreview FetchCABMasterInvoicePreviewAddresses(CABMasterInvoicePreview getCABMasterInvoicePreview, SafeDataReader dr)
 {
     getCABMasterInvoicePreview.Name = dr.GetString("Name");
     getCABMasterInvoicePreview.AddressLine1 = dr.GetString("AddressLine1");
     getCABMasterInvoicePreview.AddressLine2 = dr.GetString("AddressLine2");
     getCABMasterInvoicePreview.AddressLine3 = dr.GetString("AddressLine3");
     getCABMasterInvoicePreview.Amount = dr.GetDecimal("Amount");
     return getCABMasterInvoicePreview;
 }
Пример #3
0
        /// <summary>
        /// Description  : To get CABMaster Invoice Preview By MasterID.
        /// Created By   : Shiva
        /// Created Date : 29 Oct 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        internal static BillingInfo GetCABMasterInvoicePreviewByMasterID(int CABMasterID)
        {
            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            var CABMasterInvoicePreview = new BillingInfo();
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0] = new SqlParameter("@CabMasterID", CABMasterID);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPCABMasterInvoicePreview", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var InvoicePrevie = new CABMasterInvoicePreview();
                    InvoicePrevie.FetchCABMasterInvoicePreviewAddresses(InvoicePrevie, safe);
                    CABMasterInvoicePreview.CABMasterInvoicePreviewList1.Add(InvoicePrevie);
                }
                reader.NextResult();
                while (reader.Read())
                {
                    var InvoicePrevie = new CABMasterInvoicePreview();
                    InvoicePrevie.FetchCABMasterInvoicePreview(InvoicePrevie, safe);
                    CABMasterInvoicePreview.CABMasterInvoicePreviewList2.Add(InvoicePrevie);
                }
                //reader.NextResult();
                //while (reader.Read())
                //{
                //    var InvoicePrevie = new CABMasterInvoicePreview();
                //    InvoicePrevie.FetchCABMasterInvoicePreview(InvoicePrevie, safe);
                //    CABMasterInvoicePreview.CABMasterInvoicePreviewList3.Add(InvoicePrevie);
                //}

                return CABMasterInvoicePreview;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return CABMasterInvoicePreview;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }