供应商信息.cs

来自「进存销系统..适合书店的进销存..功能可以满足一般的需求.很简单」· CS 代码 · 共 44 行

CS
44
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BookStore.Forms
{
    public partial class SuppliersInfo : Form
    {
        DataSet ds = new DataSet();
        string select = "select * from Suppliers";
        public SuppliersInfo()
        {
            InitializeComponent();
            ds = DataAccess.Narnu.GetDataSetBySqlString(select);
            this.dg_SuppliersInfo.DataSource = ds.Tables[0];
        }

        //----------其他窗体调用,双击选择供应商信息并回送到调用的窗体-------------
        private void dg_SuppliersInfo_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (this.dg_SuppliersInfo.ReadOnly == true)
            {
                int intCurrentRowNumber = this.dg_SuppliersInfo.CurrentCell.RowNumber;//当前单元格的行数
                string SendStockID, SendStockName;
                SendStockID = this.dg_SuppliersInfo[intCurrentRowNumber, 0].ToString().Trim();
                SendStockName = this.dg_SuppliersInfo[intCurrentRowNumber, 1].ToString().Trim();
                string[] sendArry = new string[] { SendStockID, SendStockName };
                StockTable.supplierArray[0] = sendArry[0];
                StockTable.supplierArray[1] = sendArry[1];
                this.Close();
            }
        }

        public void DataGridReadOnly()
        {
            this.dg_SuppliersInfo.ReadOnly = true;
        }
       
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?