示例#1
0
        public QuoteItemReportAdd_Service(DataTable tbl, int quoteRevID)
        {
            try
            {
                DataTable tbl2 = GetItemsList(quoteRevID);

                DataTable tbl3 = GetItemsGroupByPrintOrder(quoteRevID);


                if (tbl2 != null & tbl3 != null)
                {
                    //row Data
                    foreach (DataRow row in tbl2.Rows)
                    {
                        int printOrder  = Convert.ToInt32(row["qiPrintOrder"]);
                        int optionCount = GetOptionCount(printOrder, tbl3);

                        DataRow rowNew = tbl.NewRow();
                        //row New

                        rowNew["PrintOrder"] = AddPrintOrderBaseNumber(printOrder);
                        row["qiAmountText"]  = ConvertToF2Format(row["qiAmountText"]);

                        QuoteItemPrintFormat qiTO = GetQuoteItemPrintFormat(row, optionCount);

                        rowNew["Title"] = qiTO.qiTitle;

                        rowNew["QuoteOption"]      = qiTO.qiOption;
                        rowNew["HtmlAmount"]       = qiTO.HtmlTitleAmount;
                        rowNew["HtmlAmountOption"] = qiTO.HtmlOptionAmount;

                        rowNew["Description"] = qiTO.Description;
                        if (!MyConvert.IsNullString(row["qiAmount"]))
                        {
                            string sq1 = MyConvert.ConvertToString(row["qiAmount"]);
                            if (MyConvert.IsAccountingFormatNumberic(sq1))
                            {
                                rowNew["Amount"] = MyConvert.ConvertAccountingFormatStringToDouble(sq1);
                            }
                        }

                        tbl.Rows.Add(rowNew);
                    }
                }
            }
            catch (SqlException ex)
            {
                string errorLog = ex.Message;
            }
            finally
            {
            }

            _tbl = tbl;
        }
示例#2
0
        public QuoteItemPrintFormat GetQuoteItemPrintFormat(DataRow row, int optionCount)
        {
            QuoteItemPrintFormat qiTO = null;

            if (optionCount == 1)
            {
                qiTO = new QuoteItem_OneOption_Service(row);
            }
            else
            {
                qiTO = new QuoteItem_MoreThanOneOptions_Service(row);
            }
            return(qiTO);
        }