首页 新闻 会员 周边

录入单价,数量,自动计算金额,这个一般程序怎么处理

0
悬赏园豆:10 [待解决问题]

class order

{

  public int orderid{get;set;}

  public string  customerid {get;set;}

     public list<orderline> orderlines{get;set;}

}

public orderline

{

  public int orderid{get;set;}

     public decimal  unitprice{get;set;}

     public decimal  quanlity{get;set;}

      public decimal  totalprice{get;set;}

}

菜鸟问题:

  单价*数量=金额,有什么办法进行自动处理,不要每次赋值手工写代码处理,或者给个解决方案。

外行人搞程序的主页 外行人搞程序 | 初学一级 | 园豆:69
提问于:2016-10-22 17:40
< >
分享
所有回答(3)
0

 public decimal  totalprice{

get{

return this.unitprice*this.quanlity;

}

}

czd890 | 园豆:14412 (专家六级) | 2016-10-22 18:12
0

好吧,这个问题,说明你是外行

悦光阴 | 园豆:2251 (老鸟四级) | 2016-10-23 12:35
0

这个问题问的不知道怎么回答

jqw2009 | 园豆:2439 (老鸟四级) | 2017-08-22 14:31
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册