예제 #1
0
 /// <summary>
 /// Add a Problem to the database
 /// </summary>
 /// <param name="entity">Problem to add</param>
 public void Add(Problem entity)
 {
     Session.Save(entity);
 }
예제 #2
0
 /// <summary>
 /// Remove a Problem from the database
 /// </summary>
 /// <param name="entity">Problem to remove</param>
 public void Remove(Problem entity)
 {
     Session.Delete(entity);
 }
예제 #3
0
        /// <summary>
        /// Add new disease
        /// </summary>
        /// <returns></returns>
        public JsonResult CreateNewDisease()
        {
            try
            {
                ProblemRepository problemRepo = new ProblemRepository();
                var problemName = Request.Form["DiseaseName"];

                Problem problem = new Problem();

                problem.ProblemName = problemName;

                problemRepo.Add(problem);

                return Json(new
                {
                    error = "false",
                    Name = problem.ProblemName
                });

            }
            catch (Exception)
            {
                return Json(new
                {
                    error = "true"
                });
            }
        }