Exemplo n.º 1
0
        public ActionResult ReturnShadowAuthor(ShadowAuthor shadowAuthor)
        {
            ShadowAuthor toReturn = db.tabShAuthor.Find(shadowAuthor.ShadowId);

            ///
            try
            {
                string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("ShadowReturnAuthor", con);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@ShadowID", toReturn.ShadowId);
                    cmd.Parameters.AddWithValue("@Id", toReturn.Id);

                    con.Open();
                    cmd.ExecuteNonQuery();
                }
            }
            catch (Exception e)
            {
                Response.Write(e.Message);
            }
            ////
            //db.tabBook.Remove(toDelete);
            db.SaveChanges();
            return(RedirectToAction("ShadowAuthor"));
        }
Exemplo n.º 2
0
        public ActionResult ReturnShadowAuthor(int shadowid)
        {
            ShadowAuthor toReturn = db.tabShAuthor.Find(shadowid);

            if (toReturn == null)
            {
                return(new HttpNotFoundResult());
            }
            return(View(toReturn));
        }