コード例 #1
0
        public decimal MakeJulDate(short vintDay, short vintMonth, short vintYear, short nvintHour = 0, short nvintMinute = 0, short nvintSecond = 0, short nvintMilliSec = 0)
        {
            string dstrRefString = Support.Format(vintDay, "00\\.") + Support.Format(vintMonth, "00\\.") + Support.Format(vintYear, "0000\\ ") + Support.Format(nvintHour, "00\\:") + Support.Format(nvintMinute, "00\\:") + Support.Format(nvintSecond, "00");
            string dstrInpString = Conversions.ToString(DateTime.FromOADate(DateAndTime.DateSerial(vintYear, vintMonth, vintDay).ToOADate() + DateAndTime.TimeSerial(nvintHour, nvintMinute, nvintSecond).ToOADate()));

            if (Operators.CompareString(Support.Format(dstrInpString, "dd\\.mm\\.yyyy\\ hh\\:nn\\:ss"), dstrRefString, TextCompare: false) != 0)
            {
                Information.Err().Raise(50000, "UtilTime", "Der Datumswert ist ungültig.");
            }
            else
            {
                if (!(nvintMilliSec < 0 || nvintMilliSec > 999))
                {
                    JULDATE_LONG dtypJulDateLng = default(JULDATE_LONG);
                    dtypJulDateLng.jdDays = InternGetJulDays(vintDay, vintMonth, vintYear);
                    dtypJulDateLng.jdTime = InternCalcJulTime(nvintHour, nvintMinute, nvintSecond, nvintMilliSec);
                    JULDATE_CURRENCY dtypJulDateCur = InternJulDatLngToJulDateCur(dtypJulDateLng);
                    return(dtypJulDateCur.jdCompl);
                }
                Information.Err().Raise(50000, "UtilTime", "Millisekunden außerhalb des Gültigkeitsbereiches.");
            }
            decimal MakeJulDate = default(decimal);

            return(MakeJulDate);
        }
コード例 #2
0
        public static DateTime FirstOfMonth(DateTime dato)
        {
            DateTime res = dato;

            res = DateAndTime.DateSerial(dato.Year, dato.Month, 1);
            return(res);
        }
コード例 #3
0
    private void AzurirajDatumObracunaStaza(object sender, EventArgs e)
    {
        bool flag = false;

        if (Operators.ConditionalCompareObjectEqual(this.datumobracunastaza.Value, DateAndTime.DateSerial(0x7d0, 1, 1), false))
        {
            flag = true;
        }
        if (((decimal.Compare(DB.N20(RuntimeHelpers.GetObjectValue(this.godinaobracuna.Value)), decimal.Zero) > 0) & (decimal.Compare(DB.N20(RuntimeHelpers.GetObjectValue(this.mjesecobracuna.Value)), decimal.Zero) > 0)) && ((DateTime.Compare(DateTime.Parse(Conversions.ToString(this.datumobracunastaza.Value)), DateAndTime.DateSerial(Conversions.ToInteger(this.godinaobracuna.Value), Conversions.ToInteger(this.mjesecobracuna.Value), DateTime.DaysInMonth(Conversions.ToInteger(this.godinaobracuna.Value), 1))) < 0) | (DateTime.Compare(DateTime.Parse(Conversions.ToString(this.datumobracunastaza.Value)), DateAndTime.DateSerial(Conversions.ToInteger(this.godinaobracuna.Value), Conversions.ToInteger(this.mjesecobracuna.Value), DateTime.DaysInMonth(Conversions.ToInteger(this.godinaobracuna.Value), Conversions.ToInteger(this.mjesecobracuna.Value)))) > 0)))
        {
            flag = true;
        }
        if (flag)
        {
            try
            {
                this.datumobracunastaza.Value = DateAndTime.DateSerial(Conversions.ToInteger(this.godinaobracuna.Value), Conversions.ToInteger(this.mjesecobracuna.Value), 1);
                this.datumobracunastaza.Value = DateAndTime.DateAdd(DateInterval.Day, -1.0, Conversions.ToDate(this.datumobracunastaza.Value));
            }
            catch (System.Exception exception1)
            {
                throw exception1;
            }
        }
    }
コード例 #4
0
        public void Puni()
        {
            this.ListBox1.Items.Clear();
            int num = 1;

            do
            {
                if (Information.IsDate(Conversions.ToString(num) + "/" + Conversions.ToString(this.mjesec) + "/" + Conversions.ToString(this.godina)))
                {
                    string str = string.Empty;
                    if (DateAndTime.DateSerial(this.godina, this.mjesec, num).DayOfWeek == DayOfWeek.Friday)
                    {
                        str = "Petak";
                    }
                    else if (DateAndTime.DateSerial(this.godina, this.mjesec, num).DayOfWeek == DayOfWeek.Monday)
                    {
                        str = "Ponedjeljak";
                    }
                    else if (DateAndTime.DateSerial(this.godina, this.mjesec, num).DayOfWeek == DayOfWeek.Saturday)
                    {
                        str = "Subota";
                    }
                    else if (DateAndTime.DateSerial(this.godina, this.mjesec, num).DayOfWeek == DayOfWeek.Sunday)
                    {
                        str = "Nedjelja";
                    }
                    else if (DateAndTime.DateSerial(this.godina, this.mjesec, num).DayOfWeek == DayOfWeek.Thursday)
                    {
                        str = "Cetvrtak";
                    }
                    else if (DateAndTime.DateSerial(this.godina, this.mjesec, num).DayOfWeek == DayOfWeek.Tuesday)
                    {
                        str = "Utorak";
                    }
                    else if (DateAndTime.DateSerial(this.godina, this.mjesec, num).DayOfWeek == DayOfWeek.Wednesday)
                    {
                        str = "Srijeda";
                    }
                    if (str == "Subota")
                    {
                        if (!this.subote.Checked)
                        {
                            this.ListBox1.Items.Add(Conversions.ToString(num) + "-" + str);
                        }
                    }
                    else if (str == "Nedjelja")
                    {
                        if (!this.nedjelje.Checked)
                        {
                            this.ListBox1.Items.Add(Conversions.ToString(num) + "-" + str);
                        }
                    }
                    else
                    {
                        this.ListBox1.Items.Add(Conversions.ToString(num) + "-" + str);
                    }
                }
                num++;
            }while (num <= 0x1f);
        }
コード例 #5
0
    private void frmIdentifikator_Load(object sender, EventArgs e)
    {
        S_OS_BROJ_I_DATUMDataAdapter adapter = new S_OS_BROJ_I_DATUMDataAdapter();
        S_OS_BROJ_I_DATUMDataSet     dataSet = new S_OS_BROJ_I_DATUMDataSet();

        adapter.Fill(dataSet);
        SqlCommand    command    = new SqlCommand();
        SqlConnection connection = new SqlConnection();

        command.CommandType         = CommandType.Text;
        command.CommandText         = "SELECT MAX(OSDATUMDOK) FROM OSTEMELJNICA WHERE IDOSDOKUMENT = 2 and osbrojdokumenta > 0";
        connection.ConnectionString = Mipsed7.Core.ApplicationDatabaseInformation.ConnectionString;
        command.Connection          = connection;
        connection.Open();
        SqlDataReader reader = command.ExecuteReader();

        try
        {
            reader.Read();

            DateTime dateTime = reader.GetDateTime(0);
            this.ODDATUMA.Value = dateTime.AddDays(1.0);
            this.DODATUMA.Value = dateTime.AddYears(1);
        }
        catch (System.Exception)
        {
            this.ODDATUMA.Value = DateAndTime.DateSerial(DateTime.Now.Year, 1, 1);
            this.DODATUMA.Value = DateAndTime.DateSerial(DateTime.Now.Year, 12, 31);
        }

        connection.Close();
        this.BROJTEMELJNICE.Value = RuntimeHelpers.GetObjectValue(Interaction.IIf(Information.IsDBNull(RuntimeHelpers.GetObjectValue(dataSet.S_OS_BROJ_I_DATUM.Rows[0]["BROJDOK"])), 1, RuntimeHelpers.GetObjectValue(dataSet.S_OS_BROJ_I_DATUM.Rows[0]["BROJDOK"])));
        InfraCustom.PostaviSelectAllSvimEditKontrolama(this);
        InfraCustom.PostaviEnterUTabSvimEditKontrolama(this);
    }
コード例 #6
0
 private void frmUnosPodatakaOObracunu_Load(object sender, EventArgs e)
 {
     //_load = true;--> OVO IDE TEK SA 1.1.2017
     this.Podaci_o_zadnjem_Obracunu();
     this.datumobracunastaza.Value = DateAndTime.DateSerial(0x7d0, 1, 1);
     this.AzurirajDatumObracunaStaza(null, null);
     //_load = false;--> OVO IDE TEK SA 1.1.2017
 }
コード例 #7
0
    private void DataGridView2_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e)
    {
        DataGridViewRow row = e.Row;

        row.Cells["obriznos"].Value           = 0;
        row.Cells["obrsatnica"].Value         = 0;
        row.Cells["obrpostotak"].Value        = 0;
        row.Cells["obrsati"].Value            = 0;
        row.Cells["elementrazdobljeod"].Value = DateAndTime.DateSerial(Conversions.ToInteger(this.godina), Conversions.ToInteger(this.mjesec) - 1, 1);
        row.Cells["elementrazdobljedo"].Value = DateAndTime.DateSerial(Conversions.ToInteger(this.godina), Conversions.ToInteger(this.mjesec) - 1, DateTime.DaysInMonth(Conversions.ToInteger(this.godina), Conversions.ToInteger(this.mjesec) - 1));
        row = null;
    }
