Exemplo n.º 1
0
 public void itmtoexcel(pswift.IItem itm, int rowidx, Excel._Worksheet osheet)
 {
     if (rowidx > 36)
     {
         osheet.Cells[rowidx, 1].EntireRow.Insert(System.Reflection.Missing.Value);
     }
     osheet.Cells[rowidx, 1].value = itm.GetPropertyResultAsString("Qty", "");
     osheet.Cells[rowidx, 2].value = itm.GetProperty("Qty").Units;
     osheet.Cells[rowidx, 3].value = itm.GetPropertyResultAsString("Item #", "");
     osheet.Cells[rowidx, 4].value = itm.Name;
     osheet.Cells[rowidx, 5].value = itm.GetPropertyResultAsString("Price Each", "");
     osheet.Cells[rowidx, 6].value = itm.GetPropertyResultAsString("Price Total", "");
 }
Exemplo n.º 2
0
 public void itmtoword(pswift.IItem itm, Word.Table tbl, int rowidx, string tp)
 {
     if (rowidx > 20)
     {
         tbl.Rows.Add(System.Reflection.Missing.Value);
     }
     if (tp == "Digitizer")
     {
         tbl.Cell(rowidx, 1).Range.Font.Bold   = 1;
         tbl.Cell(rowidx, 1).Range.Font.Italic = 0;
     }
     else
     {
         tbl.Cell(rowidx, 1).Range.Font.Bold   = 0;
         tbl.Cell(rowidx, 1).Range.Font.Italic = 1;
     }
     tbl.Cell(rowidx, 1).Range.Text = itm.Name;
     tbl.Cell(rowidx, 2).Range.Text = itm.GetPropertyResultAsString("Qty", "");
     tbl.Cell(rowidx, 3).Range.Text = itm.GetProperty("Qty").Units;
     tbl.Cell(rowidx, 4).Range.Text = itm.GetPropertyResultAsString("Price Each", "");
     tbl.Cell(rowidx, 5).Range.Text = itm.GetPropertyResultAsString("Price Total", "");
 }
Exemplo n.º 3
0
 public void loadTakeoffItems(pswift.IItem itm, List <string> lst)
 {
     for (int idx = 0; idx <= itm.ChildCount() - 1; idx++)
     {
         pswift.IItem citm = itm[idx];
         if (citm.GetProperty("Type").ResultAsString() == "Folder")
         {
             loadTakeoffItems(citm, lst);
         }
         else
         {
             Boolean isItem = citm.GetPropertyResultAsBoolean("IsItem", false);
             if (isItem)
             {
                 lst.Add(citm.GUID());
             }
             if (citm.ChildCount() != 0)
             {
                 loadTakeoffItems(citm, lst);
             }
         }
     }
 }