Example #1
0
        void ModData()
        {
            if (dgvMain.CurrentRow != null)
            {
                FormGoodsItem dlg = new FormGoodsItem();
                dlg.m_GoodsItem.GoodsID            = Convert.ToInt32(dgvMain.CurrentRow.Cells["ColumnGoodsID"].Value);
                dlg.m_GoodsItem.GoodsSubClassifyID = Convert.ToInt32(dgvMain.CurrentRow.Cells["ColumnGoodsSubClassifyID"].Value);

                dlg.m_GoodsItem.Cost             = Convert.ToDouble(dgvMain.CurrentRow.Cells["ColumnCost"].Value);
                dlg.m_GoodsItem.Deduct           = Convert.ToDouble(dgvMain.CurrentRow.Cells["ColumnDeduct"].Value);
                dlg.m_GoodsItem.GoodsCode        = dgvMain.CurrentRow.Cells["ColumnGoodsCode"].Value.ToString();
                dlg.m_GoodsItem.GoodsName        = dgvMain.CurrentRow.Cells["ColumnGoodsName"].Value.ToString();
                dlg.m_GoodsItem.GoodsNO          = dgvMain.CurrentRow.Cells["ColumnGoodsNO"].Value.ToString();
                dlg.m_GoodsItem.Integral         = Convert.ToDouble(dgvMain.CurrentRow.Cells["ColumnIntegral"].Value);
                dlg.m_GoodsItem.IsCurrentPrice   = Convert.ToInt32(dgvMain.CurrentRow.Cells["ColumnIsCurrentPrice"].Value);
                dlg.m_GoodsItem.PinYin           = dgvMain.CurrentRow.Cells["ColumnPinYin"].Value.ToString();
                dlg.m_GoodsItem.Unit             = dgvMain.CurrentRow.Cells["ColumnUnit"].Value.ToString();
                dlg.m_GoodsItem.UnitPrice        = Convert.ToDouble(dgvMain.CurrentRow.Cells["ColumnUnitPrice"].Value);
                dlg.m_GoodsItem.GoodsClassify    = dgvMain.CurrentRow.Cells["ColumnGoodsClassify"].Value.ToString().Trim();
                dlg.m_GoodsItem.GoodsSubClassify = dgvMain.CurrentRow.Cells["ColumnGoodsSubClassify"].Value.ToString().Trim();

                dlg.ShowDialog();

                ShowGoods();
            }
        }
Example #2
0
        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            FormGoodsItem dlg = new FormGoodsItem();

            dlg.ShowDialog();

            ShowGoods();
        }