日期:2014-05-17 浏览次数:20539 次
//编码文本框的回车事件
private void txtCode_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter&&enter==0)
{
DataRow[] drs = dttory.Select("cInvcode='" + txtCode.Text + "' or cbarcode='"+txtCode.Text+"' ");
if (drs.Length > 0)
{
cinvcode = drs[0]["cinvcode"].ToString();
txtName.Text = drs[0]["cinvname"].ToString();
txtNum.Text = "1";
txtPice.Text = drs[0]["iinvlscost"].ToString();//fretailprice
minpice = drs[0]["iinvlscost"].ToString();
igrouptype = drs[0]["igrouptype"].ToString();
bservice = drs[0]["bservice"].ToString();
itaxrate = Decimal.Parse(drs[0]["itaxrate"].ToString());
if (txtPice.Text.Length > 0)
{
txtMoney.Text =Decimal.Round((decimal.Parse(txtNum.Text) * decimal.Parse(txtPice.Text)),2).ToString();