public ActionResult DeleteConfirmed(int id)
        {
            Story story = db.Stories.Find(id);

            DeleteModels.Delete(story);
            return(RedirectToAction("Narrator", "Administration", null));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Chronicle chronicle = db.Chronicles.Find(id);

            DeleteModels.Delete(chronicle);
            return(RedirectToAction("Index", new { id = chronicle.Story_id }));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Session session = db.Sessions.Find(id);

            DeleteModels.Delete(session);
            return(RedirectToAction("Index", new { id = session.Chronicle_id }));
        }
        public ActionResult DeleteConfirmed(string id)
        {
            AspNetUser aspNetUser = db.AspNetUsers.Find(id);

            DeleteModels.Delete(aspNetUser);
            return(RedirectToAction("Index", "Administration", null));
        }
示例#5
0
        public ActionResult DeleteConfirmed(int id)
        {
            Player player = db.Players.Find(id);

            DeleteModels.Delete(player);
            return(RedirectToAction("Narrator", "Administration", null));
        }
示例#6
0
        public ActionResult DeleteConfirmed(int id)
        {
            Character character = db.Characters.Find(id);

            DeleteModels.Delete(character);
            if (User.IsInRole("Narrator"))
            {
                return(RedirectToAction("Index", new { id = character.Parent_id }));
            }
            else
            {
                return(RedirectToAction("Player", "Administration"));
            }
        }
        public int DeleteInterset([FromBody] DeleteModels interest)

        {
            FRDBEntities db = new FRDBEntities();
            int          interestId, UserId;

            using (FRDBEntities db1 = new FRDBEntities())
            {
                interestId = db1.GetInterestByName(interest.value).FirstOrDefault <GetInterestByName_Result>().id;
            }
            using (FRDBEntities db2 = new FRDBEntities())
            {
                UserId = db2.GetUserId(interest.email).FirstOrDefault() ?? 0;
            }
            using (db)
            {
                return(db.DeleteUserInterest(UserId, interestId));
            }
        }
        public int DeleteSkills([FromBody] DeleteModels skill)

        {
            FRDBEntities db = new FRDBEntities();
            int          SkillId, UserId;

            using (FRDBEntities db1 = new FRDBEntities())
            {
                SkillId = db1.GetSkillByName(skill.value).FirstOrDefault <GetSkillByName_Result>().id;
            }
            using (FRDBEntities db2 = new FRDBEntities())
            {
                UserId = db2.GetUserId(skill.email).FirstOrDefault() ?? 0;
            }
            using (db)
            {
                return(db.DeleteUserSkills(UserId, SkillId));
            }
        }
        public int DeleteHobbies([FromBody] DeleteModels hobby)

        {
            FRDBEntities db = new FRDBEntities();
            FRDBEntities db1 = new FRDBEntities();
            int          id, hid;

            using (db1)

            {
                int?i = db1.GetUserId(hobby.email).FirstOrDefault();
                id = i ?? 0;
            }
            using (FRDBEntities db2 = new FRDBEntities())
            {
                hid = db2.GetHobbyByName(hobby.value).FirstOrDefault <GetHobbyByName_Result>().id;
            }
            using (db)

            {
                return(db.DeleteUserHobbies(id, hid));
            }
        }
示例#10
0
        public DeleteModels DeleteModel(string modelId)
        {
            DeleteModels result = null;

            if (string.IsNullOrEmpty(modelId))
            {
                throw new ArgumentNullException($"Argument is not valid: {nameof(modelId)}");
            }

            try
            {
                result =
                    this.Client.WithAuthentication(this.UserName, this.Password)
                    .DeleteAsync($"{this.Endpoint}{PATH_MODEL}{modelId}")
                    .As <DeleteModels>()
                    .Result;
            }
            catch (AggregateException ae)
            {
                throw ae.Flatten();
            }

            return(result);
        }