Ejemplo n.º 1
0
        public void GetCalculatedUnit(PromotionsModel PromotionsModel, ref int unitofUnit)
        {
            int number = 0;

            string[] unitPermotionList = PromotionsModel._unit.Split(",");
            foreach (string unitPermotion in unitPermotionList)
            {
                bool isNumeric = Regex.IsMatch(unitPermotion, @"^\d+$");

                if (!isNumeric)
                {
                    PromotionsModel._unit = unitPermotion;
                }
                else
                {
                    unitofUnit = Convert.ToInt32(unitPermotion);
                }
            }
            //return unitofUnit;
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");

            List <PromotionsModel> _promotionsModels = new List <PromotionsModel>();
            int _totalPrice = 0;

            Console.WriteLine("total number of No of Unit");
            int a = Convert.ToInt32(Console.ReadLine());

            for (int i = 0; i < a; i++)
            {
                Console.WriteLine("enter the type of promotions:A,B,C or D");
                string          type            = Console.ReadLine();
                PromotionsModel promotionsModel = new PromotionsModel();
                promotionsModel.GetPriceByType(type);
                _promotionsModels.Add(promotionsModel);

                _totalPrice = promotionsModel.GetTotalPrice(_promotionsModels);
            }

            Console.WriteLine(_totalPrice);
            Console.ReadLine();
        }