예제 #1
0
        /// <summary>
        /// Returns the specified find results page.
        ///
        /// @comment Pages can be requested in any order!
        ///
        /// </summary>
        /// <param name="APage">Page to return</param>
        /// <param name="APageSize">Number of records to return per page</param>
        /// <param name="ATotalRecords">The amount of rows found by the SELECT statement</param>
        /// <param name="ATotalPages">The number of pages that will be needed on client-side to
        /// hold all rows found by the SELECT statement</param>
        /// <returns>DataTable containing the find result records for the specified page
        /// </returns>
        public DataTable GetDataPagedResult(System.Int16 APage, System.Int16 APageSize, out System.Int32 ATotalRecords, out System.Int16 ATotalPages)
        {
            DataTable ReturnValue;

            TLogging.LogAtLevel(7, "TPartnerFind.GetDataPagedResult called.");
            ReturnValue   = FPagedDataSetObject.GetData(APage, APageSize);
            ATotalPages   = FPagedDataSetObject.TotalPages;
            ATotalRecords = FPagedDataSetObject.TotalRecords;

            if (!ReturnValue.Columns.Contains("BatchPosted"))
            {
                ReturnValue.Columns.Add(new DataColumn("BatchPosted", typeof(bool)));
            }

            foreach (DataRow Row in ReturnValue.Rows)
            {
                if (Row["a_batch_status_c"].ToString() == MFinanceConstants.BATCH_POSTED)
                {
                    Row["BatchPosted"] = true;
                }
                else
                {
                    Row["BatchPosted"] = false;
                }
            }

            /*if (ReturnValue != null)
             * {
             *  TPPartnerAddressAggregate.ApplySecurity(ref ReturnValue);
             * }*/

            return(ReturnValue);
        }
예제 #2
0
/*
 * /// destructor
 *      ~TPartnerLocationFindUIConnector()
 *      {
 *          TLogging.LogAtLevel (9, "TPartnerLocationFindUIConnector.FINALIZE called!");
 *      }
 */


        /// <summary>
        /// </summary>
        /// <param name="APage"></param>
        /// <param name="APageSize"></param>
        /// <param name="ATotalRecords"></param>
        /// <param name="ATotalPages"></param>
        /// <returns></returns>
        public DataTable GetDataPagedResult(System.Int16 APage, System.Int16 APageSize, out System.Int32 ATotalRecords, out System.Int16 ATotalPages)
        {
            TLogging.LogAtLevel(7, "TPartnerLocationFindUIConnector.GetDataPagedResult called.");
            DataTable ReturnValue;

            ReturnValue   = FPagedDataSetObject.GetData(APage, APageSize);
            ATotalPages   = FPagedDataSetObject.TotalPages;
            ATotalRecords = FPagedDataSetObject.TotalRecords;
            return((PartnerFindTDSSearchResultTable)ReturnValue);
        }
예제 #3
0
        /// <summary>
        /// Returns the specified find results page.
        ///
        /// @comment Pages can be requested in any order!
        ///
        /// </summary>
        /// <param name="APage">Page to return</param>
        /// <param name="APageSize">Number of records to return per page</param>
        /// <param name="ATotalRecords">The amount of rows found by the SELECT statement</param>
        /// <param name="ATotalPages">The number of pages that will be needed on client-side to
        /// hold all rows found by the SELECT statement</param>
        /// <returns>DataTable containing the find result records for the specified page
        /// </returns>
        public DataTable GetDataPagedResult(System.Int16 APage, System.Int16 APageSize, out System.Int32 ATotalRecords, out System.Int16 ATotalPages)
        {
            DataTable ReturnValue;

            TLogging.LogAtLevel(7, "TPartnerFind.GetDataPagedResult called.");
            ReturnValue   = FPagedDataSetObject.GetData(APage, APageSize);
            ATotalPages   = FPagedDataSetObject.TotalPages;
            ATotalRecords = FPagedDataSetObject.TotalRecords;

            return(ReturnValue);
        }
예제 #4
0
        /// <summary>
        /// Returns the specified find results page.
        ///
        /// @comment Pages can be requested in any order!
        ///
        /// </summary>
        /// <param name="APage">Page to return</param>
        /// <param name="APageSize">Number of records to return per page</param>
        /// <param name="ATotalRecords">The amount of rows found by the SELECT statement</param>
        /// <param name="ATotalPages">The number of pages that will be needed on client-side to
        /// hold all rows found by the SELECT statement</param>
        /// <returns>DataTable containing the find result records for the specified page
        /// </returns>
        public DataTable GetDataPagedResult(System.Int16 APage, System.Int16 APageSize, out System.Int32 ATotalRecords, out System.Int16 ATotalPages)
        {
            if (TLogging.DL >= 7)
            {
                Console.WriteLine(this.GetType().FullName + ".GetDataPagedResult called.");
            }

            DataTable ReturnValue = FPagedDataSetObject.GetData(APage, APageSize);

            if (FSearchTransactions)
            {
                foreach (DataRow Row in ReturnValue.Rows)
                {
                    SetOutstandingAmount(Row);
                }
            }
            else
            {
                // searching for outstanding invoices on the main screen
                if (!FSearchSupplierOrInvoice)
                {
                    foreach (DataRow Row in ReturnValue.Rows)
                    {
                        // calculate DateDue and DateDiscountUntil
                        // add creditTerms to dateIssued to get DateDue

                        if (Row["CreditTerms"].GetType() != typeof(DBNull))
                        {
                            Row["DateDue"] = Convert.ToDateTime(Row["DateIssued"]).AddDays(Convert.ToInt16(Row["CreditTerms"]));
                        }

                        if (Row["DiscountDays"].GetType() != typeof(DBNull))
                        {
                            Row["DateDiscountUntil"] = Convert.ToDateTime(Row["DateIssued"]).AddDays(Convert.ToInt16(Row["DiscountDays"]));
                        }

                        SetOutstandingAmount(Row);

                        Row["DiscountMsg"] = "None";
                        Row["Selected"]    = false;

                        if (Row["DiscountPercentage"].GetType() == typeof(DBNull))
                        {
                            Row["DiscountPercentage"] = 0;
                        }

                        if (Convert.ToDateTime(Row["DateDiscountUntil"]) > DateTime.Now)
                        {
                            Row["DiscountMsg"] =
                                String.Format("{0:n0}% until {1}",
                                              Row["DiscountPercentage"],
                                              TDate.DateTimeToLongDateString2(Convert.ToDateTime(Row["DateDiscountUntil"])));
                        }
                        else
                        {
                            Row["DiscountMsg"] = "Expired";
                        }
                    }
                }
            }

            ATotalPages   = FPagedDataSetObject.TotalPages;
            ATotalRecords = FPagedDataSetObject.TotalRecords;

            // TODO TAccountsPayableAggregate.ApplySecurity(ref ReturnValue);
            return(ReturnValue);
        }