You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

58 lines
1.3 KiB

using SelfHelpClient.BL;
using SelfHelpClient.BO;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SelfHelpClient
{
public partial class ReadCardForm : Template
{
string _cardNumber = "";
public ViewEntity VEntity { get; set; }
public ReadCardForm()
{
InitializeComponent();
this.WindowState = FormWindowState.Maximized;
this.KeyPress += ReadCardForm_KeyPress;
}
void ReadCardForm_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Tab)
{
FillViewEntity(_cardNumber);
DialogResult = DialogResult.OK;
}
else
_cardNumber += e.KeyChar.ToString();
}
private void FillViewEntity(string idCard)
{
var list = WeightBillBL.GetViewEntity(idCard).OrderByDescending(x => x.Date).ToList();
if (list.Count == 0)
{
DialogForm.ShowDialog("没有待办理业务", 5);
this.Close();
}
else if (list.Count == 1)
VEntity = list.First();
else
{
new ItemSelect(list, this).ShowDialog();
}
}
private void backBtn_Click(object sender, EventArgs e)
{
this.Close();
}
}
}