public ActionResult Index() { BlueprintMediaServisEntity BMSentity = new BlueprintMediaServisEntity(); ViewBag.Entity = Session["entity"]; ViewBag.Status = Session["status"]; Session["entity"] = null; Session["status"] = null; BoardMembers boardMembers = new BoardMembers(); List <BoardMembers> boardMembersList = new List <BoardMembers>(); if (ViewBag.Entity != null) { boardMembers.content_tr = ViewBag.Entity.content_tr; boardMembers.content_en = ViewBag.Entity.content_en; boardMembers.content_ru = ViewBag.Entity.content_ru; boardMembersList.Add(boardMembers); return(View(Tuple.Create <BoardMembers, IEnumerable <BoardMembers> >(new BoardMembers(), boardMembersList))); } else { boardMembers.content_tr = ""; boardMembers.content_en = ""; boardMembers.content_ru = ""; boardMembersList.Add(boardMembers); return(View(Tuple.Create <BoardMembers, IEnumerable <BoardMembers> >(new BoardMembers(), boardMembersList))); } }
public IHttpActionResult GetBoardMembers(int id) { BoardMembers boardMembers = db.BoardMembers.Find(id); if (boardMembers == null) { return(NotFound()); } return(Ok(boardMembers)); }
public void SetPortait() { BoardMembers bm = FindObjectOfType <BoardMemberContainer>().characters; Image Portait = GetComponent <Image>(); switch (List) { case MemberList.CharacterList.william: Portait.sprite = bm.William.Portrait; break; case MemberList.CharacterList.Anita: Portait.sprite = bm.Anita.Portrait; break; case MemberList.CharacterList.George: Portait.sprite = bm.George.Portrait; break; case MemberList.CharacterList.Susan: Portait.sprite = bm.Susan.Portrait; break; case MemberList.CharacterList.Chandi: Portait.sprite = bm.Chandi.Portrait; break; case MemberList.CharacterList.David: Portait.sprite = bm.David.Portrait; break; case MemberList.CharacterList.Jennifer: Portait.sprite = bm.Jennifer.Portrait; break; case MemberList.CharacterList.Joan: Portait.sprite = bm.Joan.Portrait; break; case MemberList.CharacterList.Jason: Portait.sprite = bm.Jason.Portrait; break; case MemberList.CharacterList.Mark: Portait.sprite = bm.Mark.Portrait; break; } }
public ActionResult Update(BoardMembers valuesEntity, HttpPostedFileBase image_tr6, HttpPostedFileBase image_en6, HttpPostedFileBase image_ru6) { BlueprintMediaServisEntity entities = new BlueprintMediaServisEntity(); var boardMemberTheUpdate = entities.BoardMembers.Where(w => w.id == valuesEntity.id).FirstOrDefault(); if (image_tr6 != null) { string imagePath = Path.Combine(Server.MapPath("~/Images"), Path.GetFileName(image_tr6.FileName)); boardMemberTheUpdate.image_tr = ConvertByte(imagePath, image_tr6); } if (image_en6 != null) { string imagePath = Path.Combine(Server.MapPath("~/Images"), Path.GetFileName(image_en6.FileName)); boardMemberTheUpdate.image_en = ConvertByte(imagePath, image_en6); } if (image_ru6 != null) { string imagePath = Path.Combine(Server.MapPath("~/Images"), Path.GetFileName(image_ru6.FileName)); boardMemberTheUpdate.image_ru = ConvertByte(imagePath, image_ru6); } if (boardMemberTheUpdate != null) { boardMemberTheUpdate.imageName_tr = valuesEntity.imageName_tr; boardMemberTheUpdate.imageName_en = valuesEntity.imageName_en; boardMemberTheUpdate.imageName_ru = valuesEntity.imageName_ru; boardMemberTheUpdate.name_tr = valuesEntity.name_tr; boardMemberTheUpdate.content_tr = valuesEntity.content_tr; boardMemberTheUpdate.position_tr = valuesEntity.position_tr; boardMemberTheUpdate.name_en = valuesEntity.name_en; boardMemberTheUpdate.content_en = valuesEntity.content_en; boardMemberTheUpdate.position_en = valuesEntity.position_en; boardMemberTheUpdate.name_ru = valuesEntity.name_ru; boardMemberTheUpdate.content_ru = valuesEntity.content_ru; boardMemberTheUpdate.position_ru = valuesEntity.position_ru; entities.SaveChanges(); Session["status"] = "success"; } else { Session["status"] = "itemNotFound"; } return(RedirectToAction("Index")); }
public ActionResult Insert(BoardMembers boardMembersEntity, HttpPostedFileBase image_tr7, HttpPostedFileBase image_en7, HttpPostedFileBase image_ru7) { if (image_tr7 != null) { string imagePath_tr = Path.Combine(Server.MapPath("~/Images"), Path.GetFileName(image_tr7.FileName)); boardMembersEntity.image_tr = ConvertByte(imagePath_tr, image_tr7); } if (image_en7 != null) { string imagePath_en = Path.Combine(Server.MapPath("~/Images"), Path.GetFileName(image_en7.FileName)); boardMembersEntity.image_en = ConvertByte(imagePath_en, image_en7); } if (image_ru7 != null) { string imagePath_ru = Path.Combine(Server.MapPath("~/Images"), Path.GetFileName(image_ru7.FileName)); boardMembersEntity.image_ru = ConvertByte(imagePath_ru, image_ru7); } if (boardMembersEntity.name_tr == null || boardMembersEntity.name_en == null || boardMembersEntity.name_ru == null) { Session["entity"] = boardMembersEntity; Session["status"] = "missingname"; } else if (boardMembersEntity.position_tr == null || boardMembersEntity.position_en == null || boardMembersEntity.position_ru == null) { Session["entity"] = boardMembersEntity; Session["status"] = "missingPosition"; } else if (boardMembersEntity.content_tr == null || boardMembersEntity.content_en == null || boardMembersEntity.content_ru == null) { Session["entity"] = boardMembersEntity; Session["status"] = "missingContent"; } else { BlueprintMediaServisEntity entities = new BlueprintMediaServisEntity(); boardMembersEntity.createTime = DateTime.Now; entities.BoardMembers.Add(boardMembersEntity); entities.SaveChanges(); Session["status"] = "success"; } return(RedirectToAction("Index")); }
public ActionResult DeleteValue(int id) { BlueprintMediaServisEntity entity = new BlueprintMediaServisEntity(); BoardMembers boardMembersEntity = entity.BoardMembers.Find(id); if (boardMembersEntity != null) { BoardMembers boardMembers = entity.BoardMembers.Find(boardMembersEntity.id); entity.BoardMembers.Remove(boardMembers); entity.SaveChanges(); Session["status"] = "deleted"; return(RedirectToAction("Index")); } else { Session["status"] = "itemNotFound"; } return(RedirectToAction("Index")); }