コード例 #8
0
        public DateTime CprnrToDate(string cprnr)
        {
            DateTime res  = default(DateTime);
            int      dd   = 1;
            int      mm   = 1;
            int      yy   = 0;
            int      year = 1900;
            int      lbnr = 0;

            if (cprnr.Length == 11)
            {
                dd   = Funktioner.ToInt(cprnr.Substring(0, 2));
                mm   = Funktioner.ToInt(cprnr.Substring(2, 2));
                yy   = Funktioner.ToInt(cprnr.Substring(4, 2));
                lbnr = Funktioner.ToInt(cprnr.Substring(7, 4));
                if (lbnr <= 3999)
                {
                    year = 1900;
                }
                else if (lbnr >= 5000 & lbnr <= 8999)
                {
                    if (yy <= 57)
                    {
                        year = 2000;
                    }
                    else
                    {
                        year = 1800;
                    }
                }
                else if ((lbnr >= 4000 & lbnr <= 4999) || (lbnr >= 9000 & lbnr <= 9999))
                {
                    if (yy <= 36)
                    {
                        year = 2000;
                    }
                    else
                    {
                        year = 1900;
                    }
                }
            }
            res = DateAndTime.DateSerial(yy + year, mm, dd);

            return(res);
        }
コード例 #9
0
        public static string ToSqlDateTime(object Value)
        {
            string   res = "";
            DateTime dtg = default(DateTime);

            dtg = ToDateDef(Value);
            if (dtg == new DateTime(2018, 8, 6))
            {
                res = "";
            }
            else if (dtg != new DateTime(1754, 1, 1))
            {
                res = dtg.ToString("yyyy-MM-dd");
                if (DateAndTime.DateDiff(DateInterval.Second, dtg, DateAndTime.DateSerial(DateAndTime.Year(dtg), DateAndTime.Month(dtg), DateAndTime.Day(dtg))) != 0)
                {
                    res += " ";
                    res  = dtg.ToString("T");
                }
            }
            return(res.Trim());
        }
コード例 #10
0
        private DateTime InternGetGregDate(int lngJulDat)
        {
            object dvarJulDate = decimal.Add(new decimal(lngJulDat), 1m);
            object dvarA;

            if (Operators.ConditionalCompareObjectLess(dvarJulDate, new decimal(2299161L), TextCompare: false))
            {
                dvarA = Conversions.ToDecimal(dvarJulDate);
            }
            else
            {
                object varALPHA = new decimal(Conversion.Int(Convert.ToDouble(Conversions.ToDecimal(Operators.SubtractObject(dvarJulDate, 1867216.25))) / 36524.25));
                dvarA = Conversions.ToDecimal(Operators.SubtractObject(Operators.AddObject(Operators.AddObject(dvarJulDate, 1), varALPHA), Conversions.ToDecimal(Conversion.Int(Operators.DivideObject(varALPHA, 4)))));
            }
            object varB     = Conversions.ToDecimal(Operators.AddObject(dvarA, 1524));
            object varC     = new decimal(Conversion.Int(Convert.ToDouble(Conversions.ToDecimal(Operators.SubtractObject(varB, 122.1))) / 365.25));
            object dvarD    = Conversion.Int(decimal.Divide(Conversions.ToDecimal(Operators.MultiplyObject(1461, varC)), new decimal(4L)));
            object varE     = new decimal(Conversion.Int(Convert.ToDouble(Conversions.ToDecimal(Operators.SubtractObject(varB, dvarD))) / 30.6001));
            object varDay   = Conversion.Int(decimal.Subtract(decimal.Subtract(Conversions.ToDecimal(Operators.SubtractObject(varB, dvarD)), Conversions.ToDecimal(Conversion.Int(Operators.MultiplyObject(30.6001, varE)))), 1m));
            object varMonth = (!Operators.ConditionalCompareObjectLess(varE, 13.5m, TextCompare: false)) ? ((object)Conversions.ToDecimal(Operators.SubtractObject(varE, 13))) : ((object)Conversions.ToDecimal(Operators.SubtractObject(varE, 1)));
            object varYear  = (!Operators.ConditionalCompareObjectGreater(varMonth, 2.5m, TextCompare: false)) ? ((object)Conversions.ToDecimal(Operators.SubtractObject(varC, 4715))) : ((object)Conversions.ToDecimal(Operators.SubtractObject(varC, 4716)));

            return(checked (DateAndTime.DateSerial((int)Conversion.Int(Conversions.ToDouble(varYear)), (int)Conversion.Int(Conversions.ToDouble(varMonth)), (int)Conversion.Int(Conversions.ToDouble(varDay)))));
        }
