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; }
//1. Remove Crating //2. Add Permits //3. Modify Total //********** After Refresh(); public void RefreshPermitTotal(double permitTotal) { if (Values.Count == 0) { return; } var summary01 = Values.First(x => x.OrderNumber == (int)NEstCostSummaryExtra.Crating); var cratingTotal = MyConvert.ConvertAccountingFormatStringToDouble(summary01.Column1); summary01.Name = "Permits Cost(P.)"; summary01.Column1 = (Math.Round(permitTotal, 0)).ToString("C0"); var difference = permitTotal - cratingTotal; var summary04 = Values.First(x => x.OrderNumber == (int)NEstCostSummaryExtra.TotalOfCSL); summary04.Name = "P.S.L."; var cslTotal = MyConvert.ConvertAccountingFormatStringToDouble(summary04.Column1); TotalPrice = cslTotal + difference; summary04.Column1 = (Math.Round(TotalPrice, 0)).ToString("C0"); }