Exemplo n.º 1
0
        private bool Datoteka_HYPO(ref string parDatoteka)
        {
            bool flag = false;

            try
            {
                string         str2          = "";
                string         str           = "";
                SqlConnection  connection    = new SqlConnection(Configuration.ConnectionString);
                SqlCommand     selectCommand = new SqlCommand();
                SqlDataAdapter adapter2      = new SqlDataAdapter(selectCommand);
                selectCommand.Connection  = connection;
                selectCommand.CommandText = "SELECT KORISNIK.KORISNIK1NAZIV, KORISNIK.MBKORISNIK FROM KORISNIK WHERE IDKORISNIK = 1";
                selectCommand.CommandType = CommandType.Text;
                adapter2 = new SqlDataAdapter(selectCommand);
                DataTable dataTable = new DataTable();
                adapter2.Fill(dataTable);
                if (dataTable.Rows.Count > 0)
                {
                    str2 = Conversions.ToString(dataTable.Rows[0]["KORISNIK1NAZIV"]);
                    str  = Conversions.ToString(dataTable.Rows[0]["MBKORISNIK"]);
                }
                sp_diskete_za_bankuDataAdapter adapter = new sp_diskete_za_bankuDataAdapter();
                sp_diskete_za_bankuDataSet     dataSet = new sp_diskete_za_bankuDataSet();
                object obj2 = adapter.Fill(dataSet, this.SifraObracuna, this.VBDI);
                if (dataSet.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Ne postoje isplate za HYPO banku");
                    return(flag);
                }
                StreamWriter writer  = new StreamWriter(parDatoteka, false, Encoding.GetEncoding(0x354));
                StreamWriter writer2 = writer;
                writer2.Write("10");
                writer2.Write(str2.PadRight(40));
                writer2.Write("\r\n");
                int num2 = dataSet.Tables[0].Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    writer2.Write("20");
                    writer2.Write("15");
                    writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Rows[i]["TEKUCI"])), 10, 0, false, ""));
                    writer2.Write(DB.BrojVodecePraznine(DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Rows[i]["UKUPNOZAISPLATU"])), 11, 2, true, "."));
                    writer2.Write(new string(' ', 3));
                    writer2.Write(new string(' ', 6));
                    writer2.Write("\r\n");
                }
                writer2.Close();
                writer2 = null;
                flag    = true;
            }
            catch (System.Exception exception1)
            {
                throw exception1;

                //Interaction.MsgBox("Greška!!! ", MsgBoxStyle.OkOnly, null);
                //flag = false;
            }
            return(flag);
        }
Exemplo n.º 2
0
        private bool Disketa_Karlovacka(string NazivDatoteke)
        {
            bool flag = false;

            try
            {
                IEnumerator    enumerator    = null;
                SqlConnection  connection    = new SqlConnection(Configuration.ConnectionString);
                SqlCommand     selectCommand = new SqlCommand();
                SqlDataAdapter adapter2      = new SqlDataAdapter(selectCommand);
                selectCommand.Connection = connection;
                sp_diskete_za_bankuDataAdapter adapter = new sp_diskete_za_bankuDataAdapter();
                sp_diskete_za_bankuDataSet     dataSet = new sp_diskete_za_bankuDataSet();
                object obj2 = adapter.Fill(dataSet, this.SifraObracuna, this.VBDI);
                if (dataSet.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Ne postoje isplate za KARLOVAČKU banku");
                    return(flag);
                }
                StreamWriter writer = new StreamWriter(NazivDatoteke, false, Encoding.ASCII);
                DataTable    table  = dataSet.Tables[0];
                int          num    = 0;
                try
                {
                    enumerator = table.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        writer.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["TEKUCI"])), 10, 0, false, ""));
                        writer.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["UKUPNOZAISPLATU"])), 8, 2, false, ""));
                        writer.Write("\r\n");
                        num++;
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                writer.Close();
                table = null;
                flag  = true;
            }
            catch (System.Exception exception1)
            {
                throw exception1;

                //Interaction.MsgBox("Greška", MsgBoxStyle.OkOnly, null);
                //flag = false;
            }
            return(flag);
        }
