Example #1
0
        public void MarkirajUsluguExportovanom(int uslugaID)
        {
            try
            {
                LavDataClassesDataContext _baza = new LavDataClassesDataContext(konekcioniString);

               _baza.ExecuteCommand(string.Format("update usluga set ZaExport = 0 where UslugaID = {0}", uslugaID));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="imeRoditelja">Ime tabele koja ima slusten kljuc u tabelu Usluga, na primer VrstaUsluge</param>
        /// <param name="roditeljID">PK ID kolone koja ima spusten kljuc u  tebelu Usluga, na primer 1 od VrstaUslugeID</param>
        /// <returns></returns>
        public void MarkirajUsluguZaExport(string imeRoditelja, int roditeljID)
        {
            try
            {
                LavDataClassesDataContext _baza = new LavDataClassesDataContext(konekcioniString);

                if (_baza.DatabaseExists())
                {
                    switch (imeRoditelja)
                    {
                        case "VrstaUsluge":
                            _baza.ExecuteCommand("update Usluga set ZaExport = 1 where VrstaUslugeID = {0}", roditeljID);
                            break;
                        case "NosilacGrupe":
                            _baza.ExecuteCommand("update Usluga set ZaExport = 1 where NosilacGrupeID = {0}", roditeljID);
                            break;
                        case "Nivo":
                            _baza.ExecuteCommand("update Usluga set ZaExport = 1 where NivoID = {0}", roditeljID);
                            break;
                        case "Pozicija":
                            _baza.ExecuteCommand("update Usluga set ZaExport = 1 where PozicijaID = {0}", roditeljID);
                            break;
                        case "Bod":
                            _baza.ExecuteCommand("update Usluga set ZaExport = 1 where BodID = {0}", roditeljID);
                            break;
                        default:
                            throw new Exception("Nepoznata tabela.");
                    }
                }
                else
                {
                    throw new Exception("Baza ne postoji.");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }