...
This commit is contained in:
@@ -15,6 +15,7 @@ namespace FCM0000.Item
|
||||
public fItemAdd()
|
||||
{
|
||||
InitializeComponent();
|
||||
Properties.Settings.Default["gwcs"] = FCOMMON.info.CS;
|
||||
|
||||
foreach (Control ctl in this.Controls)
|
||||
{
|
||||
|
||||
@@ -16,6 +16,8 @@ namespace FCM0000
|
||||
public fItems()
|
||||
{
|
||||
InitializeComponent();
|
||||
Properties.Settings.Default["gwcs"] = FCOMMON.info.CS;
|
||||
|
||||
fn_fpcolsize = System.IO.Path.Combine(FCOMMON.Util.CurrentPath, "formSetting", "fp_" + this.Name + ".ini");
|
||||
this.FormClosed += fItems_FormClosed;
|
||||
this.dsMSSQL.Items.TableNewRow += Items_TableNewRow;
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace FCM0000
|
||||
public fLovItem(string search_)
|
||||
{
|
||||
InitializeComponent();
|
||||
Properties.Settings.Default["gwcs"] = FCOMMON.info.CS;
|
||||
|
||||
fn_fpcolsize = System.IO.Path.Combine(FCOMMON.Util.CurrentPath, "formSetting", "fp_" + this.Name + ".ini");
|
||||
|
||||
|
||||
@@ -1,100 +1,102 @@
|
||||
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 fLovOneItem : Form
|
||||
{
|
||||
public string Title { get; set; }
|
||||
DataTable dt;
|
||||
|
||||
public fLovOneItem(List<string> lists)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.StartPosition = FormStartPosition.CenterScreen;
|
||||
Title = string.Empty;
|
||||
dt = new DataTable();
|
||||
dt.Columns.Add("item");
|
||||
foreach (var item in lists)
|
||||
dt.Rows.Add(new string[] { item });
|
||||
|
||||
this.KeyPreview = true;
|
||||
this.KeyDown += (s1, e1) => {
|
||||
if (e1.KeyCode == Keys.Escape) this.Close();
|
||||
};
|
||||
|
||||
}
|
||||
public fLovOneItem(Dictionary<string,string> lists)
|
||||
{
|
||||
InitializeComponent();
|
||||
Title = string.Empty;
|
||||
dt = new DataTable();
|
||||
dt.Columns.Add("item");
|
||||
dt.Columns.Add("Desc");
|
||||
foreach (var item in lists)
|
||||
dt.Rows.Add(new string[] { item.Key ,item.Value});
|
||||
|
||||
this.KeyPreview = true;
|
||||
this.KeyDown += (s1, e1) =>
|
||||
{
|
||||
if (e1.KeyCode == Keys.Escape) this.Close();
|
||||
};
|
||||
|
||||
}
|
||||
private void fLovItem_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.bs.DataSource = this.dt;
|
||||
this.bn.BindingSource = this.bs;
|
||||
this.dv.DataSource = this.bs;
|
||||
|
||||
if(dv.Columns.Count > 1)
|
||||
this.dv.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
else
|
||||
this.dv.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Title = drv[0].ToString();
|
||||
}
|
||||
|
||||
if (Title.isEmpty()) DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
else DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
}
|
||||
|
||||
private void dv_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
btOK.PerformClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
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 fLovOneItem : Form
|
||||
{
|
||||
public string Title { get; set; }
|
||||
DataTable dt;
|
||||
|
||||
public fLovOneItem(List<string> lists)
|
||||
{
|
||||
InitializeComponent();
|
||||
Properties.Settings.Default["gwcs"] = FCOMMON.info.CS;
|
||||
|
||||
this.StartPosition = FormStartPosition.CenterScreen;
|
||||
Title = string.Empty;
|
||||
dt = new DataTable();
|
||||
dt.Columns.Add("item");
|
||||
foreach (var item in lists)
|
||||
dt.Rows.Add(new string[] { item });
|
||||
|
||||
this.KeyPreview = true;
|
||||
this.KeyDown += (s1, e1) => {
|
||||
if (e1.KeyCode == Keys.Escape) this.Close();
|
||||
};
|
||||
|
||||
}
|
||||
public fLovOneItem(Dictionary<string,string> lists)
|
||||
{
|
||||
InitializeComponent();
|
||||
Title = string.Empty;
|
||||
dt = new DataTable();
|
||||
dt.Columns.Add("item");
|
||||
dt.Columns.Add("Desc");
|
||||
foreach (var item in lists)
|
||||
dt.Rows.Add(new string[] { item.Key ,item.Value});
|
||||
|
||||
this.KeyPreview = true;
|
||||
this.KeyDown += (s1, e1) =>
|
||||
{
|
||||
if (e1.KeyCode == Keys.Escape) this.Close();
|
||||
};
|
||||
|
||||
}
|
||||
private void fLovItem_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.bs.DataSource = this.dt;
|
||||
this.bn.BindingSource = this.bs;
|
||||
this.dv.DataSource = this.bs;
|
||||
|
||||
if(dv.Columns.Count > 1)
|
||||
this.dv.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
else
|
||||
this.dv.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Title = drv[0].ToString();
|
||||
}
|
||||
|
||||
if (Title.isEmpty()) DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
else DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
}
|
||||
|
||||
private void dv_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
btOK.PerformClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user