public bool NewVenue(Venue _venue)
 {
     SqlParameter[] Params = new SqlParameter[]
     {
         new SqlParameter("@VenueCode", _venue.VenueCode),
         new SqlParameter("@VenueName", _venue.VenueName),
         new SqlParameter("@VenueSize",_venue.VenueSize),
     };
     return DataAccess.ExecuteNonQuery("sp_InsertVenue", CommandType.StoredProcedure,
         Params);
 }
 public ActionResult Create(Venue _venue)
 {
     BusinessLogicHandler _gateWay = new BusinessLogicHandler();
     try
     {
         if (_gateWay.InsertVenue(_venue))
         { return RedirectToAction("Index"); }
         else { return View(_venue); }
     }
     catch
     {
         return View(_venue);
     }
 }
        public Venue GetVenue(string VenueCode)
        {
            Venue _venue = null;

            SqlParameter[] Params = { new SqlParameter("@VenueCode", VenueCode) };
            using (DataTable table = DataAccess.ExecuteParamatizedSelectCommand("sp_GetVenue",
                CommandType.StoredProcedure, Params))
            {
                if (table.Rows.Count == 1)
                {
                    DataRow row = table.Rows[0];
                    _venue = new Venue();
                    _venue.VenueSize = Convert.ToInt32(row["VenueSize"]);
                    _venue.VenueCode = row["VenueCode"].ToString();
                    _venue.VenueName = row["VenueName"].ToString();
                }
            }
            return _venue;
        }
        public List<Venue> GetAllVenues()
        {
            List<Venue> _venueList = null;

            using (DataTable table = DataAccess.ExecuteSelectCommand("sp_GetAllVenues",
                CommandType.StoredProcedure))
            {
                if (table.Rows.Count > 0)
                {
                    _venueList = new List<Venue>();
                    foreach (DataRow row in table.Rows)
                    {
                        Venue _module = new Venue();
                        _module.VenueSize = Convert.ToInt32(row["VenueSize"]);
                        _module.VenueCode = row["VenueCode"].ToString();
                        _module.VenueName = row["VenueName"].ToString();
                        _venueList.Add(_module);
                    }
                }
            }
            return _venueList;
        }
 // GET: Venue/Create
 public ActionResult Create()
 {
     Venue _venue = new Venue();
     return View(_venue);
 }
 public bool InsertVenue(Venue _venue)
 {
     VenueHandler myHandler = new VenueHandler(); return myHandler.NewVenue(_venue);
 }