コード例 #1
0
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Hide();
            Reader_login f1 = new Reader_login();

            f1.ShowDialog();
        }
コード例 #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection();

            con.ConnectionString = ("Data Source=LAPTOP-KU85F3L5;Initial Catalog=nerds_feed;Integrated Security=True");
            con.Open();
            Reader_login f1 = new Reader_login();
            string       st = "insert into borrows(BOR_NUMBER, READER_ID, DOC_ID, COPY_NO, LIB_ID, BORROW_DATE, RETURN_DATE)" +
                              "values((select(max(BOR_NUMBER) + 1) from BORROWS), 90001, 10002 ,(1 + (select count(*) from borrows where lib_id = 50002  and doc_id = 10002  group by doc_id))," +
                              "50002, getdate(), null);";
            string st1 = "insert into borrows (BOR_NUMBER, READER_ID, DOC_ID,COPY_NO, LIB_ID,BORROW_DATE, RETURN_DATE)" +
                         "values((select(max(BOR_NUMBER) + 1) from BORROWS), @readerid, @docid ,(1 + (select count(*) from borrows where lib_id = @slib  and doc_id = @sdoc  group by doc_id))," +
                         "@libid, getdate(), null) ; ";


            SqlCommand cmd1 = new SqlCommand(st, con);

            //cmd.Parameters.AddWithValue("@readerid", f1.R_id());
            //cmd.Parameters.AddWithValue("@docid", textBox5.Text);
            //cmd.Parameters.AddWithValue("@libid", textBox6.Text);
            //cmd.Parameters.AddWithValue("@slib", textBox6.Text);
            //cmd.Parameters.AddWithValue("@sdoc", textBox5.Text);
            cmd1.ExecuteNonQuery();

            MessageBox.Show("Document Borrowed!");

            con.Close();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            this.Hide();
            Reader_login f1 = new Reader_login();

            f1.ShowDialog();
        }
コード例 #4
0
        private void button8_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection();

            con.ConnectionString = ("Data Source=LAPTOP-KU85F3L5;Initial Catalog=nerds_feed;Integrated Security=True");
            con.Open();
            Reader_login f1 = new Reader_login();

            st = "SELECT * FROM borrows where READER_ID =" + textBox7.Text;    //f1.R_id();

            SqlDataAdapter sqlDA = new SqlDataAdapter(st, con);
            DataTable      dtbl  = new DataTable();

            sqlDA.Fill(dtbl);
            dataGridView1.DataSource = dtbl;
            con.Close();
        }
コード例 #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection();

            con.ConnectionString = ("Data Source=LAPTOP-KU85F3L5;Initial Catalog=nerds_feed;Integrated Security=True");
            con.Open();
            Reader_login f1 = new Reader_login();
            string       st = "UPDATE BORROWS SET RETURN_DATE = GETDATE() WHERE BOR_NUMBER =" + textBox4.Text; // 60001; ";



            SqlCommand cmd1 = new SqlCommand(st, con);

            //cmd.Parameters.AddWithValue("@readerid", f1.R_id());
            //cmd.Parameters.AddWithValue("@docid", textBox5.Text);
            //cmd.Parameters.AddWithValue("@libid", textBox6.Text);
            //cmd.Parameters.AddWithValue("@slib", textBox6.Text);
            //cmd.Parameters.AddWithValue("@sdoc", textBox5.Text);
            cmd1.ExecuteNonQuery();

            MessageBox.Show("Document Returned!");

            con.Close();
        }