Exemple #1
0
    def Checkstate(self):
        if self.rb1.isChecked()==True:
            self.list1.clear()
            connection=sqlite3.connect("Cricket.db")
            result2=connection.execute("SELECT Player from Stats WHERE Category='BAT';")
            record2=result2.fetchall()
            a=0
            for i in record2:
                self.list1.addItem(i[0])
                a+=Scoring.batscoring(i[0])
            self.label_11.setText(str(a))
            self.label_6.setText("4")
            self.label_13.setText("0")
               
        elif self.rb2.isChecked()==True:
            self.list1.clear()
            connection=sqlite3.connect("Cricket.db")
            result4=connection.execute("SELECT Player from Stats WHERE Category='BWL';")
            record4=result4.fetchall()
            b=0
            for i in record4:
                self.list1.addItem(i[0])
                b+=Scoring.bowlscoring(i[0])
            self.label_11.setText(str(b))
            self.label_4.setText("4")
            self.label_13.setText("0")


        elif self.rb3.isChecked()==True:
             self.list1.clear()
             connection=sqlite3.connect("Cricket.db")
             point_2=connection.execute("SELECT  Player from Stats WHERE Category='AR';")
             record_2=point_2.fetchall()
             e=0
             for i in record_2:
                 self.list1.addItem(i[0])
                 e+=Scoring.AllRounder(i[0])  
             self.label_11.setText(str(e))
             self.label_3.setText("5")
             self.label_13.setText("0")
                 

        elif self.rb4.isChecked()==True:
            self.list1.clear()
            connection=sqlite3.connect("Cricket.db")
            result=connection.execute("SELECT Match.Player,Match.Scored,Match.Fours,Match.Sixes,Match.Faced,Match.RunOut,Match.Catches,Match.Stumping from Stats,Match WHERE Stats.Player=Match.Player AND Stats.Category='WK';")
            record=result.fetchall()
            f=0
            for i in record:
                self.list1.addItem(i[0])
                f+= Scoring.WicketKeeping(i[0])
            self.label_11.setText(str(f))
            self.label_8.setText("2")
            self.label_13.setText("0")
Exemple #2
0
    def PointsUsed_2(self,txt):
            connection=sqlite3.connect("Cricket.db")
            point_2=connection.execute("SELECT  Category from Stats WHERE Player='"+txt+"';")
            record_2=point_2.fetchall()
            for i in record_2:
                if i[0]=='BAT':
                    Num=int(self.label_6.text())
                    text_2=int(self.label_13.text())
                    text=int(self.label_11.text())
                    a=int(Scoring.batscoring(txt))
                    f=text+a
                    g=text_2-a
                    Num+=1
                    self.label_11.setText(str(f))
                    self.label_13.setText(str(g))
                    self.label_6.setText(str(Num))
                elif i[0]=='BWL':
                    Num=int(self.label_4.text())
                    text_2=int(self.label_13.text())
                    text=int(self.label_11.text())
                    b=int(Scoring.bowlscoring(txt))
                    Num+=1
                    m=text+b
                    p=text_2-b
                    self.label_11.setText(str(m))
                    self.label_13.setText(str(p))
                    self.label_4.setText(str(Num))
                elif i[0]=='AR':
                    Num=int(self.label_3.text())
                    text_2=int(self.label_13.text())
                    text=int(self.label_11.text())
                    c=int(Scoring.AllRounder(txt))
                    j=text+c
                    y=text_2-c
                    Num+=1
                    self.label_11.setText(str(j))
                    self.label_13.setText(str(y))
                    self.label_3.setText(str(Num))

                elif i[0]=='WK':
                    Num=int(self.label_8.text())
                    text_2=int(self.label_13.text())
                    text=int(self.label_11.text())
                    d=int(Scoring.WicketKeeping(txt))
                    h=text+d
                    l=text_2-d
                    Num+=1
                    self.label_11.setText(str(h))
                    self.label_13.setText(str(l))
                    self.label_8.setText(str(Num))