コード例 #11
0
        public void id2011Command(object sender, EventArgs e)
        {
            dsIdObrazac obrazac = new dsIdObrazac();
            sp_id_detaljiDataAdapter   adapter2 = new sp_id_detaljiDataAdapter();
            sp_id_zaglavljeDataAdapter adapter3 = new sp_id_zaglavljeDataAdapter();
            sp_id_detaljiDataSet       dataSet  = new sp_id_detaljiDataSet();
            sp_id_zaglavljeDataSet     set3     = new sp_id_zaglavljeDataSet();
            SqlConnection connection            = new SqlConnection();
            string        str2 = null;
            string        str  = null;

            connection.ConnectionString = Mipsed7.Core.ApplicationDatabaseInformation.ConnectionString;
            frmPregledMjeseciGodina godina = new frmPregledMjeseciGodina();

            godina.ShowDialog();
            if (godina.DialogResult != DialogResult.Cancel)
            {
                decimal num  = 0;
                decimal num2 = 0;
                sPorezIprirezPremaOpciniGraduObracunatiPorez[] porezArray = null;
                decimal num3 = 0;
                if ((godina.OdabraniGodinaIsplate != null) & (godina.OdabraniMjesecIsplate != null))
                {
                    set3.Clear();
                    dataSet.Clear();
                    str2 = Conversions.ToString(godina.OdabraniMjesecIsplate);
                    str  = Conversions.ToString(godina.OdabraniGodinaIsplate);
                    adapter3.Fill(set3, null, Conversions.ToString(godina.OdabraniMjesecIsplate), Conversions.ToString(godina.OdabraniGodinaIsplate), godina.Volonteri);
                    adapter2.Fill(dataSet, null, Conversions.ToString(godina.OdabraniMjesecIsplate), Conversions.ToString(godina.OdabraniGodinaIsplate), godina.Volonteri);
                    obrazac.Clear();
                    obrazac.Merge(dataSet.sp_id_detalji);
                    obrazac.Merge(set3.sp_id_zaglavlje);
                }
                KORISNIKDataAdapter adapter = new KORISNIKDataAdapter();
                KORISNIKDataSet     set2    = new KORISNIKDataSet();
                adapter.Fill(set2);

                sObrazacID    o           = new sObrazacID();
                sIDmetapodaci dmetapodaci = new sIDmetapodaci();

                dmetapodaci.Naslov       = new sNaslovTemeljni();
                dmetapodaci.Naslov.Value = "ID obrazac";
                dmetapodaci.Naslov.dc    = "http://purl.org/dc/elements/1.1/title";

                dmetapodaci.Autor       = new sAutorTemeljni();
                dmetapodaci.Autor.Value = "VugerGRAD d.o.o.";
                dmetapodaci.Autor.dc    = "http://purl.org/dc/elements/1.1/creator";

                dmetapodaci.Datum       = new sDatumTemeljni();
                dmetapodaci.Datum.Value = DateAndTime.Now.ToString("s");
                dmetapodaci.Datum.dc    = "http://purl.org/dc/elements/1.1/date";

                dmetapodaci.Format       = new sFormatTemeljni();
                dmetapodaci.Format.Value = PlacaExe.tFormat.textxml;
                dmetapodaci.Format.dc    = "http://purl.org/dc/elements/1.1/format";

                dmetapodaci.Jezik       = new sJezikTemeljni();
                dmetapodaci.Jezik.Value = PlacaExe.tJezik.hrHR;
                dmetapodaci.Jezik.dc    = "http://purl.org/dc/elements/1.1/language";

                dmetapodaci.Identifikator       = new sIdentifikatorTemeljni();
                dmetapodaci.Identifikator.Value = Guid.NewGuid().ToString(); //"dc0e2097-c43b-41f3-a095-dcf327268fad";
                dmetapodaci.Identifikator.dc    = "http://purl.org/dc/elements/1.1/identifier";

                dmetapodaci.Uskladjenost       = new sUskladjenost();
                dmetapodaci.Uskladjenost.Value = "ObrazacID-v3-0";
                dmetapodaci.Uskladjenost.dc    = "http://purl.org/dc/terms/conformsTo";

                dmetapodaci.Tip       = new sTipTemeljni();
                dmetapodaci.Tip.Value = PlacaExe.tTip.Elektroničkiobrazac;
                dmetapodaci.Tip.dc    = "http://purl.org/dc/elements/1.1/type";

                dmetapodaci.Adresant       = new sAdresantTemeljni();
                dmetapodaci.Adresant.Value = "Ministarstvo Financija, Porezna uprava, Zagreb";


                o.verzijaSheme = "3.0";
                o.Metapodaci   = dmetapodaci;
                sZaglavlje zaglavlje = new sZaglavlje();
                sZaglavljePodnositeljZahtjeva zahtjeva = new sZaglavljePodnositeljZahtjeva();
                sAdresa    adresa    = new sAdresa();
                sRazdoblje razdoblje = new sRazdoblje();

                zahtjeva.Naziv = Conversions.ToString(set2.KORISNIK[0]["KORISNIK1NAZIV"]);
                zahtjeva.OIB   = Conversions.ToString(set2.KORISNIK[0]["KORISNIKOIB"]);

                try
                {
                    adresa.Ulica = set2.KORISNIK[0]["KORISNIK1ADRESA"].ToString().Replace(DB.IzvuciSamoBrojke(set2.KORISNIK[0]["KORISNIK1ADRESA"].ToString(), false), "");
                }
                catch (Exception)
                {
                    throw new Exception("Problem u izvlačenju brojčanog kućnog broja iz ulice!");
                }

                adresa.Broj     = DB.IzvuciSamoBrojke(set2.KORISNIK[0]["KORISNIK1ADRESA"].ToString(), false);
                adresa.Mjesto   = Conversions.ToString(set2.KORISNIK[0]["KORISNIK1MJESTO"]);
                zahtjeva.Adresa = adresa;
                zaglavlje.PodnositeljZahtjeva = zahtjeva;
                zaglavlje.PodrucniUred        = Conversions.ToString(set2.KORISNIK[0]["NADLEZNAPU"]);
                if (Operators.ConditionalCompareObjectEqual(obrazac.sp_id_zaglavlje[0]["identifikator"], 1, false))
                {
                    zaglavlje.Identifikator = sIdentifikator.Item1;
                }
                if (Operators.ConditionalCompareObjectEqual(obrazac.sp_id_zaglavlje[0]["identifikator"], 11, false))
                {
                    zaglavlje.Identifikator = sIdentifikator.Item12;
                }
                zaglavlje.Ispostava = Conversions.ToString(set2.KORISNIK[0]["BROJCANAOZNAKAPU"]);
                razdoblje.DatumOd   = DateAndTime.DateSerial(Conversions.ToInteger(str), Conversions.ToInteger(str2), 1);
                razdoblje.DatumDo   = DateAndTime.DateSerial(Conversions.ToInteger(str), Conversions.ToInteger(str2), DateTime.DaysInMonth(Conversions.ToInteger(str), Conversions.ToInteger(str2)));
                zaglavlje.Razdoblje = razdoblje;
                o.Zaglavlje         = zaglavlje;
                sIsplaceniPrimiciIObracunPoreza poreza = new sIsplaceniPrimiciIObracunPoreza();
                sTijelo tijelo = new sTijelo();
                poreza.Podatak100 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_1"]), 2);
                poreza.Podatak200 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_2"]), 2);
                poreza.Podatak210 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_2_1_1"]), 2);
                poreza.Podatak220 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_2_1_2"]), 2);
                poreza.Podatak230 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_2_1_3"]), 2);
                poreza.Podatak300 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_3"]), 2);
                poreza.Podatak400 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_4"]), 2);
                poreza.Podatak500 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_5"]), 2);
                poreza.Podatak600 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_6"]), 2);
                poreza.Podatak610 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_6_1"]), 2);
                poreza.Podatak620 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_6_2"]), 2);
                poreza.Podatak700 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_II_7"]), 2);
                poreza.Podatak800 = Conversions.ToString(obrazac.sp_id_zaglavlje[0]["REDAK_II_8"]);
                sDoprinosiUkupno ukupno = new sDoprinosiUkupno {
                    Podatak110 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_III_1_1"]), 2),
                    Podatak120 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_III_1_2"]), 2),
                    Podatak210 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_III_2_1"]), 2),
                    Podatak220 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_III_2_2"]), 2),
                    Podatak310 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_III_3_1"]), 2),
                    Podatak320 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_III_3_2"]), 2),
                    Podatak330 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_III_3_3"]), 2),
                    Podatak410 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_III_4_1"]), 2),
                    Podatak420 = decimal.Round(Conversions.ToDecimal(obrazac.sp_id_zaglavlje[0]["REDAK_III_4_2"]), 2),
                    Podatak500 = Conversions.ToString(obrazac.sp_id_zaglavlje[0]["REDAK_III_5"])
                };
                porezArray = (sPorezIprirezPremaOpciniGraduObracunatiPorez[])Utils.CopyArray((Array)porezArray, new sPorezIprirezPremaOpciniGraduObracunatiPorez[obrazac.sp_id_detalji.Rows.Count + 1]);
                int num5 = obrazac.sp_id_detalji.Rows.Count - 1;
                for (int i = 0; i <= num5; i++)
                {
                    porezArray[i] = new sPorezIprirezPremaOpciniGraduObracunatiPorez();
                    sPorezIprirezPremaOpciniGraduObracunatiPorez porez = porezArray[i];
                    porez.Poreza  = Conversions.ToDecimal(obrazac.sp_id_detalji.Rows[i]["obracunaniporez"]);
                    num           = Conversions.ToDecimal(Operators.AddObject(num, obrazac.sp_id_detalji.Rows[i]["obracunaniporez"]));
                    porez.Prireza = Conversions.ToDecimal(obrazac.sp_id_detalji.Rows[i]["obracunaniprirez"]);
                    num2          = Conversions.ToDecimal(Operators.AddObject(num2, obrazac.sp_id_detalji.Rows[i]["obracunaniprirez"]));
                    porez.Ukupno  = Conversions.ToDecimal(obrazac.sp_id_detalji.Rows[i]["obracunanoukupno"]);
                    num3          = Conversions.ToDecimal(Operators.AddObject(num3, obrazac.sp_id_detalji.Rows[i]["obracunanoukupno"]));
                    porez.Sifra   = Conversions.ToString(obrazac.sp_id_detalji.Rows[i]["idopcine"]);
                    porez         = null;
                }
                sUkupno ukupno2 = new sUkupno {
                    Poreza  = num,
                    Prireza = num2,
                    Ukupno  = num3
                };
                tijelo.IsplaceniPrimiciIObracunPoreza = poreza;
                tijelo.DoprinosiUkupno  = ukupno;
                tijelo.ObracunatiPorezi = porezArray;
                tijelo.Ukupno           = ukupno2;
                o.Tijelo = tijelo;
                try
                {
                    SaveFileDialog dialog2 = new SaveFileDialog {
                        InitialDirectory = Conversions.ToString(0),
                        FileName         = "ID-" + str + "-" + str2 + ".xml",
                        RestoreDirectory = true
                    };
                    SaveFileDialog dialog = dialog2;
                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        using (TextWriter writer = new StreamWriter(dialog.FileName))
                        {
                            XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
                            namespaces.Add("", "http://e-porezna.porezna-uprava.hr/sheme/zahtjevi/ObrazacID/v3-0");
                            new XmlSerializer(typeof(sObrazacID), "http://e-porezna.porezna-uprava.hr/sheme/zahtjevi/ObrazacID/v3-0").Serialize(writer, o, namespaces);

                            writer.Close();
                        }
                        Interaction.MsgBox("Datoteka uspješno  spremljena u: " + dialog.FileName, MsgBoxStyle.OkOnly, null);
                    }
                }
                catch (System.Exception exception1)
                {
                    throw exception1;
                }
            }
        }
コード例 #12
0
ファイル: Functions.cs プロジェクト: epoulsen/formula-parser
 public static DateTime DateSerial(int Year, int Month, int Day)
 {
     return(DateAndTime.DateSerial(Year, Month, Day));
 }
