Пример #1
0
        public HttpResponseMessage GetFeatureById(int id)
        {
            var data = logic.GetFeatureById(id);

            if (data != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, data));
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, logic.ErrorMessage));
            }
        }
        public ActionResult Edit(int id)
        {
            Feature feature = new Feature();

            try
            {
                feature = FeaturesLogic.GetFeatureById(id);
            }
            catch (Exception e)
            {
                LogsLogic.InsertLog(new Log()
                {
                    Message    = e.Message,
                    StackTrace = e.StackTrace,
                    StoryName  = "MoreHolidays/Features/Edit(Get)",
                    Parameters = "id=" + id
                });
            }
            return(View("Edit", feature));
        }
        public ActionResult Delete(int id)
        {
            int solutionIdIndex = FeaturesLogic.GetFeatureById(id).SolutionId;

            try
            {
                FeaturesLogic.DeleteFeature(id);
            }
            catch (Exception e)
            {
                LogsLogic.InsertLog(new Log()
                {
                    Message    = e.Message,
                    StackTrace = e.StackTrace,
                    StoryName  = "MoreHolidays/Features/Delete",
                    Parameters = "id=" + id
                });
            }
            return(RedirectToAction("Index", new { solutionId = solutionIdIndex }));
        }