This commit is contained in:
chikyun.kim
2019-07-26 17:28:19 +09:00
parent ae209e00af
commit 11d7c7f704
58 changed files with 3360 additions and 6285 deletions

View File

@@ -8,19 +8,18 @@ namespace FCOMMON
{
public static partial class DBM
{
public enum eAutoType
public enum eAuthType
{
purchase,
holyday,
project,
jobreport,
}
public static int getAuth(eAutoType type, string uid)
public static int getAuth(eAuthType type, string uid)
{
return getAuth(type.ToString(), uid);
}
public static int getAuth(eAutoType type)
public static int getAuth(eAuthType type)
{
return getAuth(type.ToString(), info.Login.no);
}

View File

@@ -374,7 +374,7 @@ namespace FCOMMON
string sql = "select [id],[name],concat([name],'(',[id],')') as dispName,[dept],[email],[level],[tel] "+
" from Users " +
" where [id] <> 'dev' and dept like '%"+ FCOMMON.info.Login.dept.Replace("'","''") +"%' order by [name]";
" where gcode='"+ FCOMMON.info.Login.gcode+"' and [id] <> 'dev' and dept like '%"+ FCOMMON.info.Login.dept.Replace("'","''") +"%' order by [name]";
var cmd = new SqlCommand(sql, cn);
var da = new SqlDataAdapter(sql, cn);
var ds = new System.Data.DataSet();
@@ -527,7 +527,8 @@ namespace FCOMMON
var cn = getCn();
cn.Open();
var sql = "select isnull({1},''),isnull({2},'')" +
" from {0} where gcode = '" + FCOMMON.info.Login.gcode + "' ";
" from {0} "+
" where gcode = '" + FCOMMON.info.Login.gcode + "' ";
if (where != "") sql += " and " + where;
if (order != "") sql += " order by " + order;
sql = string.Format(sql,table, col1, col2);
@@ -642,7 +643,8 @@ namespace FCOMMON
int retval = -1;
var cmd2 = new SqlCommand("", cn);
cmd2.CommandText = "select count(*) from Items where name ='" + pumname + "'";
cmd2.CommandText = string.Format( "select count(*) from Items " +
" where ISNULL(REPLACE(name, ' ', '') + REPLACE(model, ' ', ''), '') = '{0}'",pumname.Trim().Replace("'","''") + model.Trim().Replace("'","''"));
var cnt = int.Parse(cmd2.ExecuteScalar().ToString());
if (cnt == 0)
{
@@ -658,8 +660,6 @@ namespace FCOMMON
cmd2.CommandText = "insert into items(gcode,cate,name,sid,model,scale,unit,supply,supplyidx,price,image,wuid,wdate)" +
"values(@gcode,@cate,@name,@sid,@model,@scale,@unit,@supply,@supplyidx,@price,@image,@wuid,@wdate)";
}
cmd2.Parameters.Clear();
cmd2.Parameters.Add(new SqlParameter("gcode", FCOMMON.info.Login.gcode));
@@ -684,13 +684,37 @@ namespace FCOMMON
}
else retval = -1;
}
else
{
cmd2.CommandText = string.Format("select idx from Items where ISNULL(REPLACE(name, ' ', '') + REPLACE(model, ' ', ''), '') = '{0}'", pumname.Trim().Replace("'", "''") + model.Trim().Replace("'", "''"));
retval = int.Parse(cmd2.ExecuteScalar().ToString());
}
cmd2.Dispose();
cn.Close();
cn.Dispose();
return retval;
}
public static Boolean UpdateItemSID(int itemIdx,string sid)
{
var cn = getCn();
cn.Open();
int retval = 0;
var cmd2 = new SqlCommand("", cn);
cmd2.CommandText = string.Format("update Items set sid=@sid where idx=@idx");
cmd2.Parameters.Clear();
cmd2.Parameters.Add(new SqlParameter("idx", itemIdx));
cmd2.Parameters.Add(new SqlParameter("sid", sid));
retval = cmd2.ExecuteNonQuery();
cmd2.Dispose();
cn.Close();
cn.Dispose();
return retval != 0;
}
public static List<String> getGroupList(string GroupColumn, string table, string where = "",Boolean desc=false,Boolean useColumncover=true)
{
List<string> retval = new List<string>();

View File

@@ -25,6 +25,7 @@ namespace FCOMMON
menu_jago,
menu_equipment,
menu_workday,
purchase_adv,
}
public static class info

View File

@@ -41,6 +41,7 @@ namespace FCOMMON
{
var form = this as Form;
FCOMMON.Util.SetFormStatus(ref form, this.Name, true);
}
}
}

View File

@@ -13,7 +13,7 @@ namespace FCOMMON
{
string homePath = string.Empty;
string curPath = string.Empty;
arUtil.FTPClient ftp;
arUtil.FTPClient.FTPClient ftp;
string fn = "ftpExplorer.ini";
public fFTPExplorer(string title,string path,string ip,string id,string pw,int port=21,Boolean passvie=true)
{
@@ -29,7 +29,7 @@ namespace FCOMMON
btQuery.PerformClick();
};
this.FormClosed += __Closed;
ftp = new arUtil.FTPClient(ip, id, pw, port, passvie);
ftp = new arUtil.FTPClient.FTPClient(ip, id, pw, port, passvie);
curPath = path;
homePath = path;
@@ -110,7 +110,7 @@ namespace FCOMMON
{
System.IO.FileInfo fi = new System.IO.FileInfo(fileName);
string remote = tbpath.Text + "/" + fi.Name;
ftp.upload(remote, fi.FullName);
ftp.Upload(remote, fi.FullName);
}
btQuery.PerformClick();
}
@@ -179,7 +179,7 @@ namespace FCOMMON
lv.SubItems.Add(item.FileType.ToString());
lv.SubItems.Add(item.Size.ToString());
lv.SubItems.Add(item.FileDateTime.ToString());
if (item.FileType == arUtil.FTPfileInfo.DirectoryEntryTypes.Directory) lv.ForeColor = Color.Blue;
if (item.FileType == arUtil.FTPClient.FTPfileInfo.DirectoryEntryTypes.Directory) lv.ForeColor = Color.Blue;
}
}
@@ -195,7 +195,7 @@ namespace FCOMMON
//이파일을 현재 위치에 업로드 한다.
System.IO.FileInfo fi = new System.IO.FileInfo(od.FileName);
string newfile = ftp.PathFileCombine(curPath, fi.Name);
if (!ftp.upload(newfile, od.FileName))
if (!ftp.Upload(newfile, od.FileName))
Util.MsgE("upload error");
search(curPath);
}
@@ -218,10 +218,9 @@ namespace FCOMMON
System.IO.FileInfo fi = new System.IO.FileInfo(od.FileName);
string newfile = ftp.PathFileCombine(curPath, fi.Name);
if (!ftp.download(remotefile,od.FileName))
if (!ftp.Download(remotefile,od.FileName))
Util.MsgE("Download error");
search(curPath);
}
}
}