コード例 #1
0
        // GET: TeamView/Delete/5
        public ActionResult Delete(string id)
        {
            TeamViewBusinessLayer t = new TeamViewBusinessLayer();
            TeamView tv             = t.TeamViews.Where(i => i.ID == id).Single();

            return(View(tv));
        }
コード例 #2
0
        public ActionResult Delete(string id, FormCollection collection)
        {
            bool   DidItWork  = false;
            string CrudAction = "Delete";

            try
            {
                TeamViewBusinessLayer bl = new TeamViewBusinessLayer();
                TeamView a = bl.TeamViews.Where(p => p.ID == id).Single();

                StoredProcedureBusinessLayer spbl = new StoredProcedureBusinessLayer();
                DidItWork = spbl.ExecuteStoredProcedure(a, CrudAction, User.Identity.Name);
                if (DidItWork == false)
                {
                    return(Content(string.Format("Error on {0} of {1}. Press back to return and try again", CrudAction, a.GetType().Name)));
                }
                else
                {
                    return(RedirectToAction("Index"));
                }
            }
            catch
            {
                return(View());
            }
        }
コード例 #3
0
        // GET: TeamView
        public ActionResult Index()
        {
            TeamViewBusinessLayer t = new TeamViewBusinessLayer();
            List <TeamView>       ListofTeamViews = t.TeamViews.ToList();

            return(View(ListofTeamViews));
        }