public static void Menu2()
      {
          M3   m3   = new M3(5);
          M5   m5   = new M5(7);
          M7   m7   = new M7(9);
          char done = 'n';

          Console.WriteLine("Please choose a single or multple item");
          do
          {
              Console.WriteLine("a. M3: 5$");
              Console.WriteLine("b. M5: 7$");
              Console.WriteLine("c. M7: 9$");

              char order = char.Parse(Console.ReadLine());
              switch (order)
              {
              case 'a':
                  Count += m3.Price();
                  using (StreamWriter w = File.AppendText("bill.txt"))
                  {
                      w.WriteLine("M3: 5$");
                  }
                  break;

              case 'b':
                  Count += m5.Price();
                  using (StreamWriter w = File.AppendText("bill.txt"))
                  {
                      w.WriteLine("M5: 7$");
                  }
                  break;

              case 'c':
                  Count += m7.Price();
                  using (StreamWriter w = File.AppendText("bill.txt"))
                  {
                      w.WriteLine("M7: 9$");
                  }
                  break;

              default:
                  Console.WriteLine("Not on the menu!");
                  break;
              }

              Console.Write("Order Complete?(y/n)");
              done = Char.Parse(Console.ReadLine());
              Console.Clear();
              cashRegister += Count;
          }while (done == 'n' || done == 'N');
          Console.WriteLine("Please take your bill");

          using (StreamWriter w = File.AppendText("bill.txt"))
          {
              w.WriteLine("Total Bill: {0}", Count);
          }
      }
Exemple #2
0
        public void TestM7Hash()
        {
            var input = StringToByteArray("9BDA1BFBCE2E6098921610547B3C1F97F539904629619474C1D69FE4BA010000D2B89E58AA3689780C1701EC9F1E6ED9AB52FFA9E548C4AA6B7F341412DBEA604F6F59E372E2051C58D1047C04A1203642B69F7017E73D012EA3ECC1BF8017FB9442185400000000060000000000000049400140000000000100");
            //for (byte i = 0; i < 64; i++)
            //    input[i]=i;

            var hashM7 = new M7();

            var result = hashM7.Hash(input, null);

            var knownResult = new Byte[] { 0x08, 0x5f, 0x7c, 0xea, 0xf7, 0x01, 0x78, 0xba, 0x0c, 0x88, 0x01, 0xc5, 0xdc, 0x7e, 0xe2, 0x52, 0x8d, 0xec, 0xca, 0x43, 0x05, 0x34, 0x92, 0x4a, 0x97, 0xc6, 0xec, 0xab, 0xba, 0xca, 0x29, 0xef };

            result.ToHexString().Should().Equal(knownResult.ToHexString());
        }
