Esempio n. 1
0
 //修改商品类别----2
 private void btnUpdateCategory_Click(object sender, EventArgs e)
 {
     if (dgvCategoryInfo.SelectedRows.Count > 0)
     {
         //获取选中的行的id
         int id = Convert.ToInt32(dgvCategoryInfo.SelectedRows[0].Cells[0].Value.ToString());
         //根据id获取该商品类别的所有信息
         CategoryInfoBLL bll = new CategoryInfoBLL();
         //村对象
         fea.obj = bll.GetCategoryInfoByCatId(id);//判断不是nul在赋值
         LoadFrmChangeCategory(2);
     }
     else
     {
         MessageBox.Show("请选中要修改的行");
     }
 }
Esempio n. 2
0
 //修改商品类别
 private void btnUpdateCategory_Click(object sender, EventArgs e)
 {
     if (dgvCategoryInfo.SelectedRows.Count > 0)
     {
         //获取id
         string id = dgvCategoryInfo.SelectedRows[0].Cells[0].Value.ToString();
         //获取对象,通过id去数据库查询该id对应的商品类别信息
         CategoryInfoBLL bll = new CategoryInfoBLL();
         CategoryInfo    ct  = bll.GetCategoryInfoByCatId(Convert.ToInt32(id));
         ct.CatId = Convert.ToInt32(id);
         fea.Obj  = ct;
         //传对象
         ShowFrmChangeCategory(2);//添加
     }
     else
     {
         MessageBox.Show("请选中行");
     }
 }
Esempio n. 3
0
        //修改商品类别2---修改
        private void btnUpdateCategory_Click(object sender, EventArgs e)
        {
            if (dgvCategoryInfo.SelectedRows.Count > 0)
            {
                //获取选中的id
                int id = Convert.ToInt32(dgvCategoryInfo.SelectedRows[0].Cells[0].Value);
                //根据id查询数据
                CategoryInfoBLL bll = new CategoryInfoBLL();
                CategoryInfo    cat = bll.GetCategoryInfoByCatId(id);
                cat.Catid = id;
                fea.obj   = cat;

                //传对象
                ShowFrmChangeCategory(2);
            }
            else
            {
                MessageBox.Show("请选择要操作的行");
            }
        }