コード例 #13
0
        public void Izradi_er1()
        {
            Microsoft.Office.Interop.Word.Application application = new Microsoft.Office.Interop.Word.ApplicationClass();
            Microsoft.Office.Interop.Word.Document    document    = new Microsoft.Office.Interop.Word.DocumentClass();


            try
            {
                decimal     num2       = 0;
                decimal     num9       = 0;
                decimal     num10      = 0;
                decimal     num5       = 0;
                decimal     num6       = 0;
                decimal     num7       = 0;
                decimal     num4       = 0;
                decimal     num8       = 0;
                IEnumerator enumerator = null;
                application.Visible = false;

                object temp = System.Reflection.Missing.Value;

                object confirmConversions = true;
                object readOnly           = true;

                object path = System.Windows.Forms.Application.StartupPath + @"\App_Data\Potvrda_o_placi.doc";

                document = application.Documents.Open(ref path, ref confirmConversions, ref readOnly, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp);

                document.ActiveWindow.View.ReadingLayout = false;

                KORISNIKDataSet dataSet = new KORISNIKDataSet();
                new KORISNIKDataAdapter().Fill(dataSet);
                document.Fields[1].Result.Text = Conversions.ToString(dataSet.KORISNIK.Rows[0]["KORISNIK1NAZIV"]);


                int startIndex = 0;
                do
                {
                    // Veličina ovog polja u bazi je 11 mjesta, ali se očito kod korisnika dešava da imaju po 10 mjesta
                    if (dataSet.KORISNIK.Rows[0]["KORISNIK1HZZO"].ToString().Length > startIndex)
                    {
                        document.Fields[2 + startIndex].Result.Text = dataSet.KORISNIK.Rows[0]["KORISNIK1HZZO"].ToString().Substring(startIndex, 1);
                    }

                    startIndex++;
                }while (startIndex <= 10);

                document.Fields[13].Result.Text = Conversions.ToString(this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows[0]["PREZIME"]);
                document.Fields[14].Result.Text = Conversions.ToString(this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows[0]["IME"]);

                startIndex = 0;
                do
                {
                    document.Fields[15 + startIndex].Result.Text = this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows[0]["jmbg"].ToString().Substring(startIndex, 1);
                    startIndex++;
                }while (startIndex <= 3);

                document.Fields[0x13].Result.Text = "1";
                try
                {
                    document.Fields[20].Result.Text   = this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows[0]["jmbg"].ToString().Substring(4, 1);
                    document.Fields[0x15].Result.Text = this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows[0]["jmbg"].ToString().Substring(5, 1);
                    document.Fields[0x16].Result.Text = this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows[0]["jmbg"].ToString().Substring(6, 1);
                }
                catch (Exception) { }

                startIndex = 0;
                do
                {
                    document.Fields[0x17 + startIndex].Result.Text = this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows[0]["OIB"].ToString().Substring(startIndex, 1);
                    startIndex++;
                }while (startIndex <= 10);

                string str = DB.N2T(RuntimeHelpers.GetObjectValue(this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows[0]["BROJZDRAVSTVENOG"]), "");
                if (str.Trim() != "")
                {
                    startIndex = 0;
                    do
                    {
                        if (str.Length > startIndex)
                        {
                            document.Fields[0x22 + startIndex].Result.Text = str.Substring(startIndex, 1);
                        }

                        startIndex++;
                    }while (startIndex <= 10);
                }

                startIndex = 0;
                do
                {
                    document.Fields[34 + startIndex].Result.Text = this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows[0]["jmbg"].ToString().Substring(startIndex, 1);
                    startIndex++;
                }while (startIndex <= 12);

                string   str3  = Conversions.ToString(this.UltraCombo1.Value);
                string   str2  = Conversions.ToString(this.UltraCombo2.Value);
                DateTime time  = DateAndTime.DateSerial(Conversions.ToInteger(str3.Substring(0, 4)), Conversions.ToInteger(str3.Substring(5, 2)), Conversions.ToInteger("1"));
                DateTime time2 = DateAndTime.DateSerial(Conversions.ToInteger(str2.Substring(0, 4)), Conversions.ToInteger(str2.Substring(5, 2)), Conversions.ToInteger("1"));
                time  = time.AddMonths(1);
                time2 = time2.AddMonths(2).AddDays(-1.0);
                str3  = time.ToString("ddMMyyyy", CultureInfo.InvariantCulture);
                str2  = time2.ToString("ddMMyyyy", CultureInfo.InvariantCulture);

                startIndex = 0;
                do
                {
                    document.Fields[47 + startIndex].Result.Text = str3.Substring(startIndex, 1);
                    startIndex++;
                }while (startIndex <= 7);

                startIndex = 0;
                do
                {
                    document.Fields[55 + startIndex].Result.Text = str2.Substring(startIndex, 1);
                    startIndex++;
                }while (startIndex <= 7);

                int num = 63;
                try
                {
                    enumerator = this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows.GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        DataRow current = (DataRow)enumerator.Current;
                        document.Fields[num].Result.Text     = Conversions.ToString(Operators.AddObject(Operators.AddObject(current["mjesecobracuna"], "/"), current["godinaobracuna"]));
                        document.Fields[num + 1].Result.Text = string.Format("{0:#,##0.00}", RuntimeHelpers.GetObjectValue(current["ukupnobruto"]));
                        document.Fields[num + 2].Result.Text = string.Format("{0:#,##0.00}", RuntimeHelpers.GetObjectValue(current["netoplaca"]));
                        document.Fields[num + 3].Result.Text = string.Format("{0:#,##0.00}", RuntimeHelpers.GetObjectValue(current["kolona4"]));
                        document.Fields[num + 4].Result.Text = string.Format("{0:#,##0.00}", RuntimeHelpers.GetObjectValue(current["kolona5"]));
                        document.Fields[num + 5].Result.Text = string.Format("{0:#,##0.00}", RuntimeHelpers.GetObjectValue(current["kolona6"]));
                        document.Fields[num + 6].Result.Text = string.Format("{0:#,##0.00}", RuntimeHelpers.GetObjectValue(current["satiukupno"]));
                        document.Fields[num + 7].Result.Text = string.Format("{0:#,##0.00}", RuntimeHelpers.GetObjectValue(current["kolona8"]));
                        document.Fields[num + 8].Result.Text = string.Format("{0:#,##0.00}", RuntimeHelpers.GetObjectValue(current["fondmjeseca"]));
                        num  += 9;
                        num2  = Conversions.ToDecimal(Operators.AddObject(num2, current["ukupnobruto"]));
                        num9  = Conversions.ToDecimal(Operators.AddObject(num9, current["netoplaca"]));
                        num5  = Conversions.ToDecimal(Operators.AddObject(num5, current["kolona4"]));
                        num6  = Conversions.ToDecimal(Operators.AddObject(num6, current["kolona5"]));
                        num7  = Conversions.ToDecimal(Operators.AddObject(num7, current["kolona6"]));
                        num10 = Conversions.ToDecimal(Operators.AddObject(num10, current["satiukupno"]));
                        num8  = Conversions.ToDecimal(Operators.AddObject(num8, current["kolona8"]));
                        num4  = Conversions.ToDecimal(Operators.AddObject(num4, current["fondmjeseca"]));
                        if (((this.S_OD_BOLOVANJE_FONDDataSet1.S_OD_BOLOVANJE_FOND.Rows.Count * 9) + 63) == num)
                        {
                            document.Fields[117].Result.Text = string.Format("{0:#,##0.00}", num2);
                            document.Fields[118].Result.Text = string.Format("{0:#,##0.00}", num9);
                            document.Fields[119].Result.Text = string.Format("{0:#,##0.00}", num5);
                            document.Fields[120].Result.Text = string.Format("{0:#,##0.00}", num6);
                            document.Fields[121].Result.Text = string.Format("{0:#,##0.00}", num7);
                            document.Fields[122].Result.Text = string.Format("{0:#,##0.00}", num10);
                            document.Fields[123].Result.Text = string.Format("{0:#,##0.00}", num8);
                            document.Fields[124].Result.Text = string.Format("{0:#,##0.00}", num4);
                        }
                    }
                }
                finally
                {
                    if (enumerator is IDisposable)
                    {
                        (enumerator as IDisposable).Dispose();
                    }
                }
                if (decimal.Compare(num10, decimal.Zero) > 0)
                {
                    document.Fields[125].Result.Text = string.Format("{0:#,##0.00}", DB.RoundUpDecimale(decimal.Divide(num2, num10), 2));
                    document.Fields[126].Result.Text = string.Format("{0:#,##0.0000}", decimal.Divide(num9, num10), 2);
                }
                else
                {
                    document.Fields[125].Result.Text = string.Format("{0:#,##0.00}", 0);
                    document.Fields[126].Result.Text = string.Format("{0:#,##0.00}", 0);
                }
                document.Fields[127].Result.Text = Conversions.ToString(dataSet.KORISNIK.Rows[0]["korisnik1mjesto"]);
                document.Fields[128].Result.Text = Conversions.ToString(DateAndTime.Year(DateAndTime.Today)).Substring(2, 2);
                FolderBrowserDialog dialog  = new FolderBrowserDialog();
                SaveFileDialog      dialog2 = new SaveFileDialog
                {
                    InitialDirectory = @"C:\Desktop",
                    Filter           = "Word datoteke (*.doc)|*.doc|All files (*.*)|*.*",
                    FileName         = "Bolovanje_HZZO_Obrazac",
                    RestoreDirectory = true
                };
                dialog2.ShowDialog();

                SaveFileDialog dialog3  = dialog2;
                object         fileName = dialog3.FileName;
                document.SaveAs(ref fileName, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp, ref temp);
                dialog3.FileName = Conversions.ToString(fileName);
            }
            catch (Exception exception)
            {
                MessageBox.Show("Greška u generiranju izvještaja: 'Prosjek bolovanje/HZZO'!" + Environment.NewLine + "Molimo provjerite valjanost/postojanost podataka koji su potrebni za generiranje izvještaja.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Error);

                new Mipsed7.Emailing.SendException(exception);
            }
            finally
            {
                //document.Close(false, Missing.Value, Missing.Value);
                ((_Document)document).Close(false, Missing.Value, Missing.Value);

                //application.Quit(false, Missing.Value, Missing.Value);
                ((_Application)application).Quit(false, Missing.Value, Missing.Value);

                // za svaki slučaj
                if (document != null)
                {
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(document);
                }

                if (application != null)
                {
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(application);
                }

                // isprazni varijable
                document    = null;
                application = null;

                // force-amo GarbageCollector (za svaki slučaj)
                GC.Collect();

                this.Cursor = Cursors.Default;
            }
        }
コード例 #14
0
        /// <summary>
        /// Search card by card number
        /// </summary>
        /// <param name="cardNumber"></param>
        /// <param name="isLoyaltycard"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public Customer SearchCustomerCard(string cardNumber, bool isLoyaltycard, out MessageStyle message)
        {
            var dateStart = DateTime.Now;

            Performancelog.Debug(
                $"Start,CustomerManager,SearchCustomerCard,{string.Empty},{DateTime.Now:hh.mm.ss.ffffff}");

            Customer customer = null;
            string   strExp;
            string   strStatus;
            DateTime dExpiryDate;
            var      boolExpiredCard = false;
            var      blnFoundCst     = false;

            string tempAvoidedValuesString = "";
            var    crdNumber = EvaluateCardString(cardNumber, out message);

            if (!string.IsNullOrEmpty(message.Message))
            {
                return(null);
            }
            SqlQueryCheck(ref crdNumber, ref tempAvoidedValuesString);
            var strCustomerCode = GetCustomerBasedOnClientCard(crdNumber, out strExp, out strStatus, out dExpiryDate);

            if (!string.IsNullOrEmpty(strCustomerCode))
            {
                var offSet = _policyManager.LoadStoreInfo().OffSet;
                blnFoundCst = true;
                //To check card status
                if (strStatus != "V")
                {
                    switch (strStatus)
                    {
                    case "C":
                        message = _resourceManager.CreateMessage(offSet, 0, 1708, _resourceManager.GetResString(offSet, 1710),
                                                                 MessageType.OkOnly);
                        break;

                    case "D":
                        message = _resourceManager.CreateMessage(offSet, 0, 1708, _resourceManager.GetResString(offSet, 8158),
                                                                 MessageType.OkOnly);
                        break;

                    case "E":
                        message = _resourceManager.CreateMessage(offSet, 0, 1708, _resourceManager.GetResString(offSet, 1709),
                                                                 MessageType.OkOnly);
                        break;

                    default:
                        message = _resourceManager.CreateMessage(offSet, 0, 3884, null, MessageType.OkOnly);
                        break;
                    }
                    Performancelog.Debug(
                        $"End,CustomerManager,SearchCustomerCard,{DateTime.Now.Subtract(dateStart).TotalMilliseconds},{DateTime.Now:hh.mm.ss.ffffff}");
                    return(null);
                }
                customer    = _customerService.GetClientByClientCode(strCustomerCode);
                dExpiryDate = DateAndTime.DateSerial(int.Parse(Strings.Left(strExp, 2)),
                                                     int.Parse(Strings.Right(strExp, 2)), int.Parse("20"));
                WriteToLogFile("dExpiryDate set to " + Convert.ToString(dExpiryDate, CultureInfo.InvariantCulture));
                // enabled
                if (_policyManager.CUST_EXPDATE && dExpiryDate < DateAndTime.Today)
                {
                    message         = _resourceManager.CreateMessage(offSet, 0, 1708, dExpiryDate.ToString("yyMM"));
                    boolExpiredCard = true;
                    blnFoundCst     = false;
                }
            }

            if (!blnFoundCst && !boolExpiredCard)
            {
                var offSet = _policyManager.LoadStoreInfo().OffSet;
                message = isLoyaltycard
                    ? _resourceManager.CreateMessage(offSet, 16, 91, null, ExclamationOkMessageType)
                    : _resourceManager.CreateMessage(offSet, 0, 8119, cardNumber, OkMessageType);
            }
            Performancelog.Debug(
                $"End,CustomerManager,SearchCustomerCard,{DateTime.Now.Subtract(dateStart).TotalMilliseconds},{DateTime.Now:hh.mm.ss.ffffff}");
            return(customer);
        }
