コード例 #1
0
        public RetargetingAdjustmentVisual(RetargetingAdjustment item, ClientSettings settings) : base(item)
        {
            RetargetingConditionId = item.RetargetingConditionId;
            Accessible             = item.Accessible;
            Enabled = item.Enabled;

            RetargetingName = settings?.RetargetingListCash
                              .Where(x => x.ID == RetargetingConditionId)
                              .Select(x => x.Name)
                              .FirstOrDefault();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: AleksTem/AutoCourses
        internal void PrintCountries(Dictionary <int, Country> dictionary, YesNoEnum isTelenorSupportedFilter)
        {
            Console.WriteLine($"Countries TelenorSupported = {isTelenorSupportedFilter}");
            var telenorSupportedCountries = dictionary.Where(x =>
                                                             x.Value.IsTelenorSupported.Equals(isTelenorSupportedFilter));

            foreach (KeyValuePair <int, Country> item in telenorSupportedCountries)
            {
                Console.WriteLine($"{item.Value.Name,-20} {item.Value.IsTelenorSupported}");
            }
        }
コード例 #3
0
        /// <inheritdoc/>
        public override void Execute(object parameter)
        {
            data = null;
            YesNoEnum newData = YesNoEnum.No;

            if (Enum.TryParse(parameter.ToString(), out newData))
            {
                data = newData;
            }
            ExecutionDone();
        }
コード例 #4
0
 private async Task ResultAskPaidFine(YesNoEnum.YesNo option)
 {
     switch (option)
     {
         case YesNoEnum.YesNo.S:
             await PayFine();
             break;
         default:
             this.isPaid = false;
             break;
     }
 }
コード例 #5
0
        public void SelectedValue_Validation_ReturnsResult(YesNoEnum selectedValue, bool result)
        {
            ExportedWholeWeeeViewModel viewModel = new ExportedWholeWeeeViewModel()
            {
                WeeeSelectedValue = selectedValue
            };

            var context = new ValidationContext(viewModel, null, null);
            var results = new List <ValidationResult>();
            var isValid = Validator.TryValidateObject(viewModel, context, results, true);

            Assert.Equal(isValid, result);
        }
コード例 #6
0
        // Zur naechsten Seite blaettern gemaess Kontext (Ja/Nein)
        public Page GetNextPage(YesNoEnum answer)
        {
            int nextPage = pages[currentPage].nextIfNo;

            if (answer == YesNoEnum.Yes)
            {
                nextPage = pages[currentPage].nextIfYes;
            }

            Page np = pages[nextPage];

            currentPage = nextPage; // Seite merken
            return(np);
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: AleksTem/AutoCourses
        public void SetTelenorSupportedStatus(string countryName, YesNoEnum IsTelenorSupportedStatus)
        {
            if (string.IsNullOrEmpty(countryName) || string.IsNullOrWhiteSpace(countryName))
            {
                return;
            }

            var item = Dictionary.FirstOrDefault(x =>
                                                 x.Value.Name.PrepareForComparison().Equals(countryName.PrepareForComparison())).Value;

            if (item == null)
            {
                throw new System.Exception("Country not found.");
            }
            item.IsTelenorSupported = IsTelenorSupportedStatus;
        }
コード例 #8
0
        public async void PostExportedWholeWeee_SelectedValueGiven_CorrectRedirectHappens(YesNoEnum selectedValue, string action)
        {
            var viewModel = new ExportedWholeWeeeViewModel()
            {
                WeeeSelectedValue = selectedValue,
                ReturnId          = Guid.NewGuid()
            };

            var result = await controller.ExportedWholeWeee(organisationId, viewModel) as RedirectToRouteResult;

            result.RouteValues["action"].Should().Be(action);
            result.RouteValues["controller"].Should().Be("Returns");
            result.RouteName.Should().Be(AeRedirect.ReturnsRouteName);

            if (selectedValue == YesNoEnum.No)
            {
                result.RouteValues["organisationId"].Should().Be(organisationId);
            }
            if (selectedValue == YesNoEnum.Yes)
            {
                result.RouteValues["returnId"].Should().Be(viewModel.ReturnId);
            }
        }
コード例 #9
0
 public DemographicsAdjustmentVisual(DemographicsAdjustment item) : base(item)
 {
     Gender  = item.Gender;
     Age     = item.Age;
     Enabled = item.Enabled;
 }
コード例 #10
0
ファイル: Helloworld.cs プロジェクト: frankdenggx/CSharp
        static void Main(string[] args)
        {
            Calc c = Calc.getInstance();

            Helloworld instance = new Helloworld();

            instance.Age = 10;

            LinQDemo.testLinQ();


            int contParams = 5;

            refMethod(ref contParams);
            WriteLine($"contParams={contParams}");

            paramsMethod("abc", 1, 2);

            string testStr = "abcd";

            WriteLine(testStr.revert());

            var newVar1 = "abc";

            newVar1 = Convert.ToString(5);


            YesNoEnum yesNoEnum   = YesNoEnum.Yes;
            string    description = yesNoEnum.FetchDescription();

            WriteLine($"description={description}");

            RouteN routeN;

            routeN.direction = Orientation.WEST;
            routeN.distince  = 10.13D;
            WriteLine("routeN={0}", routeN.direction);
            WriteLine("routeN={0}", routeN.detail());

            int[] myIntArray  = { 1, 2, 3, 4, 5 };
            int[] myIntArray1 = new int[6];

            foreach (int item in myIntArray)
            {
                WriteLine("item{0}", item);
            }

            double[,] dataN = { { 1, 2, 3 }, { 4, 5, 6 } };

            foreach (double item in dataN)
            {
                WriteLine(item);
            }

            WriteLine("=============================");

            int[][] jaggedArray = { new int[] { 1 }, new int[] { 2, 3 }, new int[] { 4, 5, 6 } };
            foreach (int[] itemArray in jaggedArray)
            {
                foreach (int item in itemArray)
                {
                    WriteLine(item);
                }
            }

            WriteLine("=============================");
            char[] trims      = { 'a' };
            string trimString = "abaca";

            trimString = trimString.Trim(trims);
            WriteLine("trimString={0}", trimString);

            WriteLine("trimString={0}", trimString.PadRight(10) + "efg");

            string myStrig = "A-B-C";

            string[] myStringArr = myStrig.Split(new char[] { '-' });
            foreach (string item in myStringArr)
            {
                WriteLine("item={0}", item);
            }


            Orientation    orientation    = Orientation.EAST;
            NewOrientation newOrientation = NewOrientation.WEST;

            WriteLine($"orientation={orientation}");
            WriteLine($"newOrientation={(long)newOrientation}");

            WriteLine("10L={0}", Enum.GetName(typeof(NewOrientation), 10L));

            NewOrientation newOrientation1 = (NewOrientation)Enum.Parse(typeof(NewOrientation), newOrientation.ToString());

            Array values = Enum.GetValues(newOrientation.GetType());

            WriteLine($"newOrientation.val={values.GetValue(0)}");

            //Calc calc = new Calc();
            //calc.output();

            StaticData staticData = new StaticData();

            WriteLine($"staticData={staticData.getInterval()}");

            #region 提供控制台操作
            Console.WriteLine("Hello World!");

            #endregion

            int    MyInteger = 17;
            string MyString  = "\"MyInteger=\"";
            Console.WriteLine($"{MyString}{MyInteger}");

            int __ = 11;
            Console.WriteLine(__);

            long dataLong = 100L;
            Console.WriteLine(dataLong);

            //char c = (char)0x0007;

            //Console.WriteLine(c);

            string data  = "Beijing\'s data";
            string data1 = @"Beijing\'s data";
            Console.WriteLine(data);
            Console.WriteLine(data1);

            int var1, var3, var2 = -10;
            var1 = +var2;
            var3 = -var2;
            Console.WriteLine(var1);
            Console.WriteLine(var3);

            Console.WriteLine("input:");
            double sndNumber;
            int    data3;

            /*
             * try
             * {
             *  sndNumber = Convert.ToDouble(Console.ReadLine());
             * }
             * catch (Exception)
             * {
             *
             *  //throw;
             * }
             */

            int var6, var7, var4 = 5, var5 = 10;
            var6 = var4 * var5++;
            var7 = var4 * ++var5;
            Console.WriteLine($"var4={var4}");
            Console.WriteLine($"var5={var5}");
            Console.WriteLine($"var6={var6}");
            Console.WriteLine($"var7={var7}");

            Debug.WriteLine("");
            Trace.WriteLine("");

            try
            {
                if (var7 > 10)
                {
                    throw new System.Exception("var7 > 10");
                }
            }
            catch (Exception e) when(var7 > 10)
            {
                WriteLine(e.Message);
            }


            /*
             * string inputString = Console.ReadLine();
             * Type type = inputString.GetType();
             * Console.WriteLine($"type={type.ToString()}");
             * if (inputString=="1")
             * {
             *  Console.WriteLine("true");
             * }
             */

            return;
        }
コード例 #11
0
ファイル: Country.cs プロジェクト: AleksTem/AutoCourses
 public Country(string name, YesNoEnum isTelenorSupported)
 {
     Name = name;
     IsTelenorSupported = isTelenorSupported;
 }
コード例 #12
0
 private async Task ResultAskForAnotherBook(YesNoEnum.YesNo option)
 {
     switch (option)
     {
         case YesNoEnum.YesNo.S:
             await GetBookTitle(true);
             break;
         default:
             break;
     }
 }