Пример #1
0
        internal C_EVPOPL GetEvpopl(decimal poplatek, string perioda)
        {
            C_NAZPOPL nazp = sesna.GetObjectByKey <C_NAZPOPL>(poplatek);
            C_PERIODA per  = sesna.GetObjectByKey <C_PERIODA>(perioda);

            C_EVPOPL.CompoundKey1Struct key = new C_EVPOPL.CompoundKey1Struct();
            key.EVPOPL_KOD = nazp;
            key.EVPOPL_PER = per;
            return(sesna.GetObjectByKey <C_EVPOPL>(key));
        }
Пример #2
0
        internal DateTime GetDatumSplatnosti(DateTime vystaveno, C_EVPOPL evp, short porPer)
        {
            DateTime obdMez = vystaveno;

            int       pocDni = (int)evp.EVPOPL_POCDNU;
            C_PERIODA per    = null;
            DBValue   dbv    = null;

            switch (evp.EVPOPL_TERMPLAC.TERMPLAC_TERMPLAC)
            {
            case "Z":  //zaèátek období
            case "K":  //zacatek nebo konec období
                per = sesna.GetObjectByKey <C_PERIODA>(evp.CompoundKey1.EVPOPL_PER.PERIODA_NAZEV);
                C_KALENDAR.CompoundKey1Struct key = new C_KALENDAR.CompoundKey1Struct();
                key.KALENDAR_PERIODA.PERIODA_PERIODA = evp.CompoundKey1.EVPOPL_PER.PERIODA_NAZEV;
                key.KALENDAR_PORPER = porPer;
                obdMez = (sesna.GetObjectByKey <C_KALENDAR>(key)).KALENDAR_FROMDATE;
                break;

            case "P":                             //po vystavení poplatku
                dbv    = DBValue.Instance(sesna); //new DBValue(sesna);
                obdMez = dbv.DBSysDate;
                break;

            case "R":                             //zaèátek akt. roku
                dbv    = DBValue.Instance(sesna); //new DBValue(sesna);
                obdMez = new DateTime(dbv.DBSysDate.Year, 1, 1);
                break;

            case "E":                             //konec akt. roku
                dbv    = DBValue.Instance(sesna); //new DBValue(sesna);
                obdMez = new DateTime(dbv.DBSysDate.Year, 12, 31);
                break;
            }

            return(obdMez.AddDays(pocDni));
        }