Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ctlCustomerInvoice.LoadCustomerInvoiceTemplate(ecPanelRequest.InvoiceId);
     //
     if (!IsPostBack)
     {
         // customer not allowed to manage his invoice
         if (PanelSecurity.LoggedUserId == CustomerInvoice.CustomerId)
         {
             ecUtils.ToggleControls(false, pnlAddManPayment, btnAddPayment, btnActivateInvoice);
             ecUtils.ToggleControls(!CustomerInvoice.Paid, ctlSelPaymentMethod, btnPayForInvoice);
             //
             if (ctlSelPaymentMethod.Visible)
             {
                 ctlSelPaymentMethod.LoadPaymentMethods();
             }
             //
             return;
         }
         // toggle off user's payment method ctl
         ecUtils.ToggleControls(false, ctlSelPaymentMethod, btnPayForInvoice);
         // admins and resellers are allowed to manage user's invoice
         if (PanelSecurity.LoggedUser.Role != UserRole.User)
         {
             ecUtils.ToggleControls(!CustomerInvoice.Paid, pnlAddManPayment, btnAddPayment);
         }
         // hide or show activate invoice button
         if (StorehouseHelper.IsInvoiceProcessed(ecPanelRequest.InvoiceId))
         {
             ecUtils.ToggleControls(false, btnActivateInvoice);
         }
         //
         if (pnlAddManPayment.Visible)
         {
             FillPaymentFields();
         }
     }
 }