This commit is contained in:
chikyun.kim
2019-08-23 18:08:04 +09:00
parent 63dffe62ef
commit 6a90be2e6d
26 changed files with 933 additions and 436 deletions

View File

@@ -79,14 +79,40 @@ namespace FPJ0000
//this.cbProcess.DataSource = new BindingSource(procList, "");
//담당자목록
var userList = FCOMMON.DBM.getGroupList("name", "Users", "[level] > 0 and [level] < 10");
foreach (var user in userList)
//담당자목록 - 사용자목록으로 처리한다.
string namestr = string.Format("{0}({1})", FCOMMON.info.Login.nameK, FCOMMON.info.Login.no);
if (FCOMMON.info.Login.no == "dev") namestr = "김치균(395552)";
this.cmbRequest.Items.Clear();
this.cmbRequest.Items.Add(namestr);
try
{
this.cmbRequest.Items.Add(user);
var cn = FCOMMON.DBM.getCn();
cn.Open();
string sql = "select [id],[name] " +
" from users" +
" where gcode='{1}' and id <> '{0}'" +
" order by [name]";
sql = string.Format(sql, FCOMMON.info.Login.no, FCOMMON.info.Login.gcode);
var cmd = new System.Data.SqlClient.SqlCommand(sql, cn);
var rdr = cmd.ExecuteReader();
while (rdr.Read())
{
string cmbdata = string.Format("{1}({0})", rdr[0].ToString(), rdr[1].ToString());
this.cmbRequest.Items.Add(cmbdata);
}
cmd.Dispose();
cn.Close();
cn.Dispose();
}
catch (Exception ex)
{
FCOMMON.Util.MsgE("User List Error\n\n" + ex.Message);
}
cmbRequest.Text = namestr;// FCOMMON.info.Login.nameK;
dtPdate.Value = DateTime.Now;
cmbRequest.Text = FCOMMON.info.Login.nameK;
cmbState.Text = "PO";
@@ -202,11 +228,14 @@ namespace FPJ0000
if (dlg2 != System.Windows.Forms.DialogResult.Yes) return false;
string userNo = this.cmbRequest.Text.Substring(cmbRequest.Text.LastIndexOf('(') + 1);
userNo = userNo.Substring(0, userNo.Length - 1);
//기존에 등록된 자료가 있는지 체크한다.
var SQLExist =
" select count(*) from Purchase" +
" where import = 1" +
" and pdate = '{0}'" +
" and gcode = '" + FCOMMON.info.Login.gcode + "' and pdate = '{0}'" +
" and projectidx = {1}";
SQLExist = string.Format(SQLExist, dtPdate.Value.ToShortDateString(), this.ProjectIndex.ToString());
var ExistCnt = FCOMMON.DBM.ExecuteScalarI(SQLExist);
@@ -218,7 +247,7 @@ namespace FPJ0000
SQLExist =
" delete from Purchase" +
" where import = 1" +
" and pdate = '{0}'" +
" and gcode = '" + FCOMMON.info.Login.gcode + "' and pdate = '{0}'" +
" and projectidx = {1}";
SQLExist = string.Format(SQLExist, dtPdate.Value.ToShortDateString(), this.ProjectIndex.ToString());
var delCnt = FCOMMON.DBM.ExecuteNonQuery(SQLExist);
@@ -228,9 +257,9 @@ namespace FPJ0000
//insert query
var SQL =
" insert into purchase(pdate,state,process,request,sid,pumname,pumidx,pumscale,pumunit," +
" insert into purchase(asset,dept,manuproc,gcode,pdate,state,process,request,sid,pumname,pumidx,pumscale,pumunit," +
" pumqty,pumprice,pumamt,supply,supplyidx,project,projectidx,bigo,import,wuid,wdate,orderno)" +
" select '{0}' as pdate,'{1}','{2}' as process ,'{3}' as request,ItemSid," +
" select '{8}','{9}','{10}','{11}', '{0}' as pdate,'{1}','{2}' as process ,'{3}' as request,ItemSid," +
" ItemName,Item,ItemModel,ItemUnit,qty,price,amt,ItemSupply,ItemSupplyidx,'{4}',Project," +
" memo,1 as import,'{5}' as wuid, getdate() as wdate,'{6}' as orderno" +
" from ProjectsPart" +
@@ -240,11 +269,15 @@ namespace FPJ0000
dtPdate.Value.ToShortDateString(),
cmbState.Text.Trim(),
cbProcess.Text.Trim(),
cmbRequest.Text.Trim(),
userNo.Trim(),
tbProject.Text.Trim(),
FCOMMON.info.Login.no,
tbOrderNo.Text.Trim(),
this.ProjectIndex.ToString()
this.ProjectIndex.ToString(),
this.cbEQModel.Text,
this.cbEQManu.Text,
this.cbManuProc.Text,
FCOMMON.info.Login.gcode
);
// Console.WriteLine(SQL);