private void btnSave(object sender, EventArgs e) { if (txtBills.Text.Trim() == "") { MsgBox.Warn("请选择入库单!"); return; } if (txtBarcode.Text.Trim() == "") { MsgBox.Warn("请扫描送货牌条码!"); return; } int?result = asnQueryDal.CreateVechile(ConvertUtil.ToInt(txtBills.EditValue), txtBarcode.Text.Trim(), txtDeriver.Text.Trim(), txtContactPhone.Text.Trim(), txtVehicleNo.Text.Trim(), GlobeSettings.LoginedUser.UserName); if (result > 0) { MsgBox.OK("登记成功!"); BindingData(); txtBills.EditValue = null; txtBarcode.Text = ""; txtContactPhone.Text = ""; txtDeriver.Text = ""; txtVehicleNo.Text = ""; } else if (result == -1) { MsgBox.Warn("该送货牌正在使用,请使用其他送货牌!"); } }