Exemplo n.º 1
0
        //private void btnExportToExcel_Click(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        frmPopup = new Form();
        //        frmPopup.StartPosition = FormStartPosition.CenterScreen;
        //        frmPopup.BackColor = Color.CadetBlue;

        //        frmPopup.MaximizeBox = false;
        //        frmPopup.MinimizeBox = false;
        //        frmPopup.ControlBox = false;
        //        frmPopup.FormBorderStyle = FormBorderStyle.FixedSingle;

        //        frmPopup.Size = new Size(450, 310);
        //        exlv = Utilities.GridColumnSelectionView(grdList);
        //        foreach (ListViewItem item in exlv.Items)
        //        {
        //            if (item.SubItems[1].Text == "ModelNo")
        //            {
        //                exlv.Items.Remove(item);
        //            }
        //            if (item.SubItems[1].Text == "ModelName")
        //            {
        //                exlv.Items.Remove(item);
        //            }
        //        }
        //        exlv.Bounds = new System.Drawing.Rectangle(new System.Drawing.Point(0, 25), new System.Drawing.Size(450, 250));
        //        frmPopup.Controls.Add(exlv);

        //        System.Windows.Forms.Label pnlHeading = new System.Windows.Forms.Label();
        //        pnlHeading.Size = new Size(300, 20);
        //        pnlHeading.Location = new System.Drawing.Point(5, 5);
        //        pnlHeading.Text = "Select Gridview Colums to Export";
        //        pnlHeading.Font = new System.Drawing.Font("Arial", 10, FontStyle.Bold);
        //        pnlHeading.ForeColor = Color.Black;
        //        frmPopup.Controls.Add(pnlHeading);

        //        System.Windows.Forms.Button exlvOK = new System.Windows.Forms.Button();
        //        exlvOK.Text = "OK";
        //        exlvOK.BackColor = Color.Tan;
        //        exlvOK.Location = new System.Drawing.Point(40, 280);
        //        exlvOK.Click += new System.EventHandler(this.exlvOK_Click1);
        //        frmPopup.Controls.Add(exlvOK);

        //        System.Windows.Forms.Button exlvCancel = new System.Windows.Forms.Button();
        //        exlvCancel.Text = "CANCEL";
        //        exlvCancel.BackColor = Color.Tan;
        //        exlvCancel.Location = new System.Drawing.Point(130, 280);
        //        exlvCancel.Click += new System.EventHandler(this.exlvCancel_Click2);
        //        frmPopup.Controls.Add(exlvCancel);

        //        frmPopup.ShowDialog();
        //    }
        //    catch (Exception ex)
        //    {
        //    }
        //}
        //private void exlvCancel_Click2(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        frmPopup.Close();
        //        frmPopup.Dispose();
        //    }
        //    catch (Exception ex)
        //    {
        //    }
        //}

        //private void exlvOK_Click1(object sender, EventArgs e)
        //{
        //    try
        //    {

        //        string heading1 = "Stock report ";
        //        string heading2 = lbldatedisp.Text;
        //        Utilities.export2Excel(heading1, heading2, "", grdList, exlv);
        //        frmPopup.Close();
        //        frmPopup.Dispose();
        //    }
        //    catch (Exception ex)
        //    {
        //        MessageBox.Show("Export to Excell error");
        //    }
        //}
        private void btnSelbank_Click(object sender, EventArgs e)
        {
            frmPopup = new Form();
            frmPopup.StartPosition = FormStartPosition.CenterScreen;
            frmPopup.BackColor     = Color.CadetBlue;

            frmPopup.MaximizeBox     = false;
            frmPopup.MinimizeBox     = false;
            frmPopup.ControlBox      = false;
            frmPopup.FormBorderStyle = FormBorderStyle.FixedSingle;

            frmPopup.Size = new Size(450, 300);
            lv            = BREntryDB.getBankAccountCodeListView();
            lv.Bounds     = new Rectangle(new Point(0, 0), new Size(450, 250));
            frmPopup.Controls.Add(lv);

            Button lvOK = new Button();

            lvOK.Text     = "OK";
            lvOK.Location = new Point(40, 265);
            lvOK.Click   += new System.EventHandler(this.lvOK_Click3);
            frmPopup.Controls.Add(lvOK);

            Button lvCancel = new Button();

            lvCancel.Text     = "Cancel";
            lvCancel.Location = new Point(130, 265);
            lvCancel.Click   += new System.EventHandler(this.lvCancel_Click3);
            frmPopup.Controls.Add(lvCancel);
            frmPopup.ShowDialog();
        }
Exemplo n.º 2
0
        private void showBankLIstView()
        {
            try
            {
                removeControlsFromlvPanel();
                pnllv             = new Panel();
                pnllv.BorderStyle = BorderStyle.FixedSingle;

                pnllv.Bounds    = new Rectangle(new Point(24, 32), new Size(477, 282));
                lv              = BREntryDB.getBankAccountCodeListView();
                lv.ColumnClick += new ColumnClickEventHandler(LvColumnClick);
                //this.lv.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listView1_ItemChecked3);
                lv.Bounds = new Rectangle(new Point(17, 14), new Size(443, 212));
                pnllv.Controls.Add(lv);

                Button lvOK = new Button();
                lvOK.Text     = "OK";
                lvOK.Location = new Point(44, 246);
                lvOK.Click   += new System.EventHandler(this.lvOK_Click3);
                pnllv.Controls.Add(lvOK);

                Button lvCancel = new Button();
                lvCancel.Text     = "Cancel";
                lvCancel.Location = new Point(141, 246);
                lvCancel.Click   += new System.EventHandler(this.lvCancel_Click3);
                pnllv.Controls.Add(lvCancel);

                Label lblSearch = new Label();
                lblSearch.Text     = "Find";
                lblSearch.Location = new Point(260, 250);
                lblSearch.Size     = new Size(37, 15);
                pnllv.Controls.Add(lblSearch);

                txtSearch              = new TextBox();
                txtSearch.Location     = new Point(303, 246);
                txtSearch.TextChanged += new EventHandler(txtSearch_TextChanged);
                pnllv.Controls.Add(txtSearch);

                pnlList.Controls.Add(pnllv);
                pnllv.BringToFront();
                pnllv.Visible = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
            }
        }