public ActionResult EncryptMessage(MessageModel model) { if (ModelState.IsValid) { string Message = model.OriginalMessage; int i = 0; foreach (char c in Message) { var sModel = SymbolProcessor.GetRow(c); Message = $"{Message.Substring(0,i)}{sModel.newSymbol}{Message.Substring(i+1)}"; i++; } MessageProcessor.CreateMessage(model.OriginalMessage, Message); return(RedirectToAction("Index")); } return(View("Index")); }