Exemplo n.º 1
0
        private void EditEventDetails(string EventSPID)
        {
            try
            {
                EventsEntryPageViewModel eventsEntryPageViewModel = new EventsEntryPageViewModel();
                EventMasterModel _eventMasterModel = new EventMasterModel();

                _eventMasterModel = eventsEntryPageViewModel.GetEventDetails(EventSPID);

                if (_eventMasterModel != null)
                {
                    txtEventTitle.Value = _eventMasterModel.EventTitle;
                    txtEventDesc.Value = _eventMasterModel.EventDesc;
                    txtArtist.Value = _eventMasterModel.Artists;
                    txtGenre.Value = _eventMasterModel.Genre;
                    txtEventDate.Value = _eventMasterModel.EventDate;
                    ddEventType.SelectedValue = _eventMasterModel.EventTypeID;
                    GetEventSubType(Convert.ToInt32(_eventMasterModel.EventTypeID));

                    img_prev.Src = _eventMasterModel.ImagePath;
                    imgSmallImg.Src = _eventMasterModel.SmallImagePath;
                    ImgTicketImage.Src = _eventMasterModel.EventLayout;

                    ddEvebtSubType.SelectedValue = _eventMasterModel.EventSubtypeID;
                    ddVenueDetails.SelectedValue = _eventMasterModel.VenueID;
                    hdEventID.Value = _eventMasterModel.EventID;

                    hdImagePath.Value = _eventMasterModel.ImagePath;
                    hdEventImagePath.Value = _eventMasterModel.SmallImagePath;
                    hdTicketImagePath.Value = _eventMasterModel.EventLayout;

                    txtEventDate.Value = Convert.ToDateTime(_eventMasterModel.EventDate).ToString("dd/MMM/yyyy");
                }

                EventTimeDetailsModel _eventTimeDetailsModel = new EventTimeDetailsModel();
                _eventTimeDetailsModel = eventsEntryPageViewModel.GetEventTimeDetails(EventSPID);

                if (_eventTimeDetailsModel != null)
                {
                    txtFromTime.Value = _eventTimeDetailsModel.EventFromTime.ToString("HH:mm");
                    txtTotTime.Value = _eventTimeDetailsModel.EventToTime.ToString("HH:mm");
                    EventTimeID.Value = _eventTimeDetailsModel.EventTimeID.ToString();
                }

                List<EventPriceDetailsModel> _eventPriceDetailsModel = new List<EventPriceDetailsModel>();
                _eventPriceDetailsModel = eventsEntryPageViewModel.GetEventPriceDetails(EventSPID);

                int i = 1;

                if (_eventPriceDetailsModel != null)
                {
                    foreach (var item in _eventPriceDetailsModel)
                    {
                        if (i == 1)
                        {
                            EPID1.Value = item.EventPriceID;
                            txtTicketType1.Value = item.EventPriceDetails;
                            txtTotalSeat1.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice1.Value = item.EventPrice;
                        }

                        if (i == 2)
                        {
                            EPID2.Value = item.EventPriceID;
                            txtTicketType2.Value = item.EventPriceDetails;
                            txtTotalSeat2.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice2.Value = item.EventPrice;
                        }

                        if (i == 3)
                        {
                            EPID3.Value = item.EventPriceID;
                            txtTicketType3.Value = item.EventPriceDetails;
                            txtTotalSeat3.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice3.Value = item.EventPrice;
                        }

                        if (i == 4)
                        {
                            EPID4.Value = item.EventPriceID;
                            txtTicketType4.Value = item.EventPriceDetails;
                            txtTotalSeat4.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice4.Value = item.EventPrice;
                        }

                        if (i == 5)
                        {
                            EPID5.Value = item.EventPriceID;
                            txtTicketType5.Value = item.EventPriceDetails;
                            txtTotalSeat5.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice5.Value = item.EventPrice;
                        }

                        if (i == 6)
                        {
                            EPID6.Value = item.EventPriceID;
                            txtTicketType6.Value = item.EventPriceDetails;
                            txtTotalSeat6.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice6.Value = item.EventPrice;
                        }

                        if (i == 7)
                        {
                            EPID7.Value = item.EventPriceID;
                            txtTicketType7.Value = item.EventPriceDetails;
                            txtTotalSeat7.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice7.Value = item.EventPrice;
                        }

                        if (i == 8)
                        {
                            EPID8.Value = item.EventPriceID;
                            txtTicketType8.Value = item.EventPriceDetails;
                            txtTotalSeat8.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice8.Value = item.EventPrice;
                        }

                        if (i == 9)
                        {
                            EPID9.Value = item.EventPriceID;
                            txtTicketType9.Value = item.EventPriceDetails;
                            txtTotalSeat9.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice9.Value = item.EventPrice;
                        }

                        if (i == 10)
                        {
                            EPID10.Value = item.EventPriceID;
                            txtTicketType10.Value = item.EventPriceDetails;
                            txtTotalSeat10.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice10.Value = item.EventPrice;
                        }

                        if (i == 11)
                        {
                            EPID11.Value = item.EventPriceID;
                            txtTicketType11.Value = item.EventPriceDetails;
                            txtTotalSeat11.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice11.Value = item.EventPrice;
                        }

                        if (i == 12)
                        {
                            EPID12.Value = item.EventPriceID;
                            txtTicketType12.Value = item.EventPriceDetails;
                            txtTotalSeat12.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice12.Value = item.EventPrice;
                        }

                        if (i == 13)
                        {
                            EPID13.Value = item.EventPriceID;
                            txtTicketType13.Value = item.EventPriceDetails;
                            txtTotalSeat13.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice13.Value = item.EventPrice;
                        }

                        if (i == 14)
                        {
                            EPID14.Value = item.EventPriceID;
                            txtTicketType14.Value = item.EventPriceDetails;
                            txtTotalSeat14.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice14.Value = item.EventPrice;
                        }

                        if (i == 15)
                        {
                            EPID15.Value = item.EventPriceID;
                            txtTicketType15.Value = item.EventPriceDetails;
                            txtTotalSeat15.Value = item.EventTotalSeat.ToString();
                            txtTicketPrice15.Value = item.EventPrice;
                        }

                        i++;
                    }
                }

                btnSave.Visible = false;
                btnUpdate.Visible = true;
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message);
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script language='javascript'>");
                sb.Append(@"alert('Error : " + ex.Message + "')");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Error", sb.ToString(), false);
            }
        }
