Exemple #1
0
 // GET: Prosecutor
 public ActionResult Index()
 {
     if (CurrentUser != null)
     {
         try
         {
             List <vw_KeyValue> list = CircuitService.GetCircuitsBySecretairyID(CurrentUser.ID);
             //ViewBag.RedirectPage = null;
             //if (TempData["SuccessMessage"] != null)
             //    ShowMessage(MessageTypes.Success, (string)TempData["SuccessMessage"]);
             //if (TempData["[FailedMessage"] != null)
             //    ShowMessage(MessageTypes.Error, (string)TempData["[FailedMessage"]);
             List <TextPredectionsViewModels> TextPredections = TextPredectionsService.GetTextPredections(list)
                                                                .Select(Text => new TextPredectionsViewModels
             {
                 TextID      = Text.TextID,
                 CircuitName = Text.CircuitName,
                 CircuitID   = Text.CircuitID,
                 TextPredectionsDescription = Text.TextPredectionsDescription,
                 TextTitle = Text.TextTitle,
             }).ToList();
             return(View(TextPredections));
         }
         catch (Exception ex)
         {
             return(ErrorPage(ex));
         }
     }
     else
     {
         return(RedirectTo(Url.Action("login", "User", new { returnUrl = "/" })).WithErrorMessages("تم الخروج بشكل تلقائى لعدم التفاعل اكثر من 15 دقيقة"));
     }
 }
Exemple #2
0
        public IDictionary <string, string> GetTextPrediction(int CircuitID)
        {
            List <vw_KeyValue> list = CircuitService.GetCircuitsBySecretairyID(CurrentUser.ID).Where(e => e.ID == CircuitID).ToList();

            var TextPred = new Dictionary <string, string>();

            TextPredectionsService.GetTextPredections(list).ToList()
            .ForEach(text => TextPred[text.TextTitle] = text.TextPredectionsDescription);
            return(TextPred);
        }