public BaseModel ParseTokens(IList <string> tokens) { var model = new DeletionModel(); tokens.RemoveAt(0); var whereKeyword = Keywords.Where.ToString(); var whereKeywordParsed = false; while (tokens.Count > 0) { var token = tokens[0]; if (!whereKeywordParsed) { model.EntityName = token; whereKeywordParsed = true; } else { model.WhereCondition = token; } tokens.RemoveAt(0); } return(model); }
public ActionResult DeleteTasks(DeletionModel recievedModel) { //Deletes list of tasks based on dates given. if (recievedModel != null) { db.DeleteTasks(recievedModel.m_StartingDate, recievedModel.m_EndingDate); db.SaveChanges(); if (User.Identity.GetUserName() == "Admin") { return(RedirectToAction("AdminIndex", new { ProjectID = recievedModel.m_CurrentProjectID })); } return(RedirectToAction("Index", new { ProjectID = recievedModel.m_CurrentProjectID })); } return(RedirectToAction("ErrorPage", "Home", new { msg = "خطأ في الوصول إلى الشبكة" })); }