protected void AddArtist() { LoginRegSrvc.LoginRegistrationSrvcClient lrsc = new LoginRegSrvc.LoginRegistrationSrvcClient(); LoginRegSrvc.Artist artist = new LoginRegSrvc.Artist(); artist.ArtistName = tbName.Text; artist.ArtistEmail = tbEmail.Text; if (!tbWebAddr.Text.Equals(null)) { artist.ArtistWebPage = tbWebAddr.Text; } lrsc.NewArtist(artist); }
protected void AddShow() { //Make objects from service LoginRegSrvc.LoginRegistrationSrvcClient lrsc = new LoginRegSrvc.LoginRegistrationSrvcClient(); LoginRegSrvc.Show newShow = new LoginRegSrvc.Show(); LoginRegSrvc.ShowDetail newShowDetail = new LoginRegSrvc.ShowDetail(); //Fill object fields with data from form. newShow.ShowName = tbShowName.Text; newShow.VenueKey = (int)Session["UserKey"]; newShow.ShowDate = calShowDate.SelectedDate; newShow.ShowTicketInfo = tbTicketInfo.Text; newShow.ShowDateEntered = DateTime.Now; //Trying to get artist key LoginRegSrvc.Artist artist = new LoginRegSrvc.Artist(); artist.ArtistName = ddlArtists.SelectedItem.Text; newShowDetail.ArtistKey = Convert.ToInt32(ddlArtists.SelectedValue); try { newShow.ShowTime = TimeSpan.Parse(tbShowTime.Text); newShowDetail.ShowDetailArtistStartTime = TimeSpan.Parse(tbArtistStartTime.Text); } catch { lblError.Text = "Please enter a valid time"; } newShowDetail.ShowDetailAdditional = tbDtlAddtl.Text; bool itWorked = lrsc.NewShow(newShow, newShowDetail, Convert.ToInt32(ddlArtists.SelectedValue)); //Success message if (itWorked) { lblError.Text = "Show Successfully Added"; } }