コード例 #1
0
ファイル: Form1.cs プロジェクト: amar751/KW_video_rental
        private void btnVUpdate_Click(object sender, EventArgs e)
        {
            //the code to Update the details of the video for storing the details
            if (!txtVId.Text.ToString().Equals("") && !txtVName.Text.ToString().Equals("") && !txtVRatting.Text.ToString().Equals("") && !txtVYear.Text.ToString().Equals("") && !txtVCopies.Text.ToString().Equals("") && !txtVPlot.Text.ToString().Equals("") && !txtVGenre.Text.ToString().Equals(""))
            {
                Models.Video obj = new Models.Video();
                obj.Update(Convert.ToInt32(txtVId.Text.ToString()), txtVName.Text.ToString(), txtVRatting.Text.ToString(), Convert.ToInt32(txtVYear.Text.ToString()), Convert.ToInt32(txtVCopies.Text.ToString()), txtVPlot.Text.ToString(), txtVGenre.Text.ToString());

                txtVName.Text    = "";
                txtVRatting.Text = "";
                txtVYear.Text    = "";
                txtVCopies.Text  = "";
                txtVPlot.Text    = "";
                txtVGenre.Text   = "";
                txtVId.Text      = "";
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: amar751/KW_video_rental
        private void btnVAdd_Click(object sender, EventArgs e)
        {
            //the code to Insert the details of the video for storing the details
            if (!txtVName.Text.ToString().Equals("") && !txtVRatting.Text.ToString().Equals("") && !txtVYear.Text.ToString().Equals("") && !txtVCopies.Text.ToString().Equals("") && !txtVPlot.Text.ToString().Equals("") && !txtVGenre.Text.ToString().Equals(""))
            {
                Models.Video obj = new Models.Video();
                obj.Add(txtVName.Text.ToString(), txtVRatting.Text.ToString(), Convert.ToInt32(txtVYear.Text.ToString()), Convert.ToInt32(txtVCopies.Text.ToString()), txtVPlot.Text.ToString(), txtVGenre.Text.ToString());

                txtVName.Text    = "";
                txtVRatting.Text = "";
                txtVYear.Text    = "";
                txtVCopies.Text  = "";
                txtVPlot.Text    = "";
                txtVGenre.Text   = "";
            }
            else
            {
                MessageBox.Show("We Must have to fill all the details of the video ");
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: amar751/KW_video_rental
        private void btnVDelete_Click(object sender, EventArgs e)
        {
            //the code to delete the details of the video for storing the details
            if (txtVId.Text.ToString().Equals(""))
            {
                MessageBox.Show("First select the details of the video to delete ");
            }
            else
            {
                Models.Video obj = new Models.Video();
                obj.Delete(Convert.ToInt32(txtVId.Text.ToString()));

                txtVId.Text      = "";
                txtVName.Text    = "";
                txtVRatting.Text = "";
                txtVYear.Text    = "";
                txtVCopies.Text  = "";
                txtVPlot.Text    = "";
                txtVGenre.Text   = "";
            }
        }