Exemplo n.º 2
0
        private void EditEventDetails(string EventSPID)
        {
            EventsEntryPageViewModel eventsEntryPageViewModel = new EventsEntryPageViewModel();
            EventMasterModel _eventMasterModel = new EventMasterModel();

            _eventMasterModel = eventsEntryPageViewModel.GetEventDetails(EventSPID);

            if (_eventMasterModel != null)
            {
                txtEventTitle.Value = _eventMasterModel.EventTitle;
                txtEventDesc.Value = _eventMasterModel.EventDesc;
                txtArtist.Value = _eventMasterModel.Artists;
                txtGenre.Value = _eventMasterModel.Genre;
                txtEventDate.Value = _eventMasterModel.EventDate;
                ddEventType.SelectedValue= _eventMasterModel.EventTypeID;
                GetEventSubType(Convert.ToInt32(_eventMasterModel.EventTypeID));

                img_prev.Src = _eventMasterModel.ImagePath;
                imgSmallImg.Src = _eventMasterModel.SmallImagePath;
                ImgTicketImage.Src = _eventMasterModel.EventLayout;

                ddEvebtSubType.SelectedValue = _eventMasterModel.EventSubtypeID;
                ddVenueDetails.SelectedValue = _eventMasterModel.VenueID;
                hdEventID.Value = _eventMasterModel.EventID;

                hdImagePath.Value = _eventMasterModel.ImagePath;
                hdEventImagePath.Value = _eventMasterModel.SmallImagePath;
                hdTicketImagePath.Value = _eventMasterModel.EventLayout;

                txtEventDate.Value = Convert.ToDateTime(_eventMasterModel.EventDate).ToString("dd/MMM/yyyy");
            }

            EventTimeDetailsModel _eventTimeDetailsModel = new EventTimeDetailsModel();
            _eventTimeDetailsModel = eventsEntryPageViewModel.GetEventTimeDetails(EventSPID);

            if (_eventTimeDetailsModel != null)
            {
                txtFromTime.Value = _eventTimeDetailsModel.EventFromTime.ToString("HH:mm");
                txtTotTime.Value = _eventTimeDetailsModel.EventToTime.ToString("HH:mm");
                EventTimeID.Value = _eventTimeDetailsModel.EventTimeID.ToString();
            }

            List<EventPriceDetailsModel> _eventPriceDetailsModel = new List<EventPriceDetailsModel>();
            _eventPriceDetailsModel = eventsEntryPageViewModel.GetEventPriceDetails(EventSPID);

            int i = 1;

            if (_eventPriceDetailsModel != null)
            {
                foreach (var item in _eventPriceDetailsModel)
                {
                    if (i == 1)
                    {
                        EPID1.Value = item.EventPriceID;
                        txtTicketType1.Value = item.EventPriceDetails;
                        txtTotalSeat1.Value = item.EventTotalSeat.ToString();
                        txtTicketPrice1.Value = item.EventPrice;
                    }

                    if (i == 2)
                    {
                        EPID2.Value = item.EventPriceID;
                        txtTicketType2.Value = item.EventPriceDetails;
                        txtTotalSeat2.Value = item.EventTotalSeat.ToString();
                        txtTicketPrice2.Value = item.EventPrice;
                    }

                    if (i == 3)
                    {
                        EPID3.Value = item.EventPriceID;
                        txtTicketType3.Value = item.EventPriceDetails;
                        txtTotalSeat3.Value = item.EventTotalSeat.ToString();
                        txtTicketPrice3.Value = item.EventPrice;
                    }

                    if (i == 4)
                    {
                        EPID4.Value = item.EventPriceID;
                        txtTicketType4.Value = item.EventPriceDetails;
                        txtTotalSeat4.Value = item.EventTotalSeat.ToString();
                        txtTicketPrice4.Value = item.EventPrice;
                    }

                    i++;
                }
            }

            btnSave.Visible = false;
            btnUpdate.Visible = true;
        }