Example #1
0
        string WriteDisch(Dish disch)
        {
            string wirteDisch = "";

            wirteDisch += LinesHashAndNewLines();
            wirteDisch += OneHashAndNewLine();
            wirteDisch += TextPlusNewLines(disch.Name);
            if (CheckingAddOns(disch))
            {
                string sidesDishes = disch.SidesDishes;
                string oneSideDish;
                string newSidesDishes = "";
                while (SideDishesIsEmpty(sidesDishes))
                {
                    HelpFinding helpFinding = new HelpFinding();
                    oneSideDish     = helpFinding.FindingCommaOrPeriodAndCuttingCharacters(sidesDishes);
                    sidesDishes     = helpFinding.RemoveSideDishAndWhiteSigns(sidesDishes);
                    newSidesDishes += TextPlusNewLines(oneSideDish);
                }
                wirteDisch += newSidesDishes;
            }
            string price = name.PriceForDish + disch.Price + "\n";

            wirteDisch += price;
            wirteDisch += OneHashAndNewLine();
            wirteDisch += LinesHashAndNewLines();
            return(wirteDisch);
        }
Example #2
0
        private List <Order> LoadOrderListFromTxt()
        {
            Text         text      = Load();
            List <Order> orderList = new List <Order>();
            int          id        = 0;

            HelpFinding help = new HelpFinding();

            if (help.CheckStringIsNotEmpty(text.loadText))
            {
                text.newText = text.loadText;
            }
            while (help.CheckStringIsNotEmpty(text.newText))
            {
                text = FindinSingleOrder(text);
                if (help.CheckStringIsEmpty(text.orderText))
                {
                    break;
                }
                else
                {
                    id++;
                    Order order = new Order();
                    CreateOrder(text.orderText, order, id);
                    orderList.Add(order);
                }
            }
            return(orderList);
        }
Example #3
0
        private void AddDisheToList(Order order, string textDishes, int id)
        {
            HelpFinding help = new HelpFinding();

            while (help.CheckStringIsNotEmpty(textDishes))
            {
                string oneDish = FindOneDishAndReturn(textDishes);
                Dish   dish    = AddDishWithText(CreationNewDishObject(id), oneDish);
                order.AddDishToListDisch(dish);
                textDishes = FindDishAndRemove(textDishes);
                textDishes = RemoveWhiteChar(textDishes);
            }
        }
Example #4
0
        public string GetNameConfig(string key)
        {
            string      name = ConfigurationManager.AppSettings[key];
            HelpFinding help = new HelpFinding();

            if (help.CheckStringIsNotEmpty(name))
            {
                return(name);
            }
            else
            {
                return(_ = "name retrieval error: " + key);
            }
        }