Beispiel #1
0
        public void Remove(StartUpIdea entity)
        {
            var obj = context.StartUpIdeas.Find(entity.Id);

            context.StartUpIdeas.Remove(obj);
            context.SaveChanges();
        }
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here
                StartUpIdeaViewModel startUpUdeaVM = new StartUpIdeaViewModel();
                StartUpIdea          si            = new StartUpIdea();


                si.ProjectName        = collection["ProjectName"];
                si.ProjectDescription = collection["ProjectDescription"];
                si.FirstName          = collection["FirstName"];
                si.LastName           = collection["LastName"];
                si.Email            = collection["Email"];
                si.SubmitedDateTime = DateTime.Now;
                si.UpdatedDateTime  = DateTime.Now;

                _repository.Add(si);



                return(RedirectToAction("Submit"));
            }
            catch (Exception e)
            {
                ViewBag.ErrMsg = e.Message + ":" + e.InnerException;
                return(View("Submit"));
            }
        }
        // GET: SartUpIdeas/Details/5
        public ActionResult Details(int id)
        {
            StartUpIdea si = _repository.Get(id);


            return(View(si));
        }
Beispiel #4
0
 public void Add(StartUpIdea entity)
 {
     context.StartUpIdeas.Add(entity);
     context.SaveChanges();
 }