Exemplo n.º 3
0
        private bool Datoteka_Erste(string strNazivDatoteke)
        {
            bool flag = false;

            try
            {
                SqlConnection  connection    = new SqlConnection(Configuration.ConnectionString);
                SqlCommand     selectCommand = new SqlCommand();
                SqlDataAdapter adapter2      = new SqlDataAdapter(selectCommand);
                selectCommand.Connection  = connection;
                selectCommand.CommandText = "SELECT ZRNBANKE FROM BANKE WHERE VBDIBANKE = '" + this.strVBDIBanke + "'";
                selectCommand.CommandType = CommandType.Text;
                adapter2 = new SqlDataAdapter(selectCommand);
                DataTable dataTable = new DataTable();
                adapter2.Fill(dataTable);
                if (dataTable.Rows.Count > 0)
                {
                    this.ZiroBanke = Conversions.ToString(dataTable.Rows[0]["zrnbanke"]);
                }
                sp_diskete_za_bankuDataAdapter adapter = new sp_diskete_za_bankuDataAdapter();
                sp_diskete_za_bankuDataSet     dataSet = new sp_diskete_za_bankuDataSet();
                int num = adapter.Fill(dataSet, this.SifraObracuna, this.strVBDIBanke);
                if (dataSet.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Ne postoje isplate za Erste banku");
                    return(flag);
                }
                decimal      num2    = DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Compute("Sum(UKUPNOZAISPLATU)", "")));
                StreamWriter writer  = new StreamWriter(strNazivDatoteke, false, Encoding.ASCII);
                StreamWriter writer2 = writer;
                writer2.Write(string.Format("Z1{0}-{1}", this.strVBDIBanke.PadRight(7), this.ZiroBanke.PadRight(10)));
                writer2.Write("\r\n");
                writer2.Write("Z2" + this.Ziro.PadRight(0x12));
                writer2.Write("\r\n");
                int num4 = dataSet.Tables[0].Rows.Count - 1;
                for (int i = 0; i <= num4; i++)
                {
                    writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Rows[i]["TEKUCI"])), 10, 0, false, ""));
                    writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Rows[i]["UKUPNOZAISPLATU"])), 8, 2, false, ""));
                    writer2.Write("\r\n");
                }
                writer2.Close();
                writer2 = null;
                flag    = true;
            }
            catch (System.Exception exception1)
            {
                throw exception1;

                //Interaction.MsgBox(string.Format("Greška!", new object[0]), MsgBoxStyle.OkOnly, null);
                //flag = false;
            }
            return(flag);
        }
