Ejemplo n.º 1
0
        public JsonResult AddOrEditPerformer(Core.BusinessObjects.PerformerDTO performer)
        {
            OptionsJsonModel optionsJsonModel = new OptionsJsonModel
            {
                StatusJson = false,
                Id = default(Int32)
            };

            performer.Name = performer.Name.Trim();

            if (ModelState.IsValid)
            {
                Int32? id = null;
                if (performer.PerformerId != default(Int32)) //Update Performer
                {
                    id = _todoService.UpdatePerformer(performer);
                }
                else //Add new Performer
                {
                    id = _todoService.AddPerformer(performer);
                }

                if (id != null)
                {
                    optionsJsonModel.StatusJson = true;
                    optionsJsonModel.Id = (Int32)id;
                }
            }

            return Json(optionsJsonModel);
        }
Ejemplo n.º 2
0
        public JsonResult AddOrEditPriority(Core.BusinessObjects.PriorityDTO priority)
        {
            OptionsJsonModel optionsJsonModel = new OptionsJsonModel
            {
                StatusJson = false,
                Id = default(Int32)
            };

            priority.Title = priority.Title.Trim();
            priority.Color = priority.Color.Trim();

            if (ModelState.IsValid)
            {
                Int32? id = null;

                if (priority.PriorityId != default(Int32)) //Update status
                {
                    id = _todoService.UpdatePriority(priority);
                }
                else //Add new status
                {
                    id = _todoService.AddPriority(priority);
                }

                if (id != null)
                {
                    optionsJsonModel.StatusJson = true;
                    optionsJsonModel.Id = (Int32)id;
                }
            }

            return Json(optionsJsonModel);
        }
Ejemplo n.º 3
0
        public JsonResult DeleteTag(Int32 tagId)
        {
            OptionsJsonModel optionsJsonModel = new OptionsJsonModel
            {
                StatusJson = false
            };

            if (tagId != default(Int32))
            {
                optionsJsonModel.StatusJson = _todoService.DeleteTag(tagId);
            }

            return Json(optionsJsonModel);
        }
Ejemplo n.º 4
0
        public JsonResult DeletePriority(Int32 priorityId)
        {
            OptionsJsonModel optionsJsonModel = new OptionsJsonModel
            {
                StatusJson = false
            };

            if (priorityId != default(Int32))
            {
                optionsJsonModel.StatusJson = _todoService.DeletePriority(priorityId);
            }

            return Json(optionsJsonModel);
        }
Ejemplo n.º 5
0
        public JsonResult DeletePerformer(Int32 performerId)
        {
            OptionsJsonModel optionsJsonModel = new OptionsJsonModel
            {
                StatusJson = false
            };

            if (performerId != default(Int32))
            {
                optionsJsonModel.StatusJson = _todoService.DeletePerformer(performerId);
            }

            return Json(optionsJsonModel);
        }
Ejemplo n.º 6
0
        public JsonResult AddOrEditTag(Core.BusinessObjects.TagDTO tag)
        {
            OptionsJsonModel optionsJsonModel = new OptionsJsonModel
            {
                StatusJson = false,
                Id = default(Int32)
            };

            tag.Text = tag.Text.Trim();

            if (ModelState.IsValid)
            {
                Int32? id = null;

                if (tag.TagId != default(Int32)) //Update status
                {
                    id = _todoService.UpdateTag(tag);
                }
                else //Add new status
                {
                    id = _todoService.AddTag(tag);
                }

                if (id != null)
                {
                    optionsJsonModel.StatusJson = true;
                    optionsJsonModel.Id = (Int32)id;
                }
            }

            return Json(optionsJsonModel);
        }
Ejemplo n.º 7
0
        public JsonResult AddOrEditStatus(Core.BusinessObjects.StatusDTO status)
        {
            OptionsJsonModel optionsJsonModel = new OptionsJsonModel
            {
                StatusJson = false,
                Id = default(Int32)
            };

            status.Title = status.Title.Trim();

            if (ModelState.IsValid)
            {
                Int32? id = null;

                if (status.StatusId != default(Int32)) //Update status
                {
                    id = _todoService.UpdateStatus(status);
                }
                else //Add new status
                {
                    id = _todoService.AddStatus(status);
                }

                if (id != null)
                {
                    optionsJsonModel.StatusJson = true;
                    optionsJsonModel.Id = (Int32)id;
                }
            }

            return Json(optionsJsonModel);
        }