コード例 #1
0
        private static void SetQuoteInfoSection(IWorksheet worksheet, QuoteWrapper quote)
        {
            worksheet.Rows[71].Columns[2].Insert(Direction.Vertical, new[] {
                "Name",
                "Address",
                "Phone",
                "File No.",
                "Branch",
                "Takeoff"
            });

            worksheet.Rows[71].Columns[3].Insert(Direction.Vertical, new[] {
                quote.Client.Name,
                quote.Client.Contact.Address.Number + " " + quote.Client.Contact.Address.Street + " " + quote.Client.Contact.Address.StreetType + ", " + quote.Client.Contact.Address.Town,
                quote.Client.Contact.Phone.CellPhone,
                quote.FileNumber
            });

            worksheet.Rows[70].Height = 17;
            worksheet.Rows[74].Height = 19.5;
            worksheet.Rows[70].Columns[1].Shade(10, 1);
            worksheet.Rows[71].Columns[2].HorizontalAlignment = Alignment.Right;
            worksheet.Rows[72].Columns[2].HorizontalAlignment = Alignment.Right;
            worksheet.Rows[73].Columns[2].HorizontalAlignment = Alignment.Right;
            worksheet.Rows[74].Columns[2].HorizontalAlignment = Alignment.Right;
            worksheet.Rows[75].Columns[2].HorizontalAlignment = Alignment.Right;
            worksheet.Rows[76].Columns[2].HorizontalAlignment = Alignment.Right;
        }
コード例 #2
0
ファイル: Quotes.cs プロジェクト: jonniegraham/QMSFull
        public async Task <QuoteWrapper> GetQuoteByFileNumberAsync(string fileNumber)
        {
            var quoteTask = await _database.GetRowsAsync("quote", new Dictionary <string, dynamic>
            {
                { "file_number", fileNumber }
            });

            if (quoteTask.Count == 0)
            {
                return(null);
            }

            var quoteWrapper = new QuoteWrapper(new Quote
            {
                Id         = quoteTask[0]["quote_id"],
                FileNumber = quoteTask[0]["file_number"],
                Date       = Convert.ToDateTime(quoteTask[0]["date"]).Date,
                Amount     = (double?)(quoteTask[0]["amount"] is double?quoteTask[0]["amount"] : null),
                Cost       = (double?)(quoteTask[0]["cost"] is double?quoteTask[0]["cost"] : null),
                Client     = await GetClientByIdAsync((int)quoteTask[0]["client_id"]),
                UserId     = quoteTask[0]["user_id"]
            });

            return(quoteWrapper);
        }
コード例 #3
0
        private void SetProjectInfoSection(IWorksheet worksheet, QuoteWrapper quote)
        {
            worksheet.Rows[16].Columns[2].Insert(Direction.Vertical, new[] {
                "SCHEDULE OF MATERIAL",
                "for",
                Job,
                "at"
            });

            worksheet.Rows[23].Columns[3].Insert(Direction.Vertical, new[] {
                "(This document is to provide a guideline only and not to form part of a",
                " Contract)"
            });

            worksheet.Rows[26].Columns[2].Insert(Direction.Vertical, new[] {
                "1. An estimate of materials. This is an ESTIMATE ONLY. While Mega Petone has made",
                "reasonable efforts to the accuracy of this estimate, customers are advised that",
                "building techniques do vary considerably and on site circumstances cannot be",
                "anticipated by Mega Petone.",
                "2. Estimated prices for materials do not include G.S.T, which will be added when invoicing.",
                "3. No responsibility is held for any error in calculation volume, takeoff or",
                "estimation by Mega Petone.",
                "4. If only part of this Estimate is going to be used, we have the right to amend any of the",
                "discounts that apply.",
                "5. Cartage WILL be charged at"
            });

            worksheet.Rows[36].Columns[5].Insert(Direction.Vertical, new[] {
                "Small Truck From - $47.82",
                "Nees HIAB From - $100"
            });

            worksheet.Rows[37].Columns[10].Insert(
                "Courtesy Trailer - No Charge"
                );

            worksheet.Rows[38].Columns[2].Insert(
                "6. All prices valid for 30 days, then are subject increased costs and availability."
                );

            worksheet.Rows[13].Columns[2].Value = "Builder:";
            worksheet.Rows[13].Columns[3].Value = Contractor;
            worksheet.Rows[13].Columns[2].SetBold(true, 2, 8);
            worksheet.Rows[13].Columns[2].Underline(2);
            worksheet.Rows[13].Columns[2].HorizontalAlignment = Alignment.Right;

            worksheet.Rows[20].Columns[2].Value = quote.Client.Contact.Address.Number + " " + quote.Client.Contact.Address.Street + " " + quote.Client.Contact.Address.StreetType;
            worksheet.Rows[21].Columns[2].Value = quote.Client.Contact.Address.Town;
        }