Exemplo n.º 1
0
 private void btnAccept_Click(object sender, EventArgs e)
 {
     try
     {
         int             selectedrowindex = dgvView.SelectedCells[0].RowIndex;
         DataGridViewRow selectedRow      = dgvView.Rows[selectedrowindex];
         //MessageBox.Show(selectedRow.Cells[0].Value.ToString());
         if (selectedRow.Cells[0].Value != null && selectedRow.Cells[0].Value.ToString() != string.Empty)
         {
             string             value = selectedRow.Cells[0].Value.ToString();
             BUS._MultiTableBUS bus   = new BUS._MultiTableBUS();
             if (bus.AcceptRequest(value) == true)
             {
                 LoadData();
                 MessageBox.Show("Confirm successful!!!\n Find it at " + bus.stt, "Notification", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show("Confirm fail!!! Please try again later", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 2
0
 private void LoadData()
 {
     BUS._MultiTableBUS bus = new BUS._MultiTableBUS();
     bsItem.DataSource        = bus.SelectRequestByUserIDAndStatus(this.userID, "0");
     dgvView.DataSource       = bsItem;
     bnItemList.BindingSource = bsItem;
 }
        private void LoadData()
        {
            BUS._MultiTableBUS bus   = new BUS._MultiTableBUS();
            string             title = txtSearch.Text;

            bsItem.DataSource        = bus.SelectBookTitleWithTitleOrAuthorNameOrCategoryName("", "", "");
            dgvSearch.DataSource     = bsItem;
            bnItemList.BindingSource = bsItem;
            this.dgvSearch.Columns["AuthorID"].Visible   = false;
            this.dgvSearch.Columns["CategoryID"].Visible = false;
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            BUS._MultiTableBUS bus          = new BUS._MultiTableBUS();
            string             title        = txtSearch.Text;
            string             authorName   = "@@@";
            string             categoryName = "@@@";

            if (chbAuthor.Checked)
            {
                authorName = title;
            }
            if (chbCategory.Checked)
            {
                categoryName = title;
            }
            bsItem.DataSource        = bus.SelectBookTitleWithTitleOrAuthorNameOrCategoryName(title, authorName, categoryName);
            dgvSearch.DataSource     = bsItem;
            bnItemList.BindingSource = bsItem;
            this.dgvSearch.Columns["AuthorID"].Visible   = false;
            this.dgvSearch.Columns["CategoryID"].Visible = false;
        }
        private void btnAdvanceSearch_Click(object sender, EventArgs e)
        {
            var form = new frmFunc_AdvanceSearch();

            form.MdiParent = this.MdiParent;
            form.Show();
            form.FormClosing += (object sender1, FormClosingEventArgs ee) =>
            {
                if (form.DialogResult == DialogResult.OK)
                {
                    string             title        = form.bookTitle;
                    string             authorName   = form.authorName;
                    string             categoryName = form.categoryName;
                    BUS._MultiTableBUS bus          = new BUS._MultiTableBUS();
                    bsItem.DataSource        = bus.SelectBookTitleWithTitleAndAuthorNameAndCategoryName(title, authorName, categoryName);
                    dgvSearch.DataSource     = bsItem;
                    bnItemList.BindingSource = bsItem;
                    this.dgvSearch.Columns["AuthorID"].Visible   = false;
                    this.dgvSearch.Columns["CategoryID"].Visible = false;
                }
            };
        }