Exemple #1
0
        private void SelectValueChange(ElementStruct.Element element)
        {
            SetComboBoxValue();

            //将数据设置出去
            tb_No.Text   = element.eNo;
            tb_Name.Text = element.eName;
            //巨大的bug,死循环
            f_cb_type.Text     = element.eType;
            f_cb_facturer.Text = element.eFacturer;
            f_cb_position.Text = element.ePosition;
            tb_model.Text      = element.eModel;
            tb_package.Text    = element.ePackage;
            tb_price.Text      = element.ePrice + "";
            tb_count.Text      = element.eCount + "";
            tb_createDate.Text = element.eCreateDate;
            tb_modifyDate.Text = element.eModifDate;
            tb_otherInfo.Text  = element.eOtherInfo;
        }
Exemple #2
0
        //加载的时候会执行两次,不知道为什么,不管了
        private void dataGridView_select_SelectionChanged(object sender, EventArgs e)
        {
            k++;
            Console.Out.WriteLine("第一页: " + k);

            if (dataGridView_select.SelectedCells.Count == 0)
            {
                return;
            }
            //获取型号名字
            var eName = dataGridView_select.SelectedCells[0].Value.ToString();

            SelectElementName = eName;
            var dr = rwh.OpenSelectSqlStr("select * from Element where eName = '" + eName + "'");

            if (dr == null)
            {
                MessageBox.Show("异常,未找到名称为 " + eName + " 项");
                return;
            }
            dr.Read();
            var element = new ElementStruct.Element(
                dr["eNo"].ToString(),
                dr["eName"].ToString(),
                dr["eType"].ToString(),
                dr["eFacturer"].ToString(),
                dr["eModel"].ToString(),
                dr["ePackage"].ToString(),
                dr["ePrice"].ToString(),
                dr["eCount"].ToString(),
                dr["eCreateDate"].ToString(),
                dr["eModifyDate"].ToString(),
                dr["ePosition"].ToString(),
                dr["eOtherInfo"].ToString()
                );

            rwh.Close();
            //反正就是把element传出去了
            SelectChange?.Invoke(element);
        }