开学总结

修改商品:

 

 

public void Changeoption()
{
if (add.Text == "添加")
{
add.Text = "修改";
code.ReadOnly = true;
name.ReadOnly = true;

clear.Text = "取消";
}
else
{
add.Text = "添加";
code.ReadOnly = false;
name.ReadOnly = false;
clear.Text = "清空";
add.Tag = null;
}
}

 

private void update_Click(object sender, EventArgs e)
{
if (goods.CurrentRow == null) return;
Changeoption();
var g = Getindex(goods.CurrentRow.Index);
add.Tag = g;
Setgoodsform(g);
}

 

public void Setgoodsform(Goods goods)
{
code.Text = goods.Code;
name.Text=goods.Name;
gongying.SelectedValue=goods.Supid;
zhong.SelectedValue = goods.Typeid;
kuwei.Text=goods.Location;
jinhuo.Value=(decimal)goods.Buyingprice;
lingshou.Value=(decimal)goods.Retailprice;
guige.Text=goods.Guige;
}

posted @ 2021-11-19 19:24  一条快乐的小鲸鱼  阅读(32)  评论(0编辑  收藏  举报