Files
Groupware/SubProject/FCM0000/fLovSupply.cs
chikyun.kim c49f039d03 add
2018-10-02 08:25:11 +09:00

79 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FCM0000
{
public partial class fLovSupply : Form
{
public string Title { get; set; }
public int Index { get; set; }
string keyword = string.Empty;
public fLovSupply(string search_)
{
InitializeComponent();
Title = string.Empty;
Index = -1;
this.keyword = search_;
this.KeyPreview = true;
this.KeyDown += (s1, e1) => {
if (e1.KeyCode == Keys.Escape) this.Close();
};
}
private void fLovItem_Load(object sender, EventArgs e)
{
this.ta.FillSearch(this.dsMSSQL.Customs, "%" + this.keyword + "%");
}
private void bs_CurrentChanged(object sender, EventArgs e)
{
}
private void dv_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
btOK.PerformClick();
}
}
private void itemsBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
var drv = bs.Current as DataRowView;
if (drv == null)
{
Title = string.Empty;
Index = -1;
return;
}
else
{
var dr = drv.Row as dsMSSQL.CustomsRow;
Index = dr.idx;
Title = dr.name;
}
if (Title.isEmpty() || Index == -1) DialogResult = System.Windows.Forms.DialogResult.Cancel;
else DialogResult = System.Windows.Forms.DialogResult.OK;
}
private void dv_DoubleClick(object sender, EventArgs e)
{
btOK.PerformClick();
}
}
}