示例#1
0
 public ArrayList getAllInventPrinter(string storeId,string itemNum)
 {
     DataTable p = getGui.GetAllInventPrinter(storeId, itemNum);
     ArrayList printers = new ArrayList();
     for (int i = 0; i < p.Rows.Count; i++)
     {
         string pName = p.Rows[i]["PrinterName"].ToString();
         Printer printer = new Printer(pName);
         printers.Add(printer);
     }
     return printers;
 }
示例#2
0
 public Printer GetPrinterByName(string store_ID, string station_ID,string Name)
 {
     DataTable record = getGui.GetPrinterByName(StaticClass.storeId, StaticClass.stationId, Name);
     if(record.Rows.Count > 0)
     {
         string PrinterName = record.Rows[0]["PrinterName"].ToString();
         string NetworkPort = record.Rows[0]["NetworkPort"].ToString();
         string Localport = record.Rows[0]["LocalPort"].ToString();
         string detail = record.Rows[0]["Details"].ToString();
         bool disable = Convert.ToBoolean(record.Rows[0]["Disabled"]);
         bool twoColor = Convert.ToBoolean(record.Rows[0]["Two_Color_Printing"]);
         bool cutPrint = Convert.ToBoolean(record.Rows[0]["CutReceipt"]);
         Printer printer = new Printer(PrinterName, Localport, NetworkPort, detail, disable, twoColor, cutPrint);
         return printer;
     }
     return null;
 }
示例#3
0
 public void InsertPrinter(Printer printer)
 {
     getGui.InsertPrinter(StaticClass.storeId,StaticClass.stationId,printer.PrinterName,printer.Disable,printer.Two_Color,printer.Cut_Print,printer.LocalPort,printer.NetworkPort,printer.Details);
 }
示例#4
0
 public ArrayList getPrinters(string store_ID,string station_ID)
 {
     ArrayList printers = new ArrayList();
     DataTable record = getGui.GetPrinters(store_ID, station_ID);
     for (int i = 0; i < record.Rows.Count; i++)
     {
         string PrinterName = record.Rows[i]["PrinterName"].ToString();
         string NetworkPort = record.Rows[i]["NetworkPort"].ToString();
         string Localport = record.Rows[i]["LocalPort"].ToString();
         string detail = record.Rows[i]["Details"].ToString();
         bool disable = Convert.ToBoolean(record.Rows[i]["Disabled"]);
         bool twoColor = Convert.ToBoolean(record.Rows[i]["Two_Color_Printing"]);
         bool cutPrint = Convert.ToBoolean(record.Rows[i]["CutReceipt"]);
         Printer printer = new Printer(PrinterName,Localport,NetworkPort,detail,disable,twoColor,cutPrint);
         printers.Add(printer);
     }
     return printers;
 }
示例#5
0
 private void button1_Click(object sender, EventArgs e)
 {
     FrmKeyBoard frmKeyBoard = new FrmKeyBoard();
     if(frmKeyBoard.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         if(!Printers.ContainsKey(frmKeyBoard.value))
         {
             Printer printer = new Printer(frmKeyBoard.value,"","","NONE",false,false,false);
             printer.isNew = true;
             Printers.Add(frmKeyBoard.value,printer);
             listBox1.Items.Add(frmKeyBoard.value);
             listBox1.SelectedIndex = listBox1.Items.Count - 1;
         }
         else
         {
             Alert.Show("Tên máy in đã có rồi",Color.Red);
         }
     }
 }
示例#6
0
 private void button1_Click(object sender, EventArgs e)
 {
     FrmPrinterChoice frmPrinterChoice =new FrmPrinterChoice();
     if(frmPrinterChoice.ShowDialog() == DialogResult.OK)
     {
         if(CheckPrinterExist(frmPrinterChoice.PrinterName))
         {
             Printer printer = new Printer(frmPrinterChoice.PrinterName);
             printer.isNew = true;
             InventPrinters.Add(printer);
             creListBox1.Items.Add(printer);
         }
         else
         {
             Alert.Show("Máy in đã có rồi",Color.Red);
         }
     }
 }