Пример #1
0
        public ActionResult Edit(Solution newSolution, HttpPostedFileBase image = null)
        {
            if (ModelState.IsValid)
            {
                if (image != null)
                {
                    newSolution.ImageMimeType = image.ContentType;
                    newSolution.ImageData     = new byte[image.ContentLength];
                    image.InputStream.Read(newSolution.ImageData, 0, image.ContentLength);
                }

                var oldSolution = _repository.Solutions.FirstOrDefault(b => b.Id == newSolution.Id);

                try
                {
                    if (SolutionsAccessor.UpdateSolution(oldSolution, newSolution))
                    {
                        return(RedirectToAction("Index", "SiteAdmin", new { area = "" }));
                    }
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
            }

            return(View(newSolution));
        }
Пример #2
0
        private static void SolutionsAll()
        {
            Bot.PrintLine("The various types of solution are given below:");
            string allCategory = SolutionsAccessor.GetSolutionName();

            Bot.PrintData(allCategory);
            allCategory = allCategory.ToLower();
            string typeSentence = Bot.Prompt("Select the type of solution you want to purchase?");
            string type         = Logic.ExtractKeyword(allCategory, typeSentence);

            while (true)
            {
                while (!allCategory.Contains(type))
                {
                    typeSentence = Bot.Prompt(
                        "I'm sorry, We don't have the type of solution you mentioned. Please choose one from above types");
                    type = Logic.ExtractKeyword(allCategory, typeSentence);
                }
                ShowSolution(type);
                typeSentence = Bot.Prompt("Do you want to explore other solution types? If Yes, enter the type of the solution.");
                if (typeSentence.Contains("no"))
                {
                    return;
                }
                if (typeSentence.Contains("what") || typeSentence.Contains("show"))
                {
                    Bot.PrintData(allCategory);
                    typeSentence = Bot.Prompt("Here you go, Choose one from the above types of solution");
                }
                type = Logic.ExtractKeyword(allCategory, typeSentence);
            }
        }
Пример #3
0
        public ActionResult Create([Bind(Include = "Name, Description, ImageMimeType, ImageData")] Solution solution,
                                   HttpPostedFileBase image = null)
        {
            if (ModelState.IsValid)
            {
                if (image != null)
                {
                    solution.ImageMimeType = image.ContentType;
                    solution.ImageData     = new byte[image.ContentLength];
                    image.InputStream.Read(solution.ImageData, 0, image.ContentLength);
                }

                try
                {
                    if (!SolutionsAccessor.CreateSolution(solution))
                    {
                        return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                    }
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }


                return(RedirectToAction("Index", "SiteAdmin"));
            }

            return(RedirectToAction("Index", "SiteAdmin"));
        }
        public void TestGetPurpose()
        {
            string testinput1 = "alarm";
            string output1    = "ISAR\nISEM\nIVIC-Xi";

            Assert.AreEqual(output1, SolutionsAccessor.GetPurpose(testinput1));
        }
        public void TestGetDescription()
        {
            string test1   = "IGS";
            string test2   = "ISAR";
            string output1 = "The EWS movement helps doctors, nurses, and staff detect subtle signs of deterioration, assisting with early intervention. The solution allows you to see early warning scores right in the spot-check monitor, giving you all the information you need, at the point of care.\n   Detects deviations to spot subtle signs of deterioration\n   Informs responsible clinicians for early, effective intervention\n   https://www.philips.co.in/healthcare/product/HCNOCTN60/intellivue-guardian-solution-early-warning-scoring-solution";
            string output2 = "This solution offers you an all-in-one option that tackles both sides of the situation. It’s easy to implement, with reports developed using best practices gained from years of alarm management expertise. Our experienced clinical specialists analyze the information and provide education and training for your team to do the same. We help set up protocols tailored to your organization, using insights gleaned from your individual patient population.\n   Custom reports to identify trends in your information\n   End-to-end solution to provide actionable information\n   https://www.philips.co.in/healthcare/product/HCNOCTN60/intellivue-guardian-solution-early-warning-scoring-solution";

            Assert.AreEqual(output1, SolutionsAccessor.GetDescription(test1));
            Assert.AreEqual(output2, SolutionsAccessor.GetDescription(test2));
        }
        public void TestGetSolutions()
        {
            string solutions1 = "ISAR\nISEM\nIVIC-Xi";
            string solutions2 = "IGS";
            string solutions3 = "CDS Online Electronic help";
            string category1  = "CSA";
            string category2  = "EWES";
            string category3  = "Clinical Decision Support";

            Assert.AreEqual(solutions1, SolutionsAccessor.GetSolution(category1));
            Assert.AreEqual(solutions2, SolutionsAccessor.GetSolution(category2));
            Assert.AreEqual(solutions3, SolutionsAccessor.GetSolution(category3));
        }
Пример #7
0
        private static void SolutionsBasedOnPurpose()
        {
            string userQuery = Bot.Prompt("What is the purpose of the solution you need?");

            while (true)
            {
                string solution = SolutionsAccessor.GetPurpose(userQuery);
                while (String.Equals(solution, "null"))
                {
                    userQuery = Bot.Prompt(
                        "I'm Sorry. I'm not able to understand what you are looking for. Can you please be more specific? ");
                    solution = SolutionsAccessor.GetPurpose(userQuery);
                }
                ShowSolution(solution);
                userQuery = Bot.Prompt("Do you want to look for more Solutions based on different purpose of your choice? If Yes, Mention your purpose");
                if (userQuery.Contains("no"))
                {
                    return;
                }
            }
        }
Пример #8
0
        private static void ShowSolution(string type)
        {
            Bot.PrintLine("Available solutions of the type '{0}' are mentioned below:", type);
            string allSolutions = SolutionsAccessor.GetSolution(type);

            Bot.PrintData(allSolutions);
            allSolutions = allSolutions.ToLower();
            string solnNameSentence = Bot.Prompt("Which solution of above are you interested to know more about?");
            string solnName         = Logic.ExtractKeyword(allSolutions, solnNameSentence);

            while (true)
            {
                while (!allSolutions.Contains(solnName))
                {
                    solnNameSentence = Bot.Prompt(
                        "I'm sorry, We don't have a solution in that name. Please choose one of the above solutions to display it's description.");
                    solnName = Logic.ExtractKeyword(allSolutions, solnNameSentence);
                }
                Bot.PrintLine("The solution description is :");
                Bot.PrintData(SolutionsAccessor.GetDescription(solnName));
                string addcartSolution = Bot.Prompt("Do you want to Select this solution");
                if (addcartSolution.Contains("yes"))
                {
                    cart.Solutions.Add(type);
                    Bot.PrintLine("The solution {0} is now added to your cart", type);
                }
                solnNameSentence = Bot.Prompt("Do you want to look for more solutions of the type '{0}' ? Mention the solution you want to choose.", type);
                if (solnNameSentence.Contains("what") || solnNameSentence.Contains("show"))
                {
                    Bot.PrintData(allSolutions);
                    solnNameSentence = Bot.Prompt("Here you go, Choose one from the above solutions to know more.");
                }
                solnName = Logic.ExtractKeyword(allSolutions, solnNameSentence);
                if (solnNameSentence.Contains("no"))
                {
                    return;
                }
            }
        }
Пример #9
0
        public ActionResult Delete(int id)
        {
            SolutionsAccessor.DeleteSolution(id);

            return(RedirectToAction("Index", "SiteAdmin", new { area = "" }));
        }
        public void TestGetCategoriesForSolutions()
        {
            string output = "Clinical Decision Support\nCSA\nEWES";

            Assert.AreEqual(output, SolutionsAccessor.GetSolutionName());
        }