Exemplo n.º 4
0
        private bool Datoteka_Raiffeisen(string NazivDatoteke)
        {
            bool flag = false;

            try
            {
                IEnumerator    enumerator    = null;
                string         str3          = Conversions.ToString(this.BrojPoslovnice.Value);
                string         str           = "0";
                string         str2          = "0";
                SqlConnection  connection    = new SqlConnection(Configuration.ConnectionString);
                SqlCommand     selectCommand = new SqlCommand();
                SqlDataAdapter adapter2      = new SqlDataAdapter(selectCommand);
                selectCommand.Connection  = connection;
                selectCommand.CommandText = "SELECT KORISNIK.MBKORISNIK, KORISNIK.MBKORISNIKJEDINICA FROM KORISNIK WHERE IDKORISNIK = 1";
                selectCommand.CommandType = CommandType.Text;
                adapter2 = new SqlDataAdapter(selectCommand);
                DataTable dataTable = new DataTable();
                adapter2.Fill(dataTable);
                if (dataTable.Rows.Count > 0)
                {
                    str  = Conversions.ToString(dataTable.Rows[0]["MBKORISNIK"]);
                    str2 = Conversions.ToString(dataTable.Rows[0]["MBKORISNIKJEDINICA"]);
                    if (str2.Length > 3)
                    {
                        str2 = str2.Substring(0, 3);
                    }
                }
                sp_diskete_za_bankuDataAdapter adapter = new sp_diskete_za_bankuDataAdapter();
                sp_diskete_za_bankuDataSet     dataSet = new sp_diskete_za_bankuDataSet();
                int vBroj = adapter.Fill(dataSet, this.sifraObracuna, this.VBDI);
                if (dataSet.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Ne postoje isplate za Raiffeissenbanku");
                    return(flag);
                }
                decimal num2 = DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Compute("Sum(UKUPNOZAISPLATU)", "")));
                vBroj = Convert.ToInt32(DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Compute("count(idradnik)", ""))));
                StreamWriter writer  = new StreamWriter(NazivDatoteke, false, Encoding.ASCII);
                StreamWriter writer2 = writer;
                writer2.Write("19101");
                writer2.Write(this.BrojPoslovnice.Text);
                writer2.Write(RuntimeHelpers.GetObjectValue(Interaction.IIf(this.datUplate.Text.Trim() == "", "      ", Conversions.ToDate(this.datUplate.Value).ToString("yyyyMMdd"))));
                writer2.Write(DB.BrojVodecePraznine(vBroj, 6, 0, false, ""));
                writer2.Write(DB.BrojVodecePraznine(num2, 14, 2, true, "."));
                writer2.Write("\r\n");
                int num3 = 0;
                try
                {
                    enumerator = dataSet.Tables[0].Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        writer2.Write(DB.BrojVodecePraznine(RuntimeHelpers.GetObjectValue(current["TEKUCI"]), 10, 0, false, "").Substring(0, 10));
                        writer2.Write(DB.BrojVodecePraznine(DB.N20(RuntimeHelpers.GetObjectValue(current["UKUPNOZAISPLATU"])), 14, 2, true, "."));
                        writer2.Write("\r\n");
                        num3++;
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                writer2 = null;
                writer.Close();
                flag = true;
            }
            catch (System.Exception exception1)
            {
                throw exception1;

                //Interaction.MsgBox("Greška", MsgBoxStyle.OkOnly, null);
                //flag = false;
            }
            return(flag);
        }
