Example #1
0
    def addPubValue(self, event):
        # Pobiera wartosci z kontrolek do edycji
        tx1 = self.m_textCtrl2.GetValue()  # tytul
        tx2 = self.m_textCtrl4.GetValue()  # autor
        tx3 = self.m_textCtrl3.GetValue()  # cytowania
        tx4 = self.m_choice1.GetStringSelection()  # typ
        tx5 = self.m_textCtrl5.GetValue()  # rok
        tx6 = self.m_textCtrl6.GetValue()  # doi
        tx9 = self.m_textCtrl7.GetValue()  # identy
        tx7 = self.m_choice2.GetStringSelection()  # wydawca ID
        tx8 = self.getCheckUser()  # autor id
        tx10 = self.m_textCtrl71.GetValue()  # zrodlo
        tx11 = self.m_staticText11.GetLabel()  # urlpub
        tx12 = self.m_staticText12.GetLabel()  # urlcit
        tx13 = self.m_textCtrl99.GetValue()  # Lista ministerialna
        tx14 = self.m_choice3.GetStringSelection()  # jcr
        tx15 = self.m_textCtrl55.GetValue()  # note

        # Pobiera wartosci ID dla zaznaczonych autorów
        tmp = cDatabase.getJournalNameID(self.session)
        if tx7 != u"":
            tx7 = tmp[tx7]
        else:
            tx7 = None

        t = (tx1, tx2, tx3, tx4, tx5, tx6, tx9, tx7, tx8, tx11, tx12, tx10, tx13, tx14, tx15)

        # Sprawdzenie czy obowiazkowe wartości nie sa puste
        if tx1 != "" and tx2 != "" and tx3 != "" and tx5 != "":
            cDatabase.addPubData(self.session, t)
        else:
            wx.MessageBox(u'Pola "Tytuł, Autor, Cytowania, Rok" sa wymagane!', u"Bład", wx.OK | wx.ICON_INFORMATION)

        self.Destroy()
Example #2
0
    def editPubValue(self, event):
        #Pobiera wartosci z kontrolek do edycji
        tmp = self.m_staticText1.GetLabel()
        tmp = tmp.split('. ', 1)
        t0 = tmp[1]
        t1 = self.m_textCtrl2.GetValue()
        t2 = self.m_textCtrl4.GetValue()
        t3 = self.m_textCtrl3.GetValue()
        t4 = self.m_choice1.GetStringSelection()
        t5 = self.m_textCtrl5.GetValue()
        t6 = self.m_textCtrl6.GetValue()
        t7 = self.m_textCtrl7.GetValue()
        t8 = self.m_choice2.GetStringSelection()
        t10 = self.m_textCtrl71.GetValue()
        t11 = self.m_textCtrl99.GetValue()  #Lista ministerialna
        t12 = self.m_choice3.GetStringSelection()  #czy jest w JCR
        t13 = self.m_textCtrl55.GetValue()  #notatka

        #Odznacza już powiazanych autorów
        ch = cDatabase.editItemAuthor(self.session, t0)

        t9 = self.getCheckUser()

        #Pobiera wartosci ID dla zaznaczonych autorów
        tmp = cDatabase.getJournalNameID(self.session)
        print t8
        if t8 != u'':
            t8 = tmp[t8]
        else:
            t8 = None

        t = (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13)

        #Sprawdzenie czy obowiazkowe wartości nie sa puste
        if t1 != '' and t2 != '' and t3 != '' and t5 != '':
            cDatabase.editPubData(self.session, t, t0)
            wx.MessageBox(u'Zauktualizowano wartości!', u'Sukces',
                          wx.OK | wx.ICON_INFORMATION)
        else:
            wx.MessageBox(u'Nie podana nazwy grupy \nlub nie wybrano autorów.',
                          u'Bład', wx.OK | wx.ICON_INFORMATION)

        self.Destroy()
Example #3
0
    def editJournalValue(self, event):
        #Pobieranie danych wydawcy z kontrolek
        tx1 = self.m_comboBox1.GetValue()
        tx2 = self.m_textCtrl3.GetValue()
        tx3 = self.m_textCtrl4.GetValue()
        tx4 = self.m_textCtrl2.GetValue()
        t = (tx1, tx2, tx3, tx4)
        
        jourID = cDatabase.getJournalNameID(self.session)
        id = jourID[self.tx1]
#        print id
        
        #Sprawdzenie czy obowiazkowe wartości nie sa puste
        if tx1 != '' or tx3 != '':
            try:
                cDatabase.editJournalData(self.session, t, id)
                wx.MessageBox(u'Dane zaktualizowano pomyślnie!', u'Sukces!', wx.OK | wx.ICON_INFORMATION) 
            except Exception, e: #Wywołanie wyjtku, który został stworzony w zapytaniu do bazy
                e
