pm 용 구매 업데이트 기능 추가

This commit is contained in:
chi
2023-10-15 21:00:04 +09:00
parent b6291f2bd0
commit bf4852d84b
39 changed files with 2115 additions and 1342 deletions

View File

@@ -1,4 +1,5 @@
using FCOMMON;
using NetOffice.OutlookApi;
using System;
using System.Data;
using System.Drawing;
@@ -11,7 +12,7 @@ namespace FCM0000
{
string defaultgubun = "";
string defafilter = "";
public fCode(string gubun = "",string filter="")
public fCode(string gubun = "", string filter = "")
{
InitializeComponent();
this.defaultgubun = gubun;
@@ -19,6 +20,8 @@ namespace FCM0000
Properties.Settings.Default["gwcs"] = FCOMMON.info.CS;
this.dsMSSQL.Common.TableNewRow += Common_TableNewRow;
if (FCOMMON.info.Login.level >= 9) toolStripButton1.Visible = true;
this.KeyPreview = true;
this.KeyDown += (s1, e1) => { if (e1.KeyCode == Keys.Escape) this.Close(); };
}
void Common_TableNewRow(object sender, DataTableNewRowEventArgs e)
@@ -37,7 +40,8 @@ namespace FCM0000
private void __Load(object sender, EventArgs e)
{
if(this.defaultgubun.isEmpty()==false)
tbFind.Text = string.Empty;
if (this.defaultgubun.isEmpty() == false)
{
commonDataGridView.AllowUserToAddRows = false;
commonDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
@@ -47,10 +51,10 @@ namespace FCM0000
{
btCancle.Visible = false;
}
this.Show();
Application.DoEvents();
System.Windows.Forms.Application.DoEvents();
if (this.WindowState == FormWindowState.Minimized) this.WindowState = FormWindowState.Normal;
if (this.RestoreBounds.X + this.RestoreBounds.Width < 300 && this.RestoreBounds.X < 0)
@@ -60,7 +64,7 @@ namespace FCM0000
toolStripButton1.Visible = FCOMMON.info.Login.no == "dev";
// this.TopMost=true;
// this.Activate();
//자동선택해준다.
if (defaultgubun.isEmpty() == false)
@@ -74,10 +78,10 @@ namespace FCM0000
if (item.ToString().StartsWith($"[{defaultgubun}]"))
{
idx = i;
break;
break;
}
}
if(idx > -1)
if (idx > -1)
{
this.cmbList.SelectedIndex = idx;
this.cmbList.Enabled = false;
@@ -112,7 +116,7 @@ namespace FCM0000
this.bs.Filter = this.defafilter;
this.dsMSSQL.Common.AcceptChanges();
}
catch (Exception ex)
catch (System.Exception ex)
{
FCOMMON.Util.MsgE("Query Error\n\n" + ex.Message);
}
@@ -128,7 +132,7 @@ namespace FCM0000
{
cmbList_SelectedIndexChanged(null, null);
}
}
@@ -267,7 +271,7 @@ namespace FCM0000
private void commonDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex < 0 || e.ColumnIndex < 0) return;
if (this.defaultgubun.isEmpty()) return;
@@ -294,5 +298,39 @@ namespace FCM0000
this.SelectedTitle = string.Empty;
this.DialogResult = DialogResult.OK;
}
private void tbFind_TextChanged(object sender, EventArgs e)
{
}
private void tbFind_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
search();
}
void search()
{
var text = tbFind.Text.Trim();
if (text.isEmpty() == false)
{
try
{
var filter = "code like '%{0}%' or memo like '%{0}%'";
bs.Filter = filter.Replace("{0}", text);
tbFind.BackColor = Color.Lime;
}
catch (System.Exception ex)
{
tbFind.BackColor = Color.Tomato;
}
}
else
{
bs.Filter = "";
tbFind.BackColor = Color.White;
}
tbFind.SelectAll();
}
}
}