Beispiel #1
0
 private void FillControls()
 {
     try
     {
         SqlDataReader sqldr = sellMenthod.dtb_SellGoodsFind(this.dataGridView1[0, this.dataGridView1.CurrentCell.RowIndex].Value.ToString());
         sqldr.Read();
         if (sqldr.HasRows)
         {
             txtSellID.Text        = sqldr[0].ToString();
             txtSellID.Enabled     = false;
             txtEmpID.Text         = sqldr[3].ToString();
             txtGoodsName.Text     = sqldr[4].ToString();
             txtSellGoodsNum.Text  = sqldr[5].ToString();
             DaSellGoodsTime.Value = Convert.ToDateTime(sqldr[6].ToString());
             txtSellRemark.Text    = sqldr[10].ToString();
             txtdeSellPrice.Text   = sqldr[7].ToString();
             txSellNeedPay.Text    = sqldr[8].ToString();
             txtdeSellHasPay.Text  = sqldr[9].ToString();
         }
         sqldr.Close();
     }
     catch (Exception ee)
     {
         MessageBox.Show(ee.ToString());
     }
 }
Beispiel #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (treeView1.SelectedNode.Text != "商品销售信息")
            {
                if (treeView1.SelectedNode.Parent.Text == "商品销售信息")
                {
                    frmGoodsInfo      frmth  = (frmGoodsInfo)this.Owner;
                    _SellGoodsMenthod tbsell = new _SellGoodsMenthod();
                    SqlDataReader     dr     = tbsell.dtb_SellGoodsFind(treeView1.SelectedNode.Text);
                    dr.Read();
                    if (dr.HasRows)
                    {
                        frmth.txtSellID.Text      = dr[0].ToString();
                        frmth.txtThGoodsName.Text = dr[4].ToString();
                        frmth.goodid = dr[2].ToString();
                        frmth.Kcid   = dr[1].ToString();

                        frmth.txtDataTime.Text = dr[6].ToString();
                        frmth.txtPrice.Text    = dr[7].ToString();
                        frmth.txtnum.Text      = Convert.ToInt32(dr[5].ToString()).ToString();
                        this.Close();
                    }
                    dr.Close();
                }
                else
                {
                    MessageBox.Show("选择商品销售编号!");
                }
            }
        }
        public void fillGet()
        {
            try {
                _SellGoodsMenthod tbsell = new _SellGoodsMenthod();
                SqlDataReader     dr     = tbsell.dtb_SellGoodsFind(this.dataGridView1[1, this.dataGridView1.CurrentCell.RowIndex].Value.ToString());
                dr.Read();
                if (dr.HasRows)
                {
                    txtSellID.Text      = dr[0].ToString();
                    txtThGoodsName.Text = dr[4].ToString();
                    goodid = dr[2].ToString();
                    Kcid   = dr[1].ToString();

                    txtDataTime.Text = dr[6].ToString();
                    txtPrice.Text    = dr[7].ToString();
                    txtnum.Text      = Convert.ToInt32(dr[5].ToString()).ToString();
                }
                dr.Close();
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message.ToString());
            }
        }