Example #4
0
    def editJournalValue(self, event):
        #Pobieranie danych wydawcy z kontrolek
        tx1 = self.m_comboBox1.GetValue()
        tx2 = self.m_textCtrl3.GetValue()
        tx3 = self.m_textCtrl4.GetValue()
        tx4 = self.m_textCtrl2.GetValue()
        t = (tx1, tx2, tx3, tx4)

        jourID = cDatabase.getJournalNameID(self.session)
        id = jourID[self.tx1]
        #        print id

        #Sprawdzenie czy obowiazkowe wartości nie sa puste
        if tx1 != '' or tx3 != '':
            try:
                cDatabase.editJournalData(self.session, t, id)
                wx.MessageBox(u'Dane zaktualizowano pomyślnie!', u'Sukces!',
                              wx.OK | wx.ICON_INFORMATION)
            except Exception, e:  #Wywołanie wyjtku, który został stworzony w zapytaniu do bazy
                e
Example #5
0
    def editPubValue(self, event):
        # Pobiera wartosci z kontrolek do edycji
        tmp = self.m_staticText1.GetLabel()
        tmp = tmp.split(". ", 1)
        t0 = tmp[1]
        t1 = self.m_textCtrl2.GetValue()
        t2 = self.m_textCtrl4.GetValue()
        t3 = self.m_textCtrl3.GetValue()
        t4 = self.m_choice1.GetStringSelection()
        t5 = self.m_textCtrl5.GetValue()
        t6 = self.m_textCtrl6.GetValue()
        t7 = self.m_textCtrl7.GetValue()
        t8 = self.m_choice2.GetStringSelection()
        t10 = self.m_textCtrl71.GetValue()
        t11 = self.m_textCtrl99.GetValue()  # Lista ministerialna
        t12 = self.m_choice3.GetStringSelection()  # czy jest w JCR
        t13 = self.m_textCtrl55.GetValue()  # notatka

        # Odznacza już powiazanych autorów
        ch = cDatabase.editItemAuthor(self.session, t0)

        t9 = self.getCheckUser()

        # Pobiera wartosci ID dla zaznaczonych autorów
        tmp = cDatabase.getJournalNameID(self.session)
        print t8
        if t8 != u"":
            t8 = tmp[t8]
        else:
            t8 = None

        t = (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13)

        # Sprawdzenie czy obowiazkowe wartości nie sa puste
        if t1 != "" and t2 != "" and t3 != "" and t5 != "":
            cDatabase.editPubData(self.session, t, t0)
            wx.MessageBox(u"Zauktualizowano wartości!", u"Sukces", wx.OK | wx.ICON_INFORMATION)
        else:
            wx.MessageBox(u"Nie podana nazwy grupy \nlub nie wybrano autorów.", u"Bład", wx.OK | wx.ICON_INFORMATION)

        self.Destroy()
Example #6
0
    def addPubValue(self, event):
        #Pobiera wartosci z kontrolek do edycji
        tx1 = self.m_textCtrl2.GetValue()  #tytul
        tx2 = self.m_textCtrl4.GetValue()  #autor
        tx3 = self.m_textCtrl3.GetValue()  #cytowania
        tx4 = self.m_choice1.GetStringSelection()  #typ
        tx5 = self.m_textCtrl5.GetValue()  #rok
        tx6 = self.m_textCtrl6.GetValue()  #doi
        tx9 = self.m_textCtrl7.GetValue()  #identy
        tx7 = self.m_choice2.GetStringSelection()  #wydawca ID
        tx8 = self.getCheckUser()  #autor id
        tx10 = self.m_textCtrl71.GetValue()  #zrodlo
        tx11 = self.m_staticText11.GetLabel()  #urlpub
        tx12 = self.m_staticText12.GetLabel()  #urlcit
        tx13 = self.m_textCtrl99.GetValue()  #Lista ministerialna
        tx14 = self.m_choice3.GetStringSelection()  #jcr
        tx15 = self.m_textCtrl55.GetValue()  #note

        #Pobiera wartosci ID dla zaznaczonych autorów
        tmp = cDatabase.getJournalNameID(self.session)
        if tx7 != u'':
            tx7 = tmp[tx7]
        else:
            tx7 = None

        t = (tx1, tx2, tx3, tx4, tx5, tx6, tx9, tx7, tx8, tx11, tx12, tx10,
             tx13, tx14, tx15)

        #Sprawdzenie czy obowiazkowe wartości nie sa puste
        if tx1 != '' and tx2 != '' and tx3 != '' and tx5 != '':
            cDatabase.addPubData(self.session, t)
        else:
            wx.MessageBox(u'Pola "Tytuł, Autor, Cytowania, Rok" sa wymagane!',
                          u'Bład', wx.OK | wx.ICON_INFORMATION)

        self.Destroy()