Exemplo n.º 1
0
        //添加商品类型
        private void btnAddType_Click(object sender, EventArgs e)
        {
            ProductTypeModel ptype = new ProductTypeModel();

            ptype.PTID1 = -1;
            CommodityCategoryEditorForm cce = new CommodityCategoryEditorForm(ptype);

            cce.Show();
            this.Hide();
        }
Exemplo n.º 2
0
 private void btnUpdateType_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedCells.Count > 0)
     {
         int                         index = Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value);
         string                      name  = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[1].Value.ToString();
         ProductTypeModel            ptype = new ProductTypeModel(index, name);
         CommodityCategoryEditorForm cce   = new CommodityCategoryEditorForm(ptype);
         cce.Show();
         this.Hide();
     }
     else
     {
         MessageBox.Show("请选择数据!");
     }
 }