void SelectWin32Printer(AssetComputerData acd, int AID)
        {
            System.Collections.Generic.List <AssetComputerPrinterData> l = new System.Collections.Generic.List <AssetComputerPrinterData>();
            DataSet ds = Select("select * from Win32_Printer where AID=" + AID);

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                AssetComputerPrinterData d = new AssetComputerPrinterData()
                {
                    PrinterName   = r["Name"].ToString(),
                    PrinterDriver = r["DriverName"].ToString(),
                    PrinterPort   = r["PortName"].ToString()
                };
                l.Add(d);
            }
            acd.Printers = l.ToArray();
        }
Beispiel #2
0
 static void CopyComputerPrinters(AssetComputerPrinterData source, lib.bwa.bigWebDesk.LinqBll.Context.AssetComputerPrinters dest, int DepartmentID, int AssetID)
 {
     dest.AssetId = AssetID;
     dest.DepartmentId = DepartmentID;
     dest.PrinterDriver = source.PrinterDriver;
     dest.PrinterName = source.PrinterName;
     dest.PrinterPort = source.PrinterPort;
 }
 void SelectWin32Printer(AssetComputerData acd, int AID)
 {
     System.Collections.Generic.List<AssetComputerPrinterData> l = new System.Collections.Generic.List<AssetComputerPrinterData>();
     DataSet ds = Select("select * from Win32_Printer where AID=" + AID);
     foreach (DataRow r in ds.Tables[0].Rows)
     {
         AssetComputerPrinterData d = new AssetComputerPrinterData()
         {
             PrinterName = r["Name"].ToString(),
             PrinterDriver = r["DriverName"].ToString(),
             PrinterPort = r["PortName"].ToString()
         };
         l.Add(d);
     }
     acd.Printers = l.ToArray();
 }