Exemplo n.º 5
0
        private bool Datoteka_Zaba(string sDatoteka)
        {
            bool flag = false;

            try
            {
                IEnumerator         enumerator = null;
                string              vBroj      = Conversions.ToString(this.BrojPoslovnice.Value);
                string              str3       = "0";
                string              str        = "0";
                string              str2       = "0";
                KORISNIKDataAdapter adapter2   = new KORISNIKDataAdapter();
                KORISNIKDataSet     dataSet    = new KORISNIKDataSet();
                adapter2.FillPage(dataSet, 0, 1);
                if (dataSet.KORISNIK.Rows.Count > 0)
                {
                    str  = Conversions.ToString(dataSet.KORISNIK.Rows[0]["MBKORISNIK"]);
                    str2 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["MBKORISNIKJEDINICA"]);
                    if (str2.Length > 3)
                    {
                        str2 = str2.Substring(0, 3);
                    }
                }
                sp_diskete_za_bankuDataAdapter adapter = new sp_diskete_za_bankuDataAdapter();
                sp_diskete_za_bankuDataSet     set2    = new sp_diskete_za_bankuDataSet();
                adapter.Fill(set2, this.sifraObracuna, this.VBDI);
                object obj2 = DB.N20(RuntimeHelpers.GetObjectValue(set2.Tables[0].Compute("count(idradnik)", "")));
                if (set2.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Ne postoje isplate za ZAGREBAČKU banku");
                    return(flag);
                }
                decimal      num     = DB.N20(RuntimeHelpers.GetObjectValue(set2.Tables[0].Compute("Sum(UKUPNOZAISPLATU)", "")));
                StreamWriter writer  = new StreamWriter(sDatoteka, false, Encoding.ASCII);
                StreamWriter writer2 = writer;
                writer2.Write("030");
                writer2.Write("0000000");
                writer2.Write("3234495");
                writer2.Write(RuntimeHelpers.GetObjectValue(Interaction.IIf(this.datumUplate.Text.Trim() == "", "      ", Conversions.ToDate(this.datumUplate.Value).ToString("ddMMyy"))));
                writer2.Write("0000000000000");
                writer2.Write(DB.BrojVodeceNule(num, 11, 2, false, ""));
                writer2.Write(DB.BrojVodeceNule(RuntimeHelpers.GetObjectValue(obj2), 4, 0, false, ""));
                writer2.Write(DB.BrojVodeceNule(str, 8, 0, false, ""));
                writer2.Write(DB.BrojVodeceNule(str2, 3, 0, false, ""));
                writer2.Write(new string('0', 6));
                writer2.Write(DB.BrojVodeceNule(vBroj, 6, 0, false, ""));
                writer2.Write("*");
                writer2.Write("   ");
                writer2.Write("\r\n");
                int num2 = 0;
                try
                {
                    enumerator = set2.Tables[0].Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        writer2.Write("031");
                        writer2.Write("0000000");
                        writer2.Write(DB.BrojVodeceNule(str3, 6, 0, false, ""));
                        writer2.Write(RuntimeHelpers.GetObjectValue(Interaction.IIf(this.datumUplate.Text.Trim() == "", "      ", Conversions.ToDate(this.datumUplate.Value).ToString("ddMMyy"))));
                        writer2.Write("01");
                        writer2.Write("50");
                        writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["UKUPNOZAISPLATU"])), 9, 2, false, ""));
                        writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["TEKUCI"])), 10, 0, false, ""));
                        writer2.Write(new string('0', 6));
                        writer2.Write(DB.BrojVodeceNule(str, 8, 0, false, ""));
                        writer2.Write(DB.BrojVodeceNule(str2, 3, 0, false, ""));
                        writer2.Write(new string('0', 12));
                        writer2.Write("*");
                        writer2.Write("   ");
                        writer2.Write("\r\n");
                        num2++;
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                writer2.Close();
                writer2 = null;
                flag    = true;
            }
            catch (System.Exception exception1)
            {
                throw exception1;

                //Interaction.MsgBox("Greška:", MsgBoxStyle.OkOnly, null);
                //flag = false;
            }
            return(flag);
        }
Exemplo n.º 6
0
        private bool Datoteka_Jadranska(string sDatoteka)
        {
            bool flag = false;

            try
            {
                IEnumerator    enumerator    = null;
                SqlConnection  connection    = new SqlConnection(Configuration.ConnectionString);
                SqlCommand     selectCommand = new SqlCommand();
                SqlDataAdapter adapter2      = new SqlDataAdapter(selectCommand);
                selectCommand.Connection  = connection;
                selectCommand.CommandText = "SELECT ZRNBANKE FROM BANKE WHERE VBDIBANKE = '" + this.VBDI + "'";
                selectCommand.CommandType = CommandType.Text;
                adapter2 = new SqlDataAdapter(selectCommand);
                DataTable dataTable = new DataTable();
                adapter2.Fill(dataTable);
                if (dataTable.Rows.Count > 0)
                {
                    this.ZRNBANKE = Conversions.ToString(dataTable.Rows[0]["zrnbanke"]);
                }
                sp_diskete_za_bankuDataAdapter adapter = new sp_diskete_za_bankuDataAdapter();
                sp_diskete_za_bankuDataSet     dataSet = new sp_diskete_za_bankuDataSet();
                object obj2 = adapter.Fill(dataSet, this.Obracun, this.VBDI);
                if (dataSet.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Ne postoje isplate za JADRANSKU banku!");
                    return(flag);
                }
                decimal      vNumber = DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Compute("Sum(UKUPNOZAISPLATU)", "")));
                StreamWriter writer  = new StreamWriter(sDatoteka, false, Encoding.ASCII);
                StreamWriter writer2 = writer;
                writer2.Write("00   ");
                writer2.Write(this.utxtSifraPoduzeca.Text);
                writer2.Write(DB.BrojVodeceNule(DB.N20(vNumber), 13, 2, false, ""));
                writer2.Write(Strings.Space(10));
                writer2.Write("\r\n");
                int num2 = 0;
                try
                {
                    enumerator = dataSet.Tables[0].Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        writer2.Write("11");
                        writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["TEKUCI"])), 10, 0, false, ""));
                        writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["UKUPNOZAISPLATU"])), 13, 2, false, ""));
                        writer2.Write(Strings.Space(10));
                        writer2.Write("\r\n");
                        num2++;
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                writer2.Close();
                writer2 = null;
                flag    = true;
            }
            catch (System.Exception exception1)
            {
                throw exception1;

                //Interaction.MsgBox("Greška: ", MsgBoxStyle.OkOnly, null);
                //flag = false;
            }
            return(flag);
        }
