Beispiel #1
0
 private void mnuPayment_Click(object sender, EventArgs e)
 {
     if (CheckState(db_connection))
     {
         frmPaymentTable fPTable = new frmPaymentTable(db_connection, usr);
         fPTable.MdiParent = this;
         fPTable.Show();
         fPTable.WindowState = FormWindowState.Maximized;
     }
 }
Beispiel #2
0
 private void OpenPaymentsTable(string id_user)
 {
     bool open = true;
     foreach (Form f in this.MdiChildren)
     {
         if (f.Name == "frmPaymentTable")
         {
             f.MdiParent = this;
             f.Show();
             f.WindowState = FormWindowState.Maximized;
             open = false;
         }
     }
     if (open)
     {
         if (id_user != "")
         {
             if (usr.prmCanSeeMyPayments)
             {
                 frmPaymentTable fPTable = new frmPaymentTable(db_connection, usr, true);
                 fPTable.MdiParent = this;
                 fPTable.Show();
                 fPTable.WindowState = FormWindowState.Maximized;
             }
             else
             {
                 MessageBox.Show("Нет доступа!", "Доступ", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         else
         {
             if (usr.prmCanSeeAllPayments)
             {
                 frmPaymentTable fPTable = new frmPaymentTable(db_connection, usr);
                 fPTable.MdiParent = this;
                 fPTable.Show();
                 fPTable.WindowState = FormWindowState.Maximized;
             }
             else
             {
                 MessageBox.Show("Нет доступа!", "Доступ", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
 }