private void VideoUpdate_Click(object sender, EventArgs e) { //record to update the data of the video if (!VideoPkID.Text.ToString().Equals("") && !VideoName.Text.ToString().Equals("") && !VideoRatting.Text.ToString().Equals("") && !VideoDate.Text.ToString().Equals("") && !VideoCopies.Text.ToString().Equals("")) { //create the instance of the class file VideoClass obj_Video = new VideoClass(); //calling the method and pasing the argument if (obj_Video.VideoUdpate(Convert.ToInt32(VideoPkID.Text.ToString()), VideoName.Text.ToString(), VideoRatting.Text.ToString(), Convert.ToInt32(VideoDate.Text.ToString()), Convert.ToInt32(VideoCost.Text.ToString()), Convert.ToInt32(VideoCopies.Text.ToString())) == 1) { MessageBox.Show("Video Data is Updated "); //reset the boxes VideoPkID.Text = ""; VideoName.Text = ""; VideoRatting.Text = ""; VideoDate.Text = ""; VideoCost.Text = ""; VideoCopies.Text = ""; } else { MessageBox.Show("Check details once "); } } else { MessageBox.Show("Fill all the details of the record to update "); } }
private void VideoDelete_Click(object sender, EventArgs e) { if (!VideoPkID.Text.ToString().Equals("")) { VideoClass obj_Video = new VideoClass(); if (obj_Video.VideoDelete(Convert.ToInt32(VideoPkID.Text.ToString())) == 1) { MessageBox.Show("Video is deleted from the POrtal "); } else { MessageBox.Show("Video is already issued on Rent "); } VideoPkID.Text = ""; VideoName.Text = ""; VideoRatting.Text = ""; VideoDate.Text = ""; VideoCost.Text = ""; VideoCopies.Text = ""; } else { MessageBox.Show("Check the Id Once or Select the Id first "); } }
private void VideoAdd_Click(object sender, EventArgs e) { try { if (!VideoName.Text.ToString().Equals("") && !VideoRatting.Text.ToString().Equals("") && !VideoDate.Text.ToString().Equals("") && !VideoCopies.Text.ToString().Equals("")) { VideoClass obj_Video = new VideoClass(); if (obj_Video.AddVideo(VideoName.Text, VideoRatting.Text, Convert.ToInt32(VideoDate.Text.ToString()), Convert.ToInt32(VideoCopies.Text.ToString())) == 1) { MessageBox.Show("Video is SAved "); VideoName.Text = ""; VideoRatting.Text = ""; VideoDate.Text = ""; VideoCost.Text = ""; VideoCopies.Text = ""; } else { MessageBox.Show("Check your details once again "); } } } catch (Exception ex) { MessageBox.Show("Verify the Details Once "); } }
private void PopularVideo_Click(object sender, EventArgs e) { //print the name of the popular video VideoClass obj_video = new VideoClass(); obj_video.popularVideo(); }
private void VideoData_Click(object sender, EventArgs e) { VideoClass obj = new VideoClass(); obj.VideoData(dataGridView2); optn = 1; }