Exemplo n.º 7
0
        private bool Datoteka_PBZ(string NazivDatoteke)
        {
            bool flag = false;

            try
            {
                IEnumerator    enumerator    = null;
                int            vBroj         = 0;
                string         str           = "0";
                string         str2          = "0";
                SqlConnection  connection    = new SqlConnection(Configuration.ConnectionString);
                SqlCommand     selectCommand = new SqlCommand();
                SqlDataAdapter adapter       = new SqlDataAdapter(selectCommand);
                selectCommand.Connection  = connection;
                selectCommand.CommandText = "SELECT KORISNIK.MBKORISNIK, KORISNIK.MBKORISNIKJEDINICA FROM KORISNIK WHERE IDKORISNIK = 1";
                selectCommand.CommandType = CommandType.Text;
                adapter = new SqlDataAdapter(selectCommand);
                DataTable dataTable = new DataTable();
                adapter.Fill(dataTable);
                if (dataTable.Rows.Count > 0)
                {
                    str  = Conversions.ToString(dataTable.Rows[0]["MBKORISNIK"]);
                    str2 = Conversions.ToString(dataTable.Rows[0]["MBKORISNIKJEDINICA"]);
                    if (str2.Length > 3)
                    {
                        str2 = str2.Substring(0, 3);
                    }
                }
                sp_diskete_za_bankuDataAdapter adapter2 = new sp_diskete_za_bankuDataAdapter();
                sp_diskete_za_bankuDataSet     dataSet  = new sp_diskete_za_bankuDataSet();
                adapter2.Fill(dataSet, this.sifraObracuna, this.VBDI);
                int count = dataSet.Tables[0].Rows.Count;
                if (dataSet.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Ne postoje isplate za PBZ banku");
                    return(flag);
                }
                decimal      num3    = DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Compute("Sum(UKUPNOZAISPLATU)", "")));
                StreamWriter writer  = new StreamWriter(NazivDatoteke, false, Encoding.ASCII);
                StreamWriter writer2 = writer;
                writer2.Write("0");
                writer2.Write(DB.IzvuciSamoBrojke(this.Ziro, true).PadRight(0x11));
                writer2.Write(DB.IzvuciSamoBrojke(this.ModelZaduzenja.Text, true).PadRight(2));
                writer2.Write(this.PozivNaBrojZaduzenja.Text.PadRight(0x16));
                writer2.Write(new string(' ', 3));
                writer2.Write("\r\n");
                writer2.Write("9");
                writer2.Write("1");
                writer2.Write(DB.BrojVodeceNule(count, 5, 0, false, ""));
                writer2.Write(DB.BrojVodeceNule(num3, 13, 2, false, ""));
                writer2.Write(RuntimeHelpers.GetObjectValue(Interaction.IIf(this.ultraDatumUplate.Text.Trim() == "", "      ", Conversions.ToDate(this.ultraDatumUplate.Value).ToString("ddMMyyyy"))));
                writer2.Write(DB.BrojVodeceNule(str, 8, 0, false, ""));
                writer2.Write(new string(' ', 7));
                writer2.Write("\r\n");
                int num4 = 0;
                try
                {
                    enumerator = dataSet.Tables[0].Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        vBroj++;
                        writer2.Write("1");
                        writer2.Write(DB.BrojVodeceNule(vBroj, 5, 0, false, ""));
                        writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["TEKUCI"])), 10, 0, false, ""));
                        writer2.Write(Strings.Space(1));
                        writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["UKUPNOZAISPLATU"])), 13, 2, false, ""));
                        writer2.Write(new string(' ', 13));
                        writer2.Write("\r\n");
                        num4++;
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                writer2 = null;
                writer.Close();
                flag = true;
            }
            catch (System.Exception exception1)
            {
                throw exception1;

                //Interaction.MsgBox("Greška: ", MsgBoxStyle.OkOnly, null);
                //flag = false;
            }
            return(flag);
        }
