Пример #1
0
 protected void gvPayments_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     switch (e.Row.RowType)
     {
     case DataControlRowType.DataRow:
         CTollTransaction myDataRowView    = (CTollTransaction)e.Row.DataItem;
         Button           AddPaymentButton = e.Row.FindControl("btnAddPayment") as Button;
         AddPaymentButton.Visible = (!myDataRowView.TT_IsPaid);
         break;
     }
 }
Пример #2
0
    protected void btnAddTollTransaction_Click(object sender, EventArgs e)
    {
        bool TransactionAdded =
            (CTollTransaction.AddTollTransaction(txtVRegistration.Text,
                                                 Convert.ToInt32(txtGantryID.Text))
             == 1) ? true : false;

        if (TransactionAdded)
        {
            lblStatus.Text      = "New toll transaction added.";
            lblStatus.ForeColor = System.Drawing.Color.Green;
            lblStatus.Font.Size = 12;
        }
        else
        {
            lblStatus.Text      = "Toll transaction could not be added.";
            lblStatus.ForeColor = System.Drawing.Color.Red;
            lblStatus.Font.Size = 12;
        }
    }