コード例 #15
0
 public static DateTime DatZavrsni(string godina, string mjesec)
 {
     return(DateAndTime.DateSerial(Conversions.ToInteger(godina), Conversions.ToInteger(mjesec), DateTime.DaysInMonth(Conversions.ToInteger(godina), Conversions.ToInteger(mjesec))));
 }
コード例 #16
0
 /// <summary>
 /// Returns a Date value representing a specified year, month, and day, with the time information set to midnight (00:00:00).
 /// </summary>
 /// <param name="year"></param>
 /// <param name="month"></param>
 /// <param name="day"></param>
 /// <returns></returns>
 public static DateTime DateSerial(int year, int month, int day)
 {
     return(DateAndTime.DateSerial(year, month, day));
 }
コード例 #17
0
ファイル: Utility.cs プロジェクト: joehosemann/BBSupportTasks
        public static bool ValidateCRNumber(string crNumber, ref string reasonForFailure)
        {
            int[] numArray = new int[3];
            crNumber         = Strings.UCase(Strings.Trim(crNumber));
            reasonForFailure = "A valid Change Request must start with the letters CR.";
            bool flag = Strings.Left(crNumber, 2) == "CR";

            if (flag)
            {
                string[] array = Strings.Split(crNumber, "-", -1, CompareMethod.Binary);
                flag             = Information.UBound(array, 1) == 1;
                reasonForFailure = "A valid CR number contains a CR number as well as a date, separated by a hyphen (CR[0..9]-MMDDYY)";
                if (flag)
                {
                    flag = Strings.Len(array[1]) >= 6;
                    if (flag)
                    {
                        reasonForFailure = "The date portion of the CR number is invalid.";
                        numArray[0]      = Conversions.ToInteger(Strings.Left(array[1], 2));
                        numArray[1]      = Conversions.ToInteger(Strings.Mid(array[1], 3, 2));
                        string expression = Strings.Right(array[1], Strings.Len(array[1]) - 4);
                        if (Strings.Len(expression) == 2)
                        {
                            numArray[2] = 0x7d0 + Conversions.ToInteger(expression);
                        }
                        else if (Strings.Len(expression) == 4)
                        {
                            numArray[2] = Conversions.ToInteger(expression);
                        }
                        else
                        {
                            flag = false;
                        }
                    }
                    if (flag)
                    {
                        reasonForFailure = "The date portion is in 'MMDDYY' format'. You entered an invalid month.";
                        flag             = (numArray[0] >= 1) & (numArray[0] <= 12);
                        if (flag)
                        {
                            reasonForFailure = "The date portion is in 'MMDDYY' format'. You entered an invalid day.";
                            flag             = (numArray[1] >= 1) & (numArray[1] <= DateTime.DaysInMonth(numArray[2], numArray[0]));
                        }
                        if (flag)
                        {
                            reasonForFailure = "The date portion is in 'MMDDYY' format'. You entered an invalid year. The year cannot be later than the current year and cannot be before 1990. If you think this is a valid year, make sure you did not reset your system date to an earlier year.";
                            flag             = (numArray[2] >= 0x7c6) & (numArray[2] <= DateAndTime.Year(DateAndTime.Now));
                        }
                        if (flag)
                        {
                            flag = Information.IsDate(DateAndTime.DateSerial(numArray[2], numArray[0], numArray[1]));
                        }
                        if (flag)
                        {
                            reasonForFailure = "The date portion of the CR number should be before today's date. If you believe this to be a valid CR number, check the system date on your machine and make sure it is set to the current date.";
                            flag             = DateTime.Compare(DateAndTime.DateSerial(numArray[2], numArray[0], numArray[1]), DateTime.Now) <= 0;
                        }
                        if (flag)
                        {
                            reasonForFailure = "The numeric portion of the CR number contains invalid characters";
                            array[0]         = Strings.Replace(array[0], "CR", "", 1, -1, CompareMethod.Binary);
                            flag             = Versioned.IsNumeric(array[0]);
                        }
                    }
                }
            }
            bool flag2 = flag;

            if (flag)
            {
                reasonForFailure = "";
            }
            return(flag2);
        }
コード例 #18
0
ファイル: mod_system.cs プロジェクト: Bladier/OrderingSystem
        static internal System.DateTime GetFirstDate(System.DateTime curDate)
        {
            dynamic firstDay = DateAndTime.DateSerial(curDate.Year, curDate.Month, 1);

            return(firstDay);
        }
コード例 #19
0
        private void CustomerStatement(ref int id)
        {
            ADODB.Recordset rsInterest    = default(ADODB.Recordset);
            ADODB.Recordset rsTransaction = default(ADODB.Recordset);
            ADODB.Recordset rsCompany     = default(ADODB.Recordset);
            int             lNumber       = 0;
            string          lAddress      = null;

            ADODB.Recordset rs  = new ADODB.Recordset();
            string          sql = null;

            //Dim Report As New cryCustomerStatement
            CrystalDecisions.CrystalReports.Engine.ReportDocument Report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            Report.Load("cryCustomerStatement.rpt");
            System.DateTime lDate = default(System.DateTime);
            rs = modRecordSet.getRS(ref "SELECT MonthEnd.MonthEnd_Date From MonthEnd WHERE (((MonthEnd.MonthEndID)=" + gMonth + "));");
            //rs.Open "SELECT MonthEnd.MonthEnd_Date From MonthEnd WHERE (((MonthEnd.MonthEndID)=" & gMonth & "));", cnnDBStatement, adOpenStatic, adLockReadOnly, adCmdText
            //Report.txtStatementDate.SetText Format(rs("MonthEnd_Date"), "dd mmm yyyy")
            Report.SetParameterValue("txtStatementDate", Strings.Format(DateAndTime.Today, "dd mmm yyyy"));
            lDate = rs.Fields("MonthEnd_Date").Value;

            rs.Close();
            rs    = modRecordSet.getRS(ref "SELECT * FROM Company");
            lDate = System.Date.FromOADate(lDate.ToOADate() + 10);
            lDate = DateAndTime.DateSerial(DateAndTime.Year(lDate), DateAndTime.Month(lDate), 1);
            lDate = System.Date.FromOADate(lDate + rs.Fields("Company_PaymentDay").Value - 1);
            //Report.txtPaymentDate.SetText Format(lDate, "dd mmm yyyy")

            lAddress = Strings.Replace(rs.Fields("Company_PhysicalAddress").Value, Constants.vbCrLf, ", ");
            if (Strings.Right(lAddress, 2) == ", ")
            {
                lAddress = Strings.Left(lAddress, Strings.Len(lAddress) - 2);
            }
            Report.Database.Tables(1).SetDataSource(rs);
            Report.SetParameterValue("txtAddress", lAddress);
            lNumber = "";
            if (!string.IsNullOrEmpty(rs.Fields("Company_Telephone").Value))
            {
                lNumber = lNumber + "Tel: " + rs.Fields("Company_Telephone").Value;
            }
            if (!string.IsNullOrEmpty(rs.Fields("Company_Fax").Value))
            {
                if (!string.IsNullOrEmpty(lNumber))
                {
                    lNumber = lNumber + " / ";
                }
                lNumber = lNumber + "Fax: " + rs.Fields("Company_Fax").Value;
            }
            if (!string.IsNullOrEmpty(rs.Fields("Company_Email").Value))
            {
                if (!string.IsNullOrEmpty(lNumber))
                {
                    lNumber = lNumber + " / ";
                }
                lNumber = lNumber + "Email: " + rs.Fields("Company_Email").Value;
            }
            Report.SetParameterValue("txtNumbers", lNumber);

            //New banking details
            if (Information.IsDBNull(rs.Fields("Company_BankName").Value))
            {
            }
            else
            {
                Report.SetParameterValue("txtBankName", rs.Fields("Company_BankName"));
            }

            if (Information.IsDBNull(rs.Fields("Company_BranchName").Value))
            {
            }
            else
            {
                Report.SetParameterValue("txtBranchName", rs.Fields("Company_BranchName"));
            }

            if (Information.IsDBNull(rs.Fields("Company_BranchCode").Value))
            {
            }
            else
            {
                Report.SetParameterValue("txtBranchCode", rs.Fields("Company_BranchCode"));
            }

            if (Information.IsDBNull(rs.Fields("Company_AccountNumber").Value))
            {
            }
            else
            {
                Report.SetParameterValue("txtAccountNumber", rs.Fields("Company_AccountNumber"));
            }
            //...................

            rsCompany = new ADODB.Recordset();
            rsCompany.Open("SELECT * FROM Customer Where CustomerID = " + id, cnnDBStatement, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);
            Report.Database.Tables(2).SetDataSource(rsCompany);

            rsTransaction = new ADODB.Recordset();
            //rsTransaction.Open "SELECT CustomerTransaction.*, TransactionType.TransactionType_Name, IIf([CustomerTransaction_Amount]>0,[CustomerTransaction_Amount],Null) AS debit, IIf([CustomerTransaction_Amount]<0,[CustomerTransaction_Amount],Null) AS credit FROM CustomerTransaction INNER JOIN TransactionType ON CustomerTransaction.CustomerTransaction_TransactionTypeID = TransactionType.TransactionTypeID WHERE (((CustomerTransaction.CustomerTransaction_CustomerID)=" & id & "));", cnnDBStatement, adOpenStatic, adLockReadOnly, adCmdText
            rsTransaction.Open("SELECT CustomerTransaction.CustomerTransactionID, CustomerTransaction.CustomerTransaction_CustomerID, CustomerTransaction.CustomerTransaction_TransactionTypeID, CustomerTransaction.CustomerTransaction_DayEndID, CustomerTransaction.CustomerTransaction_MonthEndID, CustomerTransaction.CustomerTransaction_ReferenceID, CustomerTransaction.CustomerTransaction_Date, CustomerTransaction.CustomerTransaction_Description, CustomerTransaction.CustomerTransaction_Amount, CustomerTransaction.CustomerTransaction_Reference, CustomerTransaction.CustomerTransaction_PersonName," + " TransactionType.TransactionType_Name, IIf([CustomerTransaction_Amount]>0,[CustomerTransaction_Amount],Null) AS debit, IIf([CustomerTransaction_Amount]<0,[CustomerTransaction_Amount],Null) AS credit FROM CustomerTransaction INNER JOIN TransactionType ON CustomerTransaction.CustomerTransaction_TransactionTypeID = TransactionType.TransactionTypeID WHERE (((CustomerTransaction.CustomerTransaction_CustomerID)=" + id + "));", cnnDBStatement, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);

            //Report.Database.Tables(3).SetDataSource rsTransaction, 3
            if (rsTransaction.BOF | rsTransaction.EOF)
            {
                rsTransaction = new ADODB.Recordset();
                rsTransaction.Open("SELECT 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0," + " 0, 0 AS debit, 0 AS credit;", cnnDBStatement, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);
                Report.Database.Tables(3).SetDataSource(rsTransaction);
                //Exit Sub
            }
            else
            {
                Report.Database.Tables(3).SetDataSource(rsTransaction);
            }

            if (rsTransaction.BOF | rsTransaction.EOF)
            {
                return;
            }

            rsInterest = new ADODB.Recordset();
            rsInterest.Open("SELECT * FROM Interest WHERE (((CustomerID)=" + id + ")) and (Debit>0);", cnnDBStatement, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);

            //If rsInterest.BOF Or rsInterest.EOF Then
            if (rsInterest.RecordCount > 0)
            {
                //Report.Field20.Top = 280
                //Report.Field21.Top = 280
                //Report.Field22.Top = 280
                //Report.Field23.Top = 280

                Report.Database.Tables(4).SetDataSource(rsInterest);
            }
            else
            {
                rsInterest = new ADODB.Recordset();
                rsInterest.Open("SELECT 0 AS CustomerID, 0 AS CDate, 0 AS Description, 0 AS Debit, 0 AS Credit, 0 AS SumIntBal ;", cnnDBStatement, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly, ADODB.CommandTypeEnum.adCmdText);
                //Report.Field20.Suppress = True
                //Report.Field21.Suppress = True
                //Report.Field22.Suppress = True
                //Report.Field23.Suppress = True
                Report.Database.Tables(4).SetDataSource(rsInterest);

                //Exit Sub
                //Set rsInterest = New Recordset
                //rsInterest.Open "SELECT * FROM Interest WHERE (((CustomerID)=" & id & "));", cnnDBStatement, adOpenStatic, adLockReadOnly, adCmdText
            }

            //Report.PrintOut(False, 1)
            Report.PrintToPrinter(1, false, 0, 0);

            System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
        }
