pm 용 구매 업데이트 기능 추가
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
@@ -16,7 +17,41 @@ namespace Project._Common
|
||||
InitializeComponent();
|
||||
this.dsMSSQL.Users.TableNewRow += Users_TableNewRow;
|
||||
this.FormClosed += __Closed;
|
||||
|
||||
this.KeyDown += (s1, e1) =>
|
||||
{
|
||||
if (e1.KeyCode == Keys.Escape) this.Close();
|
||||
};
|
||||
this.tbFind.KeyDown += (s1, e1) =>
|
||||
{
|
||||
if (e1.KeyCode == Keys.Enter) SearchKey();
|
||||
};
|
||||
}
|
||||
void SearchKey()
|
||||
{
|
||||
var txt = tbFind.Text.Trim();
|
||||
if (txt.isEmpty())
|
||||
{
|
||||
bs.Filter = "";
|
||||
tbFind.BackColor = Color.White;
|
||||
}
|
||||
else
|
||||
{
|
||||
var cols = new string[] { "id", "name", "email", "tel" };
|
||||
var filter = string.Join(" like '%{0}%' or ", cols) + " like '%{0}%'";
|
||||
filter = string.Format(filter, txt);
|
||||
try
|
||||
{
|
||||
bs.Filter = filter;
|
||||
tbFind.BackColor = Color.Lime;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
bs.Filter = "";
|
||||
tbFind.BackColor = Color.Tomato;
|
||||
}
|
||||
}
|
||||
tbFind.Focus();
|
||||
tbFind.SelectAll();
|
||||
}
|
||||
|
||||
void __Closed(object sender, FormClosedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user