Exemplo n.º 8
0
    private bool Datoteka_Splitska(string sDatoteka)
    {
        bool flag = false;

        try
        {
            IEnumerator    enumerator    = null;
            string         str           = "";
            SqlConnection  connection    = new SqlConnection(Configuration.ConnectionString);
            SqlCommand     selectCommand = new SqlCommand();
            SqlDataAdapter adapter       = new SqlDataAdapter(selectCommand);
            selectCommand.Connection  = connection;
            selectCommand.CommandText = "SELECT KORISNIK1NAZIV FROM KORISNIK WHERE IDKORISNIK = 1";
            selectCommand.CommandType = CommandType.Text;
            adapter = new SqlDataAdapter(selectCommand);
            DataTable dataTable = new DataTable();
            adapter.Fill(dataTable);
            if (dataTable.Rows.Count > 0)
            {
                str = Conversions.ToString(dataTable.Rows[0]["KORISNIK1NAZIV"]);
            }
            sp_diskete_za_bankuDataAdapter adapter2 = new sp_diskete_za_bankuDataAdapter();
            sp_diskete_za_bankuDataSet     dataSet  = new sp_diskete_za_bankuDataSet();
            int num3 = adapter2.Fill(dataSet, this.sifraObracuna, this.VBDI);
            if (dataSet.Tables[0].Rows.Count == 0)
            {
                MessageBox.Show("Ne postoje isplate za Splitsku banku");
                return(flag);
            }
            decimal      vBroj  = DB.N20(RuntimeHelpers.GetObjectValue(dataSet.Tables[0].Compute("Sum(UKUPNOZAISPLATU)", "")));
            StreamWriter writer = new StreamWriter(sDatoteka, false, Encoding.ASCII);
            writer.Write("ST");
            writer.Write(RuntimeHelpers.GetObjectValue(Interaction.IIf(this.udteDatumUplate.Text.Trim() == "", "      ", Conversions.ToDate(this.udteDatumUplate.Value).ToString("ddMMyy"))));
            writer.Write(DB.BrojVodeceNule(vBroj, 13, 2, false, ""));
            writer.Write("\r\n");
            writer.Write("ST");
            writer.Write(str.PadRight(0x19).Substring(0, 0x19));
            writer.Write("\r\n");
            int num2 = 0;
            try
            {
                enumerator = dataSet.Tables[0].Rows.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    DataRow current = (DataRow)enumerator.Current;
                    writer.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["TEKUCI"])), 11, 0, false, ""));
                    writer.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["UKUPNOZAISPLATU"])), 13, 2, false, ""));
                    writer.Write(" ");
                    writer.Write("\r\n");
                    num2++;
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
            writer.Close();
            flag = true;
        }
        catch (System.Exception exception1)
        {
            throw exception1;

            //Interaction.MsgBox("Greška", MsgBoxStyle.OkOnly, null);
            //flag = false;
        }
        return(flag);
    }