コード例 #20
0
        public void OePoreznaIDDCommand(object sender, EventArgs e)
        {
            IDDDataset                dataSet  = new IDDDataset();
            ReportDocument            document = new ReportDocument();
            frmDDPregledMjeseciGodina godina   = new frmDDPregledMjeseciGodina();

            godina.ShowDialog();
            DataRow row = dataSet.test.NewRow();

            row["idtest"] = 0x63;
            dataSet.test.Rows.Add(row);
            if (godina.DialogResult != DialogResult.Cancel)
            {
                if ((godina.OdabraniGodinaIsplate != null) & (godina.OdabraniMjesecIsplate != null))
                {
                    ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo {
                        StartPosition = FormStartPosition.CenterParent,
                        Modal         = true,
                        Title         = "Pregled izvještaja",
                        Description   = "Pregled",
                        Icon          = ImageResourcesNew.mbs
                    };
                    SqlConnection connection = new SqlConnection();
                    SqlCommand    command    = new SqlCommand {
                        CommandType = CommandType.StoredProcedure,
                        CommandText = "S_DD_IDD"
                    };
                    connection.ConnectionString = Mipsed7.Core.ApplicationDatabaseInformation.ConnectionString;
                    command.Connection          = connection;
                    SqlDataAdapter adapter2 = new SqlDataAdapter {
                        SelectCommand = command
                    };
                    adapter2.SelectCommand.Connection = connection;
                    command.Parameters.AddWithValue("@mjesecisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniMjesecIsplate));
                    command.Parameters.AddWithValue("@godinaisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniGodinaIsplate));
                    command.Parameters.AddWithValue("@KOLONA", 3);
                    adapter2.Fill(dataSet, "kolona3");
                    SqlCommand command2 = new SqlCommand {
                        CommandType = CommandType.StoredProcedure,
                        CommandText = "S_DD_IDD",
                        Connection  = connection
                    };
                    SqlDataAdapter adapter3 = new SqlDataAdapter {
                        SelectCommand = command2
                    };
                    adapter3.SelectCommand.Connection = connection;
                    command2.Parameters.AddWithValue("@mjesecisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniMjesecIsplate));
                    command2.Parameters.AddWithValue("@godinaisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniGodinaIsplate));
                    command2.Parameters.AddWithValue("@KOLONA", 4);
                    adapter3.Fill(dataSet, "kolona4");
                    SqlCommand command3 = new SqlCommand {
                        CommandType = CommandType.StoredProcedure,
                        CommandText = "S_DD_IDD",
                        Connection  = connection
                    };
                    SqlDataAdapter adapter4 = new SqlDataAdapter {
                        SelectCommand = command3
                    };
                    adapter4.SelectCommand.Connection = connection;
                    command3.Parameters.AddWithValue("@mjesecisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniMjesecIsplate));
                    command3.Parameters.AddWithValue("@godinaisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniGodinaIsplate));
                    command3.Parameters.AddWithValue("@KOLONA", 5);
                    adapter4.Fill(dataSet, "kolona5");
                    SqlCommand command4 = new SqlCommand {
                        CommandType = CommandType.StoredProcedure,
                        CommandText = "S_DD_IDD",
                        Connection  = connection
                    };
                    SqlDataAdapter adapter5 = new SqlDataAdapter {
                        SelectCommand = command4
                    };
                    adapter5.SelectCommand.Connection = connection;
                    command4.Parameters.AddWithValue("@mjesecisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniMjesecIsplate));
                    command4.Parameters.AddWithValue("@godinaisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniGodinaIsplate));
                    command4.Parameters.AddWithValue("@KOLONA", 6);
                    adapter5.Fill(dataSet, "kolona6");
                    SqlCommand command5 = new SqlCommand {
                        CommandType = CommandType.StoredProcedure,
                        CommandText = "S_DD_IDD",
                        Connection  = connection
                    };
                    SqlDataAdapter adapter6 = new SqlDataAdapter {
                        SelectCommand = command5
                    };
                    adapter6.SelectCommand.Connection = connection;
                    command5.Parameters.AddWithValue("@mjesecisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniMjesecIsplate));
                    command5.Parameters.AddWithValue("@godinaisplate", RuntimeHelpers.GetObjectValue(godina.OdabraniGodinaIsplate));
                    command5.Parameters.AddWithValue("@KOLONA", 7);
                    adapter6.Fill(dataSet, "kolona7");
                }
                string          str2 = string.Format("{0:00}", RuntimeHelpers.GetObjectValue(godina.OdabraniMjesecIsplate));
                string          str  = string.Format("{0:0000}", RuntimeHelpers.GetObjectValue(godina.OdabraniGodinaIsplate));
                string          str3 = DB.MjesecNazivDativ(Conversions.ToInteger(godina.OdabraniMjesecIsplate)).ToUpper() + " " + str + ". godine";
                KORISNIKDataSet set  = new KORISNIKDataSet();
                new KORISNIKDataAdapter().Fill(set);
                sObrazacIDD o = new sObrazacIDD();

                sIDDmetapodaci dmetapodaci = new sIDDmetapodaci();
                DDModule.DDModule.sNaslovTemeljni        temeljni7    = new DDModule.DDModule.sNaslovTemeljni();
                DDModule.DDModule.sAutorTemeljni         temeljni2    = new DDModule.DDModule.sAutorTemeljni();
                DDModule.DDModule.sDatumTemeljni         temeljni3    = new DDModule.DDModule.sDatumTemeljni();
                DDModule.DDModule.sFormatTemeljni        temeljni4    = new DDModule.DDModule.sFormatTemeljni();
                DDModule.DDModule.sJezikTemeljni         temeljni6    = new DDModule.DDModule.sJezikTemeljni();
                DDModule.DDModule.sIdentifikatorTemeljni temeljni5    = new DDModule.DDModule.sIdentifikatorTemeljni();
                DDModule.DDModule.sUskladjenost          uskladjenost = new DDModule.DDModule.sUskladjenost();
                DDModule.DDModule.sTipTemeljni           temeljni8    = new DDModule.DDModule.sTipTemeljni();
                DDModule.DDModule.sAdresantTemeljni      temeljni     = new DDModule.DDModule.sAdresantTemeljni();

                temeljni7.Value = "IDD obrazac";
                temeljni7.dc    = "http://purl.org/dc/elements/1.1/title";

                temeljni2.Value = "VugerGRAD d.o.o.";
                temeljni2.dc    = "http://purl.org/dc/elements/1.1/creator";

                temeljni3.Value = DateAndTime.Now.ToString("s");
                temeljni3.dc    = "http://purl.org/dc/elements/1.1/date";

                temeljni4.Value = DDModule.DDModule.tFormat.textxml;
                temeljni4.dc    = "http://purl.org/dc/elements/1.1/format";

                temeljni6.Value = DDModule.DDModule.tJezik.hrHR;
                temeljni6.dc    = "http://purl.org/dc/elements/1.1/language";

                temeljni5.Value = Guid.NewGuid().ToString(); //"dc0e2097-c43b-41f3-a095-dcf327268fad";
                temeljni5.dc    = "http://purl.org/dc/elements/1.1/identifier";

                uskladjenost.Value = "ObrazacIDD-v1-0";
                uskladjenost.dc    = "http://purl.org/dc/terms/conformsTo";

                temeljni8.Value = DDModule.DDModule.tTip.Elektroničkiobrazac;
                temeljni8.dc    = "http://purl.org/dc/elements/1.1/type";

                temeljni.Value = "Ministarstvo Financija, Porezna uprava, Zagreb";

                dmetapodaci.Naslov        = temeljni7;
                dmetapodaci.Autor         = temeljni2;
                dmetapodaci.Datum         = temeljni3;
                dmetapodaci.Format        = temeljni4;
                dmetapodaci.Jezik         = temeljni6;
                dmetapodaci.Identifikator = temeljni5;
                dmetapodaci.Uskladjenost  = uskladjenost;
                dmetapodaci.Tip           = temeljni8;
                dmetapodaci.Adresant      = temeljni;
                o.verzijaSheme            = "1.0";
                o.Metapodaci = dmetapodaci;
                DDModule.DDModule.sZaglavlje zaglavlje = new DDModule.DDModule.sZaglavlje();
                DDModule.DDModule.sZaglavljePodnositeljZahtjeva zahtjeva = new DDModule.DDModule.sZaglavljePodnositeljZahtjeva();
                DDModule.DDModule.sAdresa    adresa    = new DDModule.DDModule.sAdresa();
                DDModule.DDModule.sRazdoblje razdoblje = new DDModule.DDModule.sRazdoblje();
                zahtjeva.Naziv = Conversions.ToString(set.KORISNIK[0]["KORISNIK1NAZIV"]);
                zahtjeva.OIB   = Conversions.ToString(set.KORISNIK[0]["KORISNIKOIB"]);

                try
                {
                    adresa.Ulica = set.KORISNIK[0]["KORISNIK1ADRESA"].ToString().Replace(DB.IzvuciSamoBrojke(set.KORISNIK[0]["KORISNIK1ADRESA"].ToString(), false), "");
                }
                catch (Exception)
                {
                    throw new Exception("Problem u izvlačenju brojčanog kućnog broja iz ulice!");
                }

                adresa.Broj     = DB.IzvuciSamoBrojke(set.KORISNIK[0]["KORISNIK1ADRESA"].ToString(), false);
                adresa.Mjesto   = Conversions.ToString(set.KORISNIK[0]["KORISNIK1MJESTO"]);
                zahtjeva.Adresa = adresa;
                zaglavlje.PodnositeljZahtjeva = zahtjeva;
                razdoblje.DatumOd             = DateAndTime.DateSerial(Conversions.ToInteger(str), Conversions.ToInteger(str2), 1);
                razdoblje.DatumDo             = DateAndTime.DateSerial(Conversions.ToInteger(str), Conversions.ToInteger(str2), DateTime.DaysInMonth(Conversions.ToInteger(str), Conversions.ToInteger(str2)));
                zaglavlje.Razdoblje           = razdoblje;
                o.Zaglavlje = zaglavlje;
                DDModule.DDModule.sTijelo tijelo = new DDModule.DDModule.sTijelo();
                o.Tijelo = tijelo;
                sTijeloPodatak010 podatak   = new sTijeloPodatak010();
                sTijeloPodatak020 podatak3  = new sTijeloPodatak020();
                sTijeloPodatak030 podatak4  = new sTijeloPodatak030();
                sTijeloPodatak040 podatak5  = new sTijeloPodatak040();
                sTijeloPodatak051 podatak6  = new sTijeloPodatak051();
                sTijeloPodatak052 podatak7  = new sTijeloPodatak052();
                sTijeloPodatak053 podatak8  = new sTijeloPodatak053();
                sTijeloPodatak054 podatak9  = new sTijeloPodatak054();
                sTijeloPodatak055 podatak10 = new sTijeloPodatak055();
                sTijeloPodatak056 podatak11 = new sTijeloPodatak056();
                sTijeloPodatak060 podatak12 = new sTijeloPodatak060();
                sTijeloPodatak070 podatak13 = new sTijeloPodatak070();
                sTijeloPodatak080 podatak14 = new sTijeloPodatak080();
                sTijeloPodatak090 podatak15 = new sTijeloPodatak090();
                sTijeloPodatak100 podatak2  = new sTijeloPodatak100();
                podatak.Iznos3 = Conversions.ToInteger(dataSet.kolona3.Rows[0]["brojprimatelja"]);
                podatak.Iznos4 = Conversions.ToInteger(dataSet.kolona4.Rows[0]["brojprimatelja"]);
                podatak.Iznos5 = Conversions.ToInteger(dataSet.kolona5.Rows[0]["brojprimatelja"]);
                podatak.Iznos6 = Conversions.ToInteger(dataSet.kolona6.Rows[0]["brojprimatelja"]);
                podatak.Iznos7 = Conversions.ToInteger(dataSet.kolona7.Rows[0]["brojprimatelja"]);
                podatak.Iznos8 = 0;
                podatak.Iznos9 = Conversions.ToInteger(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(dataSet.kolona3.Rows[0]["brojprimatelja"], dataSet.kolona4.Rows[0]["brojprimatelja"]), dataSet.kolona5.Rows[0]["brojprimatelja"]), dataSet.kolona6.Rows[0]["brojprimatelja"]), dataSet.kolona7.Rows[0]["brojprimatelja"]));

                podatak3.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["primici"]), 2);
                podatak3.Iznos4 = decimal.Round(Conversions.ToDecimal(dataSet.kolona4.Rows[0]["primici"]), 2);
                podatak3.Iznos5 = decimal.Round(Conversions.ToDecimal(dataSet.kolona5.Rows[0]["primici"]), 2);
                podatak3.Iznos6 = decimal.Round(Conversions.ToDecimal(dataSet.kolona6.Rows[0]["primici"]), 2);
                podatak3.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["primici"]), 2);
                podatak3.Iznos8 = decimal.Round(0.00M, 2);
                podatak3.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(dataSet.kolona3.Rows[0]["primici"], dataSet.kolona4.Rows[0]["primici"]), dataSet.kolona5.Rows[0]["primici"]), dataSet.kolona6.Rows[0]["primici"]), dataSet.kolona7.Rows[0]["primici"])), 2);

                podatak4.Iznos5 = decimal.Round(Conversions.ToDecimal(dataSet.kolona5.Rows[0]["izdatak"]), 2);
                podatak4.Iznos6 = decimal.Round(Conversions.ToDecimal(dataSet.kolona6.Rows[0]["izdatak"]), 2);
                podatak4.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["izdatak"]), 2);
                podatak4.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(Operators.AddObject(dataSet.kolona5.Rows[0]["izdatak"], dataSet.kolona6.Rows[0]["izdatak"]), dataSet.kolona7.Rows[0]["izdatak"])), 2);

                podatak5.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["osnovicadoprinos"]), 2);
                podatak5.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["osnovicadoprinos"]), 2);
                podatak5.Iznos8 = decimal.Round(0.00M, 2);
                podatak5.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona3.Rows[0]["osnovicadoprinos"], dataSet.kolona7.Rows[0]["osnovicadoprinos"])), 2);

                podatak6.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["mio1"]), 2);
                podatak6.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["mio1"]), 2);
                podatak6.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona3.Rows[0]["mio1"], dataSet.kolona7.Rows[0]["mio1"])), 2);

                podatak7.Iznos8 = decimal.Round(0.00M, 2);
                podatak7.Iznos9 = decimal.Round(0.00M, 2);

                podatak8.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["mio2"]), 2);
                podatak8.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["mio2"]), 2);
                podatak8.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona3.Rows[0]["mio2"], dataSet.kolona7.Rows[0]["mio2"])), 2);

                podatak9.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["zdr"]), 2);
                podatak9.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["zdr"]), 2);
                podatak9.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona3.Rows[0]["zdr"], dataSet.kolona7.Rows[0]["zdr"])), 2);

                podatak10.Iznos8 = decimal.Round(0.00M, 2);
                podatak10.Iznos9 = decimal.Round(0.00M, 2);

                podatak11.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["zast"]), 2);
                podatak11.Iznos4 = decimal.Round(Conversions.ToDecimal(dataSet.kolona4.Rows[0]["zast"]), 2);
                podatak11.Iznos5 = decimal.Round(Conversions.ToDecimal(dataSet.kolona5.Rows[0]["zast"]), 2);
                podatak11.Iznos6 = decimal.Round(Conversions.ToDecimal(dataSet.kolona6.Rows[0]["zast"]), 2);
                podatak11.Iznos8 = decimal.Round(0.00M, 2);
                podatak11.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(Operators.AddObject(Operators.AddObject(dataSet.kolona3.Rows[0]["zast"], dataSet.kolona4.Rows[0]["zast"]), dataSet.kolona5.Rows[0]["zast"]), dataSet.kolona6.Rows[0]["zast"])), 2);

                podatak12.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["izdatak"]), 2);
                podatak12.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["izdatak"]), 2);
                podatak12.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona3.Rows[0]["izdatak"], dataSet.kolona7.Rows[0]["izdatak"])), 2);

                podatak13.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["osnovicaporez"]), 2);
                podatak13.Iznos4 = decimal.Round(Conversions.ToDecimal(dataSet.kolona4.Rows[0]["osnovicaporez"]), 2);
                podatak13.Iznos5 = decimal.Round(Conversions.ToDecimal(dataSet.kolona5.Rows[0]["osnovicaporez"]), 2);
                podatak13.Iznos6 = decimal.Round(Conversions.ToDecimal(dataSet.kolona6.Rows[0]["osnovicaporez"]), 2);
                podatak13.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["osnovicaporez"]), 2);
                podatak13.Iznos8 = decimal.Round(0.00M, 2);
                podatak13.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(dataSet.kolona3.Rows[0]["osnovicaporez"], dataSet.kolona4.Rows[0]["osnovicaporez"]), dataSet.kolona5.Rows[0]["osnovicaporez"]), dataSet.kolona6.Rows[0]["osnovicaporez"]), dataSet.kolona7.Rows[0]["osnovicaporez"])), 2);

                podatak14.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["porez"]), 2);
                podatak14.Iznos4 = decimal.Round(Conversions.ToDecimal(dataSet.kolona4.Rows[0]["porez"]), 2);
                podatak14.Iznos5 = decimal.Round(Conversions.ToDecimal(dataSet.kolona5.Rows[0]["porez"]), 2);
                podatak14.Iznos6 = decimal.Round(Conversions.ToDecimal(dataSet.kolona6.Rows[0]["porez"]), 2);
                podatak14.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["porez"]), 2);
                podatak14.Iznos8 = decimal.Round(0.00M, 2);
                podatak14.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(dataSet.kolona3.Rows[0]["porez"], dataSet.kolona4.Rows[0]["porez"]), dataSet.kolona5.Rows[0]["porez"]), dataSet.kolona6.Rows[0]["porez"]), dataSet.kolona7.Rows[0]["porez"])), 2);

                podatak15.Iznos3 = decimal.Round(Conversions.ToDecimal(dataSet.kolona3.Rows[0]["prirez"]), 2);
                podatak15.Iznos4 = decimal.Round(Conversions.ToDecimal(dataSet.kolona4.Rows[0]["prirez"]), 2);
                podatak15.Iznos5 = decimal.Round(Conversions.ToDecimal(dataSet.kolona5.Rows[0]["prirez"]), 2);
                podatak15.Iznos6 = decimal.Round(Conversions.ToDecimal(dataSet.kolona6.Rows[0]["prirez"]), 2);
                podatak15.Iznos7 = decimal.Round(Conversions.ToDecimal(dataSet.kolona7.Rows[0]["prirez"]), 2);
                podatak15.Iznos8 = decimal.Round(0.00M, 2);
                podatak15.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(dataSet.kolona3.Rows[0]["prirez"], dataSet.kolona4.Rows[0]["prirez"]), dataSet.kolona5.Rows[0]["prirez"]), dataSet.kolona6.Rows[0]["prirez"]), dataSet.kolona7.Rows[0]["prirez"])), 2);

                podatak2.Iznos3 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona3.Rows[0]["prirez"], dataSet.kolona3.Rows[0]["porez"])), 2);
                podatak2.Iznos4 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona4.Rows[0]["prirez"], dataSet.kolona4.Rows[0]["porez"])), 2);
                podatak2.Iznos5 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona5.Rows[0]["prirez"], dataSet.kolona5.Rows[0]["porez"])), 2);
                podatak2.Iznos6 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona6.Rows[0]["prirez"], dataSet.kolona6.Rows[0]["porez"])), 2);
                podatak2.Iznos7 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(dataSet.kolona7.Rows[0]["prirez"], dataSet.kolona7.Rows[0]["porez"])), 2);
                podatak2.Iznos8 = decimal.Round(0.00M, 2);
                podatak2.Iznos9 = decimal.Round(Conversions.ToDecimal(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(Operators.AddObject(dataSet.kolona3.Rows[0]["prirez"], dataSet.kolona3.Rows[0]["porez"]), dataSet.kolona4.Rows[0]["prirez"]), dataSet.kolona4.Rows[0]["porez"]), dataSet.kolona5.Rows[0]["prirez"]), dataSet.kolona5.Rows[0]["porez"]), dataSet.kolona6.Rows[0]["prirez"]), dataSet.kolona6.Rows[0]["porez"]), dataSet.kolona7.Rows[0]["prirez"]), dataSet.kolona7.Rows[0]["porez"])), 2);

                o.Tijelo.Podatak010 = podatak;
                o.Tijelo.Podatak020 = podatak3;
                o.Tijelo.Podatak030 = podatak4;
                o.Tijelo.Podatak040 = podatak5;
                o.Tijelo.Podatak051 = podatak6;
                o.Tijelo.Podatak052 = podatak7;
                o.Tijelo.Podatak053 = podatak8;
                o.Tijelo.Podatak054 = podatak9;
                o.Tijelo.Podatak055 = podatak10;
                o.Tijelo.Podatak056 = podatak11;
                o.Tijelo.Podatak060 = podatak12;
                o.Tijelo.Podatak070 = podatak13;
                o.Tijelo.Podatak080 = podatak14;
                o.Tijelo.Podatak090 = podatak15;
                o.Tijelo.Podatak100 = podatak2;
                try
                {
                    SaveFileDialog dialog2 = new SaveFileDialog {
                        InitialDirectory = Conversions.ToString(0),
                        FileName         = "IDD" + str + "-" + str2 + ".xml",
                        RestoreDirectory = true
                    };
                    SaveFileDialog dialog = dialog2;
                    if (dialog.ShowDialog() == DialogResult.OK)
                    {
                        using (TextWriter writer = new StreamWriter(dialog.FileName))
                        {
                            XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
                            namespaces.Add("", "http://e-porezna.porezna-uprava.hr/sheme/zahtjevi/ObrazacIDD/v1-0");
                            new XmlSerializer(typeof(sObrazacIDD), "http://e-porezna.porezna-uprava.hr/sheme/zahtjevi/ObrazacIDD/v1-0").Serialize(writer, o, namespaces);

                            writer.Close();
                        }
                        Interaction.MsgBox("Datoteka uspješno  spremljena u: " + dialog.FileName, MsgBoxStyle.OkOnly, null);
                    }
                }
                catch (System.Exception exception1)
                {
                    throw exception1;
                }
            }
        }
