Пример #1
0
        public ActionResult EditContact(int contactID)
        {
            DbConnection conn = new DbConnection();

            conn.SqlCommand.Connection.Open();

            ContactLogic contactlogic = new ContactLogic();

            conn.Reader = contactlogic.GetContactByID(conn, contactID);

            if (!conn.Reader.HasRows)
            {
                ViewData["Message"] = String.Format("Contact with ID {0} does not exist", contactID);

                return(View("Messages"));
            }

            Contact contact = contactlogic.GetContactFromSqlDataReader(conn.Reader);

            conn.SqlCommand.Connection.Close();

            return(View(contact));
        }