Ejemplo n.º 1
0
        //SELECT EVENTTITLE,VenueName,StreetAddress,City,StateProvision,ZipCode FROM Event INNER JOIN Venue ON EVENT.VenueID = Venue.VenueID WHERE EventSPID='E03061304390215'
        public EventVenueModel GetEventVenueModelDetails(string EventID)
        {
            try
            {
                string sql = "SELECT EVENTTITLE,ImagePath,EventDate,EventFromTime,EventToTime, VenueName,StreetAddress,City,StateProvision,ZipCode FROM Event INNER JOIN Venue ON EVENT.VenueID = Venue.VenueID INNER JOIN EventTimeDetails ON EVENT.EventSPID = EventTimeDetails.EventSPID WHERE EVENT.EventSPID='" + EventID + "'";

                EventVenueModel _eventVenueModel = new EventVenueModel();

                using (SqlConnection conn = new SqlConnection(ConnString))
                {
                    using (SqlCommand cmdDel = new SqlCommand(sql, conn))
                    {
                        conn.Open();
                        SqlDataReader dr = cmdDel.ExecuteReader();

                        while (dr.Read())
                        {
                            _eventVenueModel.EventName = dr["EVENTTITLE"].ToString();
                            _eventVenueModel.EventToTime = dr["EventToTime"].ToString();
                            _eventVenueModel.EventFromTime = dr["EventFromTime"].ToString();
                            _eventVenueModel.EventDate = dr["EventDate"].ToString();
                            _eventVenueModel.EventImage = dr["ImagePath"].ToString();
                            _eventVenueModel.VenueName = dr["VenueName"].ToString();
                            _eventVenueModel.StreetAddress = dr["StreetAddress"].ToString();
                            _eventVenueModel.City = dr["City"].ToString();
                            _eventVenueModel.StateProvision = dr["StateProvision"].ToString();
                            _eventVenueModel.ZipCode = dr["ZipCode"].ToString();
                        }
                    }
                }

                return _eventVenueModel;
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Ejemplo n.º 2
0
        protected void GetVenueEventDetails()
        {
            try
            {
                EventVenueViewModel _eventVenueViewModel = new EventVenueViewModel();
                EventVenueModel _eventVenueModel = new EventVenueModel();

                _eventVenueModel = _eventVenueViewModel.GetEventVenueModelDetails(EID);

                if (_eventVenueModel != null)
                {
                    EvtImage.Src = _eventVenueModel.EventImage;
                    lblEventName.Text = _eventVenueModel.EventName;
                    lblStreetAddress.Text = _eventVenueModel.StreetAddress;
                    lblCity.Text = _eventVenueModel.City;
                    lblState.Text = _eventVenueModel.StateProvision;
                    lblZip.Text = _eventVenueModel.ZipCode;
                    lblDateTime.Text = Convert.ToDateTime(_eventVenueModel.EventDate).ToString("dd/MMM/yyyy") + " " + Convert.ToDateTime(_eventVenueModel.EventFromTime).ToString("HH:mm");// +" - " + Convert.ToDateTime(_eventVenueModel.EventToTime).ToString("HH:mm"); //-kk
                    lblVenueName.Text = _eventVenueModel.VenueName;

                }

            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);
            }
        }