Exemplo n.º 9
0
        private bool Datoteka_HPB(string strNazivDatoteke)
        {
            bool flag = false;

            try
            {
                IEnumerator    enumerator    = null;
                string         str2          = "0";
                string         str3          = "0";
                string         str           = "";
                SqlConnection  connection    = new SqlConnection(Configuration.ConnectionString);
                SqlCommand     selectCommand = new SqlCommand();
                SqlDataAdapter adapter4      = new SqlDataAdapter(selectCommand);
                selectCommand.Connection = connection;
                KORISNIKDataSet dataSet = new KORISNIKDataSet();
                new KORISNIKDataAdapter().Fill(dataSet);
                str2 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["MBKORISNIK"]);
                str3 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["MBKORISNIKJEDINICA"]);
                if (str3.Length > 3)
                {
                    str3 = str3.Substring(0, 3);
                }
                VIRMANIDataAdapter   adapter3 = new VIRMANIDataAdapter();
                Placa.VIRMANIDataSet set      = new Placa.VIRMANIDataSet();
                adapter3.FillBySIFRAOBRACUNAVIRMAN(set, this.SifraObracuna);
                str = Conversions.ToString(set.VIRMANI.Rows[0]["brojracunapla"]);
                sp_diskete_za_bankuDataAdapter adapter = new sp_diskete_za_bankuDataAdapter();
                sp_diskete_za_bankuDataSet     set3    = new sp_diskete_za_bankuDataSet();
                int num2 = adapter.Fill(set3, this.SifraObracuna, this.vbdiBanke);
                if (set3.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("Ne postoje isplate za HPB banku!");
                    return(flag);
                }
                decimal      vBroj   = Conversions.ToDecimal(set3.Tables[0].Compute("Sum(UKUPNOZAISPLATU)", ""));
                StreamWriter writer  = new StreamWriter(strNazivDatoteke, false, Encoding.ASCII);
                StreamWriter writer2 = writer;
                writer2.Write("98");
                writer2.Write(new string(' ', 0x77));
                writer2.Write("0");
                writer2.Write("\r\n");
                writer2.Write("94");
                writer2.Write(str.PadRight(0x15));
                writer2.Write(RuntimeHelpers.GetObjectValue(Interaction.IIf(this.DatumUplate.Text.Trim() == "", "      ", Conversions.ToDate(this.DatumUplate.Value).ToString("ddMMyy"))));
                writer2.Write(RuntimeHelpers.GetObjectValue(Interaction.IIf(this.DatumUplate.Text.Trim() == "", "      ", Conversions.ToDate(this.DatumUplate.Value).ToString("ddMMyy"))));
                writer2.Write(DB.BrojVodeceNule(vBroj, 13, 2, false, ""));
                writer2.Write(new string('0', 60));
                writer2.Write(new string(' ', 11));
                writer2.Write("0");
                writer2.Write("\r\n");
                int num3 = 0;
                try
                {
                    enumerator = set3.Tables[0].Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        writer2.Write("070000011");
                        writer2.Write("2");
                        writer2.Write(new string(' ', 10));
                        writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["TEKUCI"])), 11, 0, false, ""));
                        writer2.Write(DB.BrojVodeceNule(DB.N20(RuntimeHelpers.GetObjectValue(current["UKUPNOZAISPLATU"])), 9, 2, false, ""));
                        writer2.Write(RuntimeHelpers.GetObjectValue(Interaction.IIf(this.DatumUplate.Text.Trim() == "", "      ", Conversions.ToDate(this.DatumUplate.Value).ToString("ddMMyy"))));
                        writer2.Write(new string(' ', 0x49));
                        writer2.Write("0");
                        writer2.Write("\r\n");
                        num3++;
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                writer2.Write("99");
                writer2.Write(new string(' ', 0x77));
                writer2.Write("0");
                writer2.Write("\r\n");
                writer2.Close();
                writer2 = null;
                flag    = true;
            }
            catch (System.Exception exception1)
            {
                throw exception1;

                //Interaction.MsgBox("Greška: ", MsgBoxStyle.OkOnly, null);
                //flag = false;
            }
            return(flag);
        }