コード例 #1
0
        private void BindColor()
        {
            string sql = "select ColorNo,ColorName from tb_ColorInfo where fisstop = 0 ";

            ds = dbl.GetDatasetReport(sql, "tb_ColorInfo");
            List <string> listArr = new List <string>();

            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    cmbColor.DataSource    = ds.Tables[0];
                    cmbColor.DisplayMember = "ColorName";
                    cmbColor.ValueMember   = "ColorNo";
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        //this.lbgoods.Visible = true;
                        //this.lbgoods.Items.Clear();
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            listArr.Add(ds.Tables[0].Rows[i][1].ToString());
                            //tbmodelno.Items.Add(ds.Tables[0].Rows[i][1].ToString());
                        }
                    }
                    string[] myarr = listArr.ToArray();
                    //cbgoods.AutoCompleteCustomSource.AddRange(myarr);
                    //cbgoods.AutoCompleteSource = AutoCompleteSource.CustomSource;
                    //cbgoods.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
                    cmbColor.AutoCompleteCustomSource.AddRange(myarr);
                    cmbColor.AutoCompleteSource = AutoCompleteSource.CustomSource;
                    cmbColor.AutoCompleteMode   = AutoCompleteMode.SuggestAppend;
                }
            }
        }
コード例 #2
0
        private void frmBorrowReport_Load(object sender, EventArgs e)
        {
            ReportDocument rd = new ReportDocument();

            rd.Load("LibraryReport1.rpt");
            string strSql = "SELECT CardId,BookID,BookName,Author,Publisher,Price,BorrowDate,SpilthDay FROM Borrow";
            Dblink db     = new Dblink();
            //以SQL语句为参数,产生一个Dataset
            DataSet   dsTemp = db.GetDatasetReport(strSql, "Borrow");
            DataTable dt     = new DataTable();

            dt = dsTemp.Tables[0];
            rd.SetDataSource(dt);
            crystalReportViewer1.ReportSource = rd;
        }
コード例 #3
0
        public RoleComboxControl()
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select FBaseID,FBaseName from tb_base where FClass =  'Role' order by FBaseID";

            ds = dbl.GetDatasetReport(sql, "tb_base");
            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    DataSource    = ds.Tables[0];
                    DisplayMember = "FBaseName";
                    ValueMember   = "FBaseID";
                }
            }
        }
コード例 #4
0
        public WareComboxControl()
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select WareID,WareName from tb_WareHouse order by WareID";

            ds = dbl.GetDatasetReport(sql, "tb_base");
            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    DataSource    = ds.Tables[0];
                    DisplayMember = "WareName";
                    ValueMember   = "WareID";
                }
            }
        }
コード例 #5
0
        public ColorComboxControl()
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select ColorNo,ColorName from tb_ColorInfo where fisstop = 0  order by ColorNo";

            ds = dbl.GetDatasetReport(sql, "tb_base");
            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    DataSource    = ds.Tables[0];
                    DisplayMember = "ColorName";
                    ValueMember   = "ColorNo";
                }
            }
        }
コード例 #6
0
        public BaseGroupComboxControl()
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select Groupid,Name from BaseGroup where isstop = 0 order by Groupid";

            ds = dbl.GetDatasetReport(sql, "BaseGroup");
            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    DataSource    = ds.Tables[0];
                    DisplayMember = "Name";
                    ValueMember   = "Groupid";
                }
            }
        }
コード例 #7
0
        public static void SetCombox(string _class, ComboBoxEx _control)
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select FBaseID,FBaseName from tb_base where FClass =  '" + _class + "' order by FBaseID";

            ds = dbl.GetDatasetReport(sql, "tb_base");
            List <string> listArr = new List <string>();

            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    _control.DataSource    = ds.Tables[0];
                    _control.DisplayMember = "FBaseName";
                    _control.ValueMember   = "FBaseID";
                }
            }
        }
コード例 #8
0
ファイル: BaseGroupMethod.cs プロジェクト: Alencc2015/Myc-
        public static void SetGrpCombox(ComboBoxEx _control)
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select GroupId,Name from BaseGroup where isstop =  0 order by GroupId";

            ds = dbl.GetDatasetReport(sql, "BaseGroup");
            List <string> listArr = new List <string>();

            if (ds != null)
            {
                if (ds.Tables.Count > 0)
                {
                    _control.DataSource    = ds.Tables[0];
                    _control.DisplayMember = "Name";
                    _control.ValueMember   = "GroupId";
                }
            }
        }
コード例 #9
0
        public static void SetCombox(ComboBoxEx _control)
        {
            DataSet ds  = new DataSet();
            Dblink  dbl = new Dblink();
            string  sql = "select EmpId,EmpName from tb_empinfo where Active= 1";

            ds = dbl.GetDatasetReport(sql, "tb_EmpInfo");
            List <string> listArr = new List <string>();

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    _control.DataSource    = ds.Tables[0];
                    _control.DisplayMember = "EmpName";
                    _control.ValueMember   = "EmpId";
                }
            }
        }