Initial commit
This commit is contained in:
46
Handler/Project_form2/Dialog/fSelectCustInfo.cs
Normal file
46
Handler/Project_form2/Dialog/fSelectCustInfo.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
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 Project.Dialog
|
||||
{
|
||||
public partial class fSelectCustInfo : Form
|
||||
{
|
||||
public string CustCode, CustName;
|
||||
public fSelectCustInfo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void fSelectCustInfo_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Show();
|
||||
Application.DoEvents();
|
||||
|
||||
var db = new EEEntities();
|
||||
var list = db.vCustomerList.OrderBy(t => t.CustName).ToList(); // (t => t.manu).ToList();
|
||||
this.listView1.Items.Clear();
|
||||
foreach(var item in list)
|
||||
{
|
||||
var lv = this.listView1.Items.Add(item.CustCode);
|
||||
lv.SubItems.Add(item.CustName);
|
||||
}
|
||||
}
|
||||
|
||||
private void btOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.listView1.FocusedItem == null)
|
||||
return;
|
||||
|
||||
this.CustCode = this.listView1.FocusedItem.SubItems[0].Text;
|
||||
this.CustName = this.listView1.FocusedItem.SubItems[1].Text;
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user