Exemple #3
0
        public void TestPushStateNotInheritGoto()
        {
            string expectedError = "M7() received event 'E3' that cannot be handled.";
            var    log           = new LogEvent();

            this.TestWithError(r =>
            {
                M7.RunTest(r, log);
            },
                               expectedError: expectedError);

            string actual = string.Join(", ", log.Log);

            Assert.Equal(@"Handling E1 in state Init, Entering Ready state, Entering Active state, Exiting Active state, Exiting Ready state, Entering Bad state, Unhandled event E3 in state Bad", actual);
        }
    // Start is called before the first frame update
    void Start()
    {
        StartCoroutine(Utils.SetVRDevice("OpenVR", true));


        MC1 = M1.GetComponent <MasterController>();
        MC2 = M2.GetComponent <MasterController>();
        MC3 = M3.GetComponent <MasterController>();
        MC4 = M4.GetComponent <MasterController>();
        MC5 = M5.GetComponent <MasterController>();
        MC6 = M6.GetComponent <MasterController>();
        MC7 = M7.GetComponent <MasterController>();
        MC8 = M8.GetComponent <MasterController>();

        loadLevel();
        currentPoseIndex = 0;
    }
        /// <summary>
        /// Builds Rail Carrier Shipment.
        /// Original from https://ps.nafta.extra.fcagroup.com/sites/itb-ebus/shared%20Documents/404RailCarrierShipmentInformation.pdf
        /// </summary>
        static TS404 BuildRailCarrierShipment(string controlNumber)
        {
            var result = new TS404();

            //  Transaction Set Identifier Code
            //  = “404” (Rail Carrier Shipment Information)
            //  Transaction Set Control Number = 0001
            result.ST = new ST();
            result.ST.TransactionSetIdentifierCode_01 = "404";
            result.ST.TransactionSetControlNumber_02  = controlNumber.PadLeft(9, '0');

            //  Transaction Set Purpose Code = “00” (Original)
            //  Transportation Method/ Type Code = “R” (Rail)
            //  Shipment Method of Payment
            //  = “11” (Rule 11 Shipment)
            //  Standard Carrier Alpha Code = NS
            //  Weight Unit Code = ”L” (Pounds)
            //  Shipment Qualifier
            //  = “B” (Bill of Lading for Individual Shipment)
            //  Section Seven Code = “N” (Not in Effect)
            result.BX = new BX();
            result.BX.TransactionSetPurposeCode_01    = "00";
            result.BX.TransportationMethodTypeCode_02 = "R";
            result.BX.ShipmentMethodofPayment_03      = "11";
            result.BX.StandardCarrierAlphaCode_05     = "NS";
            result.BX.WeightUnitCode_06    = "L";
            result.BX.ShipmentQualifier_07 = "B";
            result.BX.SectionSevenCode_08  = "N";

            //  Shipment Weight Code
            //  = “A” (Shipper's Weight Agreement)
            //  Billing Code = “S” (Single Shipment Billing)
            result.BNX = new BNX();
            result.BNX.ShipmentWeightCode_01 = "A";
            result.BNX.BillingCode_03        = "S";

            //  Release Code = “R” (Released with Billing Data)
            //  Date = 03 / 01 / 2000
            //  Time = 11:16
            //  Time Code = “LT” (Local Time)
            result.M3 = new M3();
            result.M3.ReleaseCode_01 = "R";
            result.M3.Date_02        = "20000301";
            result.M3.Time_03        = "1116";
            result.M3.TimeCode_04    = "LT";

            //  Repeating N9
            result.N9 = new List <N9>();

            //  Reference Identification Qualifier
            //  = “BM” (Bill of Lading Number)
            //  Reference Identification = 2041247
            //  Date = 03 / 01 / 2000
            //  Time = 11:16
            //  Time Code = “LT” (Local Time)
            var n9 = new N9();

            n9.ReferenceIdentificationQualifier_01 = "BM";
            n9.ReferenceIdentification_02          = "2041247";
            n9.Date_04     = "20000301";
            n9.Time_05     = "1116";
            n9.TimeCode_06 = "LT";
            result.N9.Add(n9);

            //  Repeating N7 Loops
            result.N7Loop = new List <Loop_N7_404>();

            //  Begin N7 Loop
            var n7Loop1 = new Loop_N7_404();

            //  Equipment Initial = CR
            //  Equipment Number = 237522
            //  Weight = 80,503
            //  Weight Qualifier = “N” (Actual Net Weight)
            //  Equipment Description Code = “RR” (Rail Car)
            n7Loop1.N7 = new N7();
            n7Loop1.N7.EquipmentInitial_01         = "CR";
            n7Loop1.N7.EquipmentNumber_02          = "237522";
            n7Loop1.N7.Weight_03                   = "80503";
            n7Loop1.N7.WeightQualifier_04          = "N";
            n7Loop1.N7.EquipmentDescriptionCode_11 = "RR";

            //  Repeating M7
            n7Loop1.M7 = new List <M7>();

            //  Seal Number = 582127
            //  Seal Number = 582128
            var m7 = new M7();

            m7.SealNumber_01 = "582127";
            m7.SealNumber_02 = "582128";
            n7Loop1.M7.Add(m7);

            //  End N7 Loop
            result.N7Loop.Add(n7Loop1);

            //  City Name = WARREN
            //  State or Province Code = MI
            result.F9                        = new F9();
            result.F9.CityName_02            = "WARREN";
            result.F9.StateorProvinceCode_03 = "MI";

            //  City Name = VALLEY PARK
            //  State or Province Code = MO
            result.D9                        = new D9();
            result.D9.CityName_02            = "VALLEY PARK";
            result.D9.StateorProvinceCode_03 = "MO";

            //  Repeating N1 Loops
            result.N1Loop = new List <Loop_N1_404_3>();

            //  Begin N1 Loop 1
            var n1Loop1 = new Loop_N1_404_3();

            //  Entity Identifier Code = “11”
            //  (Party to be billed < AAR Accounting Rule 11 >)
            //  Name = CORPAY SOLUTIONS
            n1Loop1.N1 = new N1();
            n1Loop1.N1.EntityIdentifierCode_01 = "11";
            n1Loop1.N1.Name_02 = "CORPAY SOLUTIONS";

            //  Repeating N3
            n1Loop1.N3 = new List <N3>();

            //  Address Information
            //  = PO BOX 195199 / 2065 S CENTER RD
            var n31 = new N3();

            n31.AddressInformation_01 = "PO BOX 195199/2065 S CENTER RD";
            n1Loop1.N3.Add(n31);

            //  City Name = BURTON
            //  State or Province Code = MI
            //  Postal Code = 48519
            n1Loop1.N4                        = new N4();
            n1Loop1.N4.CityName_01            = "BURTON";
            n1Loop1.N4.StateorProvinceCode_02 = "MI";
            n1Loop1.N4.PostalCode_03          = "48519";

            //  End N1 Loop 1
            result.N1Loop.Add(n1Loop1);

            //  Begin N1 Loop 2
            var n1Loop2 = new Loop_N1_404_3();

            //  Entity Identifier Code = “CN” (Consignee)
            //  Name = ST LOUIS ASSEMBLY I
            //  Identification Code Qualifier
            //  = “93” (Code assigned by the organization
            //  originating the transaction set)
            //  Identification Code = 04087
            n1Loop2.N1 = new N1();
            n1Loop2.N1.EntityIdentifierCode_01 = "CN";
            n1Loop2.N1.Name_02 = "ST LOUIS ASSEMBLY I";
            n1Loop2.N1.IdentificationCodeQualifier_03 = "93";
            n1Loop2.N1.IdentificationCode_04          = "04087";

            //  Repeating N3
            n1Loop2.N3 = new List <N3>();

            //  Address Information
            //  = 1001 N HIGHWAY DRIVE
            var n32 = new N3();

            n32.AddressInformation_01 = "1001 N HIGHWAY DRIVE";
            n1Loop2.N3.Add(n32);

            //  City Name = FENTON
            //  State or Province Code = MO
            //  Postal Code = 63026
            n1Loop2.N4                        = new N4();
            n1Loop2.N4.CityName_01            = "FENTON";
            n1Loop2.N4.StateorProvinceCode_02 = "MO";
            n1Loop2.N4.PostalCode_03          = "63026";

            //  End N1 Loop 2
            result.N1Loop.Add(n1Loop2);

            //  Begin N1 Loop 3
            var n1Loop3 = new Loop_N1_404_3();

            //  Entity Identifier Code
            //  = “UC” (Ultimate Consignee)
            //  Name = ST LOUIS ASSEMBLY I
            //  Identification Code Qualifier
            //  = “93” (Code assigned by the organization
            //  originating the transaction set)
            //  Identification Code = 04087
            n1Loop3.N1 = new N1();
            n1Loop3.N1.EntityIdentifierCode_01 = "UC";
            n1Loop3.N1.Name_02 = "ST LOUIS ASSEMBLY I";
            n1Loop3.N1.IdentificationCodeQualifier_03 = "93";
            n1Loop3.N1.IdentificationCode_04          = "04087";

            //  Repeating N3
            n1Loop3.N3 = new List <N3>();

            //  Address Information
            //  = 1001 N HIGHWAY DRIVE
            var n33 = new N3();

            n33.AddressInformation_01 = "1001 N HIGHWAY DRIVE";
            n1Loop3.N3.Add(n33);

            //  City Name = FENTON
            //  State or Province Code = MO
            //  Postal Code = 63026
            n1Loop3.N4                        = new N4();
            n1Loop3.N4.CityName_01            = "FENTON";
            n1Loop3.N4.StateorProvinceCode_02 = "MO";
            n1Loop3.N4.PostalCode_03          = "63026";

            //  End N1 Loop 3
            result.N1Loop.Add(n1Loop3);

            //  Begin N1 Loop 4
            var n1Loop4 = new Loop_N1_404_3();

            //  Entity Identifier Code = “SH” (Shipper)
            //  Name = STERLING STAMPING
            //  Identification Code Qualifier
            //  = “93” (Code assigned by the organization
            //  originating the transaction set)
            //  Identification Code = 06215
            n1Loop4.N1 = new N1();
            n1Loop4.N1.EntityIdentifierCode_01 = "SH";
            n1Loop4.N1.Name_02 = "STERLING STAMPING";
            n1Loop4.N1.IdentificationCodeQualifier_03 = "93";
            n1Loop4.N1.IdentificationCode_04          = "06215";

            //  Repeating N3
            n1Loop4.N3 = new List <N3>();

            //  Address = 35777 VAN DYKE RD
            var n34 = new N3();

            n34.AddressInformation_01 = "35777 VAN DYKE RD";
            n1Loop4.N3.Add(n34);

            //  City Name = STERLING HEIGHTS
            //  State or Province Code = MI
            //  Postal Code = 48312
            n1Loop4.N4                        = new N4();
            n1Loop4.N4.CityName_01            = "STERLING HEIGHTS";
            n1Loop4.N4.StateorProvinceCode_02 = "MI";
            n1Loop4.N4.PostalCode_03          = "48312";

            //  End N1 Loop 4
            result.N1Loop.Add(n1Loop4);

            //  Repeating R2
            result.R2 = new List <R2>();

            //  Standard Carrier Alpha Code = NS
            //  Routing Sequence Code
            //  = “R” (Origin Carrier, Rule 11 Shipment)
            //  City Name = ESTL
            var r21 = new R2();

            r21.StandardCarrierAlphaCode_01 = "NS";
            r21.RoutingSequenceCode_02      = "R";
            r21.CityName_03 = "ESTL";
            result.R2.Add(r21);

            //  Standard Carrier Alpha Code = BNSF
            //  Routing Sequence Code
            //  = “1” (1st Carrier after Origin Carrier)
            var r22 = new R2();

            r22.StandardCarrierAlphaCode_01 = "BNSF";
            r22.RoutingSequenceCode_02      = "1";
            result.R2.Add(r22);

            //  Repeating LX Loops
            result.LXLoop = new List <Loop_LX_404>();

            //  Begin LX Loop
            var lxLoop1 = new Loop_LX_404();

            //  Assigned Number = 1
            lxLoop1.LX = new LX();
            lxLoop1.LX.AssignedNumber_01 = "1";

            //  Repeating L5
            lxLoop1.L5 = new List <L5>();

            //  Lading Line Item Number = 1
            //  Lading Description = AUTO PARTS
            //  Commodity Code = 3714993
            //  Commodity Code Qualifier
            //  = “T” (Standard Transportation Commodity
            //  Code<STCC>)
            var l5 = new L5();

            l5.LadingLineItemNumber_01   = "1";
            l5.LadingDescription_02      = "AUTO PARTS";
            l5.CommodityCode_03          = "3714993";
            l5.CommodityCodeQualifier_04 = "T";
            lxLoop1.L5.Add(l5);

            //  Repeating L0 Loops
            lxLoop1.L0Loop = new List <Loop_L0_404>();

            //  Begin L0 Loop
            var l0Loop1 = new Loop_L0_404();

            //  Lading Line Item Number = 1
            //  Weight = 80,503
            //  Weight Qualifier = “N” (Actual Net Weight)
            //  Lading Quantity = 42
            //  Packaging Form Code = “RCK” (Rack)
            l0Loop1.L0 = new L0();
            l0Loop1.L0.LadingLineItemNumber_01 = "1";
            l0Loop1.L0.Weight_04            = "80503";
            l0Loop1.L0.WeightQualifier_05   = "N";
            l0Loop1.L0.LadingQuantity_08    = "42";
            l0Loop1.L0.PackagingFormCode_09 = "RCK";

            //  End L0 Loop
            lxLoop1.L0Loop.Add(l0Loop1);

            //  End LX Loop
            result.LXLoop.Add(lxLoop1);

            return(result);
        }
Exemple #6
0
 public SyncMethod NewSyncMethod <T, U, V>(M7 <T, U, V> @delegate)
 {
     return(new SyncMethod(this, @delegate));
 }
Exemple #7
0
 public void Do <T, U, V, W, X, Y, Z>(M7 <T, U, V, W, X, Y, Z> m)
 {
     DoAny(m);
 }
Exemple #8
0
 public void Do <T, U, V, W, X>(M7 <T, U, V, W, X> m)
 {
     DoAny(m);
 }
Exemple #9
0
 public void Do <T, U, V>(M7 <T, U, V> m)
 {
     DoAny(m);
 }