コード例 #21
0
 private DateTime FileTimeToDate(ref CIEPasswords.FILETIME ftDateTime)
 {
     CIEPasswords.FileTimeToLocalFileTime(ref ftDateTime, ref this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lft);
     CIEPasswords.FileTimeToSystemTime(ref this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lft, ref this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst);
     return(DateTime.FromOADate(DateAndTime.DateSerial((int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wYear, (int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wMonth, (int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wDay).ToOADate() + DateAndTime.TimeSerial((int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wHour, (int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wMinute, (int)this.\u0024STATIC\u0024FileTimeToDate\u0024201112D10112C\u0024lst.wSecond).ToOADate()));
 }
コード例 #22
0
        internal static System.DateTime Scheduler(ref int IntM, ref int IntD, ref int IntY, int GapVal, string Gap = "Week")
        {
            int Max     = 0;
            int LastVal = 0;
            int MaxDays = 0;

            switch (Gap)
            {
            case "Day":
                Max   = Convert.ToInt32(Conversion.Val(ReadINI(Path.GetDirectoryName(Application.ExecutablePath) + "\\Settings.ini", "Month Max", DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(IntM))));
                IntD += GapVal;
                for (modMain.i = 1; modMain.i <= IntD; modMain.i++)
                {
                    if (modMain.i == Max)
                    {
                        LastVal = Max;
                        IntM++;
                        if (IntM > 12)
                        {
                            IntM = 1;
                            IntY++;
                        }
                        Max = Convert.ToInt32(Max + Conversion.Val(ReadINI(Path.GetDirectoryName(Application.ExecutablePath) + "\\Settings.ini", "Month Max", DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(IntM))));
                    }
                }
                IntD -= LastVal;
                break;

            case "Week":
                MaxDays = 7 * GapVal;
                Max     = Convert.ToInt32(Conversion.Val(ReadINI(Path.GetDirectoryName(Application.ExecutablePath) + "\\Settings.ini", "Month Max", DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(IntM))));
                IntD   += MaxDays;
                for (modMain.i = 1; modMain.i <= IntD; modMain.i++)
                {
                    if (modMain.i == Max)
                    {
                        LastVal = Max;
                        IntM++;
                        if (IntM > 12)
                        {
                            IntM = 1;
                            IntY++;
                        }
                        Max = Convert.ToInt32(Max + Conversion.Val(ReadINI(Path.GetDirectoryName(Application.ExecutablePath) + "\\Settings.ini", "Month Max", DateTimeFormatInfo.CurrentInfo.GetAbbreviatedMonthName(IntM))));
                    }
                }
                IntD -= LastVal;
                break;

            case "Month":
                IntM += GapVal;
                if (IntM > 12)
                {
                    IntM -= 12;
                    IntY++;
                }
                break;

            case "Year":
                IntY += GapVal;
                break;
            }
            return(DateAndTime.DateSerial(IntY, IntM, IntD));
        }