コード例 #1
0
        private void BtnOpenPrintClick(object sender, RoutedEventArgs e)
        {
            //if expired,

            //if either PO or Abw are not printed yet...
            //then if expired, message that it's too late to do anything other than voiding this form
            //if not expired, just display the print options popup

            //otherwise, if both PO & Abw are printed then...
            //if expired, ask if this is for administrative purposes?
            MessageBoxResult adminusage = MessageBox.Show("Both PO and Abw are already printed.\rIs this for administrative purposes?\r\rNo = Void this form and ",
                                                          "Administrative Purposes?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);

            if (adminusage == MessageBoxResult.Cancel)
            {
                return;
            }
            if (adminusage == MessageBoxResult.No)
            {
                MessageBox.Show("");                              //TODO:
            }
            //if expired, then admin only reprints
            if (Taxform.IsExpired)
            {
                //make the "expired" message visible... including how this should not be used for giving the customer a "free reprint"
                //disable the $2 reprint radio button
                //check the "administrative reprint" radio
                //make the popup visible for selecting either form for printing and hitting ok or cancel
                //the _checked() events on either PO or Abw should do nothing fancy in this case
                popPrint.IsOpen = true;
                return;
            }
            //otherwise, not expired, so "$2 customer reprint" radio is enabled as well as "administrative reprint"
            //then when PO or Abw is checked, if "$2 customer reprint" is selected, then

            var expiredReprint = MessageBox.Show("Form is Expired:\rYes = Void & Create new replacement?\rNo = Administrative reprint",
                                                 "Expired Form - Customer wants Replacement?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);

            switch (expiredReprint)
            {
            case MessageBoxResult.Cancel:
                return;

            case MessageBoxResult.Yes:
            {
                if (MessageBox.Show("Has the customer returned full package - All 3 copies of both PO and Abw?", "Existing paperwork accounted for?",
                                    MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
                {
                    MessageBox.Show("Can't proceed with voiding this form until it's been fully returned.", "Abort", MessageBoxButton.OK, MessageBoxImage.Stop);
                    return;
                }

                string  sponsorGUID;
                string  newTaxFormGUID;
                decimal serviceFee;
                Taxform.VoidAndNew(out sponsorGUID, out newTaxFormGUID, out serviceFee);

                // if Sponsor is loaded, add this to the current shop list
                var sponsor = ModelBase.Lookup <SponsorModel>(sponsorGUID, false);
                if (sponsor != null)
                {
// ReSharper disable UnusedVariable - TODO
                    var reprint = new TransactionList.TransactionItem(sponsor.Transactions, "Reprint/Replacement", serviceFee);
// ReSharper restore UnusedVariable
                }
                return;
            }
            }

            //        MessageBox.Show("Expired form can't be (re)Printed,\ronly Voided and brand new Form sold.", "Expired Form", MessageBoxButton.OK, MessageBoxImage.Stop);

            /*else
             * {
             *  ((CheckBox)sender).IsChecked = false;
             *  popPrint.IsOpen = false;
             * }*/

            popPrint.IsOpen = true;
        }
コード例 #2
0
    private void BtnOpenPrintClick(object sender, RoutedEventArgs e)
    {
      //if expired, 

      //if either PO or Abw are not printed yet...
        //then if expired, message that it's too late to do anything other than voiding this form
        //if not expired, just display the print options popup

      //otherwise, if both PO & Abw are printed then...
        //if expired, ask if this is for administrative purposes?
      MessageBoxResult adminusage = MessageBox.Show("Both PO and Abw are already printed.\rIs this for administrative purposes?\r\rNo = Void this form and ",
        "Administrative Purposes?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);

      if (adminusage == MessageBoxResult.Cancel) return;
      if (adminusage == MessageBoxResult.No) MessageBox.Show(""); //TODO:

      //if expired, then admin only reprints
      if (Taxform.IsExpired)
      {
        //make the "expired" message visible... including how this should not be used for giving the customer a "free reprint"
        //disable the $2 reprint radio button
        //check the "administrative reprint" radio
        //make the popup visible for selecting either form for printing and hitting ok or cancel
        //the _checked() events on either PO or Abw should do nothing fancy in this case
        popPrint.IsOpen = true;
        return;
      }
      //otherwise, not expired, so "$2 customer reprint" radio is enabled as well as "administrative reprint" 
      //then when PO or Abw is checked, if "$2 customer reprint" is selected, then 

      var expiredReprint = MessageBox.Show("Form is Expired:\rYes = Void & Create new replacement?\rNo = Administrative reprint",
                                                         "Expired Form - Customer wants Replacement?", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
      switch (expiredReprint)
      {
        case MessageBoxResult.Cancel:
          return;
        case MessageBoxResult.Yes:
          {
            if (MessageBox.Show("Has the customer returned full package - All 3 copies of both PO and Abw?", "Existing paperwork accounted for?",
                                MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
            {
              MessageBox.Show("Can't proceed with voiding this form until it's been fully returned.", "Abort", MessageBoxButton.OK, MessageBoxImage.Stop);
              return;
            }

            string sponsorGUID;
            string newTaxFormGUID;
            decimal serviceFee;
            Taxform.VoidAndNew(out sponsorGUID, out newTaxFormGUID, out serviceFee);

            // if Sponsor is loaded, add this to the current shop list
            var sponsor = ModelBase.Lookup<SponsorModel>(sponsorGUID, false);
            if (sponsor != null)
            {
// ReSharper disable UnusedVariable - TODO
              var reprint = new TransactionList.TransactionItem(sponsor.Transactions, "Reprint/Replacement", serviceFee);
// ReSharper restore UnusedVariable
            }
            return;
          }
      }

      //        MessageBox.Show("Expired form can't be (re)Printed,\ronly Voided and brand new Form sold.", "Expired Form", MessageBoxButton.OK, MessageBoxImage.Stop);

      /*else
        {
          ((CheckBox)sender).IsChecked = false;
          popPrint.IsOpen = false;
        }*/

      popPrint.IsOpen = true;
    }