コード例 #1
0
        private void btnLuu_Click(object sender, EventArgs e)
        {
            Form f = new FormPass2();

            f.Show();
            MessageBox.Show("Lưu thành công");
            txtMaDocGia2.Enabled = false;
            txtMaSach2.Enabled   = false;
        }
コード例 #2
0
        public void luu1_Click(object sender, EventArgs e)
        {
            Form f = new FormPass2();

            f.Show();
            MessageBox.Show("Xóa thành công");

            //string ngayhh = ngaymuon.Value.ToString("yyyy/MM/dd");//dịnh dạng ngày để insert vào sql
            //string ngayhhh = ngaytra.Value.ToString("yyyy/MM/dd");
            //date1 = Convert.ToDateTime(ngaymuon.Text);//lấy thông tin ngày mượn ngày trả để kiêm tra đk ngày mượn<=ngày trả.
            //date2 = Convert.ToDateTime(ngaytra.Text);
            //time = date2.Subtract(date1);
            //day = time.Days;
            //DataTable dt = t.docdulieu("select * from chitietmuon where masach= N'"+ commasach.Text+ "'");

            //if (dt.Rows.Count==1)
            //{
            //    MessageBox.Show("Sách đã được mượn, vui lòng chọn cuốn khác", "Thông báo");
            //    commasach.Focus();
            //}
            //else if (day<0)
            //{
            //    MessageBox.Show("Lỗi, ngày hẹn trả không hợp lý", "Thông báo");
            //    ngaytra.Focus();

            //}
            //else if (t.thucthidulieu("INSERT INTO chitietmuon VALUES (N'" + commaphieumuon.SelectedValue.ToString() + "','" + commasach.SelectedValue.ToString() + "','" + ngayhh + "','" + ngayhhh + "','" + ghichu.Text + "')") == true)
            //{

            //    MessageBox.Show("Thêm thành công");
            //    loaddata1();
            //}
            //else
            //{
            //    MessageBox.Show("Lỗi không thể thực hiện được");


            //}
        }