コード例 #1
0
 def reset_view(self):
     self.reset_status()
     self.view.mpi.set('')
     self.view.claim.set('')
     self.view.facility.set('')
     self.view.accounting_start_date.set(beginning_of_prior_month())
     self.view.accounting_end_date.set(end_of_prior_month())
     self.view.service_start_date.set('')
     self.view.service_end_date.set('')
     self.view.check.set('')
     self.view.batch.set('')
コード例 #2
0
ファイル: view.py プロジェクト: MarkStefanovic/SqlExplorer
    def __init__(self):
        tk.Tk.__init__(self)

        pad_x = 10
        pad_y = 10

        self.option_add('*Background', 'light goldenrod yellow')
        self.option_add('*Foreground', 'dark slate grey')
        self.option_add('*Label*Background', 'dark slate grey')
        self.option_add('*Label*Foreground', 'light goldenrod yellow')
        self.option_add('*Font', 'Calibri 12')
        self.option_add('*Label*Font', 'Calibri 12 bold')
        self.option_add("*selectBackground", "gold")
        self.option_add("*selectForeground", "black")

        self.tbl = tk.StringVar()
        self.pw = tk.StringVar()
        self.mpi = tk.StringVar()
        self.claim = tk.StringVar()
        self.facility = tk.StringVar()
        self.accounting_start_date = tk.StringVar()
        self.accounting_end_date = tk.StringVar()
        self.service_start_date = tk.StringVar()
        self.service_end_date = tk.StringVar()
        self.check = tk.StringVar()
        self.batch = tk.StringVar()

        self.status = tk.StringVar()

        config = Config()
        self.request_list = config.tables

        self.grid()

        row = 0
        lbl = tk.Label(self, text='Request:')
        lbl.grid(row=row, column=0, sticky='W', padx=pad_x, pady=pad_y)
        cbo = ttk.Combobox(self, values=self.request_list, width=20
               , textvariable=self.tbl, font='Calibri 11 bold')
        cbo.grid(row=row, column=1, sticky='W', padx=pad_x, pady=pad_y)
        self.btn_run = tk.Button(self, text="Run"
                , bg='light cyan', fg='black', width=8
            , font='Calibri 12 bold')
        self.btn_run.grid(row=row, column=2, sticky='E', padx=4, pady=4)
        self.tbl.set(self.request_list[0])

        row = 1
        lbl = tk.Label(self, text='Password:'******'W', padx=pad_x, pady=pad_y)
        txt_pw = tk.Entry(self, show='*', textvariable=self.pw, width=20)
        txt_pw.grid(row=row, column=1, sticky='W', padx=pad_x, pady=pad_y)
        self.btn_reset = tk.Button(self, text="Reset"
            , font='Calibri 12 bold', bg='light cyan', fg='black')
        self.btn_reset.grid(row=row, column=2, sticky='EW', padx=4)

        row = 2
        lbl = tk.Label(self, text='MPI: ')
        lbl.grid(row=row, column=0, sticky='W', padx=pad_x, pady=pad_y)
        txt_mpi = tk.Entry(self, width=20, textvariable=self.mpi)
        txt_mpi.grid(row=row, column=1, sticky='EW', padx=pad_x, pady=pad_y)
        self.btn_sql = tk.Button(self, text="SQL", font='Calibri 12 bold'
                                 , bg='light cyan', fg='black')
        self.btn_sql.grid(row=row, column=2, sticky='EW', padx=4)

        row = 3
        lbl = tk.Label(self, text='Claim Number: ')
        lbl.grid(row=row, column=0, sticky='W', padx=pad_x, pady=pad_y)
        txt_claim = tk.Entry(self, width=20, textvariable=self.claim)
        txt_claim.grid(row=row, column=1, sticky='EW', padx=pad_x, pady=pad_y)
        self.btn_output = tk.Button(self, text="Output", font='Calibri 12 bold'
                                    , bg='light cyan', fg='black')
        self.btn_output.grid(row=row, column=2, sticky='EW', padx=4)

        row = 4
        lbl = tk.Label(self, text='Facility Code: ')
        lbl.grid(row=row, column=0, sticky='W', padx=pad_x, pady=pad_y)
        txt_facility = tk.Entry(self, width=20, textvariable=self.facility)
        txt_facility.grid(row=row, column=1, sticky='EW', padx=pad_x
            , pady=pad_y)
        self.btn_queue_window = tk.Button(self, text="Queue"
            , font='Calibri 12 bold', bg='light cyan', fg='black')
        self.btn_queue_window.grid(row=row, column=2, sticky='EW', padx=4)

        row = 5
        lbl = tk.Label(self, text='Accounting Start Date:')
        lbl.grid(row=row, column=0, sticky='W', padx=pad_x, pady=pad_y)
        txt_accounting_start_date = tk.Entry(self, width=20
            , textvariable=self.accounting_start_date)
        txt_accounting_start_date.grid(row=row, column=1, sticky='EW'
            , padx=pad_x, pady=pad_y)
        self.accounting_start_date.set(beginning_of_prior_month())
        self.btn_clean_up = tk.Button(self, text="Cleanup"
            , font='Calibri 12 bold', bg='light cyan', fg='black')
        self.btn_clean_up.grid(row=row, column=2, sticky='EW', padx=4)

        row = 6
        lbl = tk.Label(self, text='Accounting End Date:')
        lbl.grid(row=row, column=0, sticky='W', padx=pad_x, pady=pad_y)
        txt_accounting_end_date = tk.Entry(self, width=20
            , textvariable=self.accounting_end_date)
        txt_accounting_end_date.grid(row=row, column=1, sticky='EW'
            , padx=pad_x, pady=pad_y)
        self.accounting_end_date.set(end_of_prior_month())

        row = 7
        lbl_accounting_start_date = tk.Label(self
            , text='Service Start Date:')
        lbl_accounting_start_date.grid(row=row, column=0, sticky='W'
            , padx=pad_x, pady=pad_y)
        txt_accounting_start_date = tk.Entry(self, width=20
            , textvariable=self.service_start_date)
        txt_accounting_start_date.grid(row=row, column=1, sticky='EW'
            , padx=pad_x, pady=pad_y)

        row = 8
        lbl = tk.Label(self, text='Service End Date:')
        lbl.grid(row=row, column=0, sticky='W', padx=pad_x, pady=pad_y)
        txt = tk.Entry(self, width=20, textvariable=self.service_end_date)
        txt.grid(row=row, column=1, sticky='EW', padx=pad_x, pady=pad_y)

        row = 9
        lbl = tk.Label(self, text='Check Number:')
        lbl.grid(row=row, column=0, sticky='W', padx=pad_x, pady=pad_y)
        txt = tk.Entry(self, width=20, textvariable=self.check)
        txt.grid(row=row, column=1, sticky='EW', padx=pad_x, pady=pad_y)

        row = 10
        lbl = tk.Label(self, text='Batch ID:')
        lbl.grid(row=row, column=0, sticky='W', padx=pad_x, pady=pad_y)
        txt = tk.Entry(self, width=20, textvariable=self.batch)
        txt.grid(row=row, column=1, sticky='EW', padx=pad_x, pady=pad_y)

        row = 11
        lbl_status = tk.Label(self, font='Calibri 11'
            , textvariable=self.status, wrap=420)
        lbl_status.grid(row=row, column=0, columnspan=3, rowspan=3
            , sticky='NW', padx=pad_x, pady=4)
        self.status.set('Ready...')

        txt_mpi.focus_set()