Exemplo n.º 1
0
 public virtual void Fill()
 {
     this.PreFill();
     this.dsS_OS_STANJE_LOKACIJA_ISPIS_NALJEPNICADataSet1 = new S_OS_STANJE_LOKACIJA_ISPIS_NALJEPNICADataSet();
     this.m_StartRow    = 0;
     this.Cursor        = Cursors.WaitCursor;
     this.m_GridLoading = true;
     ThreadPool.QueueUserWorkItem(new WaitCallback(this.FillDataThread), Thread.CurrentPrincipal);
 }
Exemplo n.º 2
0
        public void naljepnice_po_nosiocu()
        {
            LOKACIJESelectionListWorkItem item = this.Controller.WorkItem.Items.AddNew <LOKACIJESelectionListWorkItem>("test");
            DataRow row2 = item.ShowModal(true, "", null);

            item.Terminate();
            if (row2 != null)
            {
                IEnumerator enumerator = null;
                S_OS_STANJE_LOKACIJA_ISPIS_NALJEPNICADataAdapter adapter2 = new S_OS_STANJE_LOKACIJA_ISPIS_NALJEPNICADataAdapter();
                S_OS_STANJE_LOKACIJA_ISPIS_NALJEPNICADataSet     dataSet  = new S_OS_STANJE_LOKACIJA_ISPIS_NALJEPNICADataSet();
                adapter2.Fill(dataSet, Conversions.ToInteger(row2["idlokacije"]));
                KORISNIKDataSet set = new KORISNIKDataSet();
                new KORISNIKDataAdapter().Fill(set);
                string       str      = Conversions.ToString(set.KORISNIK.Rows[0]["KORISNIK1NAZIVZANALJEPNICE"]);
                Encoding     encoding = Encoding.GetEncoding(0x4e2);
                StreamWriter writer   = new StreamWriter("maleN.txt", false, encoding);
                try
                {
                    enumerator = dataSet.S_OS_STANJE_LOKACIJA_ISPIS_NALJEPNICA.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        int     num2    = Conversions.ToInteger(current["stanje"]);
                        int     num4    = num2;
                        for (int i = 1; i <= num4; i++)
                        {
                            string str3 = "\"" + str + "\"";
                            string str4 = Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject("\"", current["NAZIVOS"]), "\""));
                            string str2 = Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject("\"", current["INVBROJ"]), "\""));
                            writer.WriteLine("");
                            writer.WriteLine("N");
                            writer.WriteLine("I8,B,001");
                            writer.WriteLine("Q152,32");
                            writer.WriteLine("q100");
                            writer.WriteLine("rN");
                            writer.WriteLine("S2");
                            writer.WriteLine("D7");
                            writer.WriteLine("ZB");
                            writer.WriteLine("JF");
                            writer.WriteLine("OD");
                            writer.WriteLine("R60,0");
                            writer.WriteLine("A210,26,0,1,1,1,N," + str3);
                            writer.WriteLine("A210,46,0,1,1,1,N," + str4);
                            writer.WriteLine("B210,65,0,1,2,2,60,B," + str2);
                            writer.WriteLine("P1");
                        }
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                writer.Close();
                if (Interaction.MsgBox("Izrada naljepnica završena. Želite li ispisati naljepnice na ZEBRA printer?", MsgBoxStyle.YesNo, "OS-Ispis naljepnica") == MsgBoxResult.Yes)
                {
                    PrintDialog dialog = new PrintDialog {
                        PrinterSettings = new PrinterSettings()
                    };
                    if (dialog.ShowDialog(this) == DialogResult.OK)
                    {
                        DOSPrinter.SendFileToPrinter(dialog.PrinterSettings.PrinterName, "maleN.txt");
                    }
                    else
                    {
                        Interaction.MsgBox("Odustali ste od ispisa naljepnica!", MsgBoxStyle.OkOnly, "OS-Ispis naljepnica");
                    }
                }
            }
        }