...
This commit is contained in:
@@ -197,6 +197,107 @@ namespace FCOMMON
|
||||
}
|
||||
}
|
||||
|
||||
public static bool AddMagamList(string mon)
|
||||
{
|
||||
var gcode = FCOMMON.info.Login.gcode;
|
||||
|
||||
|
||||
//해당기간내의 마감 자료를 조회해서 넣는다.
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new List<string>();
|
||||
string sql = "select count(*) from EETGW_Magam where gcode=@gcode and pdate = @pdate";
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
cmd.Parameters.Add("gcode", System.Data.SqlDbType.VarChar).Value = gcode;
|
||||
cmd.Parameters.Add("pdate", System.Data.SqlDbType.VarChar).Value = mon;
|
||||
var datacnt = int.Parse(cmd.ExecuteScalar().ToString());
|
||||
if (datacnt == 0)
|
||||
{
|
||||
sql = "insert into EETGW_Magam(gcode,pdate,wdate,wuid) values(@gcode,@pdate,@wdate,@wuid)";
|
||||
cmd.CommandText = sql;
|
||||
cmd.Parameters.Add("wdate", System.Data.SqlDbType.DateTime).Value = DateTime.Now;
|
||||
cmd.Parameters.Add("wuid", System.Data.SqlDbType.VarChar).Value = FCOMMON.info.Login.no;
|
||||
datacnt = cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return datacnt == 1;
|
||||
|
||||
}
|
||||
|
||||
public static List<string> GetMagamList()
|
||||
{
|
||||
var gcode = FCOMMON.info.Login.gcode;
|
||||
var sdate = DateTime.Now.AddMonths(-6).ToString("yyyy-MM");
|
||||
var edate = DateTime.Now.AddMonths(1).ToString("yyyy-MM");
|
||||
|
||||
//해당기간내의 마감 자료를 조회해서 넣는다.
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new List<string>();
|
||||
|
||||
string sql = "select pdate" +
|
||||
" from EETGW_Magam " +
|
||||
" where gcode=@gcode and pdate between @sdate and @edate and isnull(pdate,'') <> ''";
|
||||
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
cmd.Parameters.Add("gcode", System.Data.SqlDbType.VarChar).Value = gcode;
|
||||
cmd.Parameters.Add("sdate", System.Data.SqlDbType.VarChar).Value = sdate;
|
||||
cmd.Parameters.Add("edate", System.Data.SqlDbType.VarChar).Value = edate;
|
||||
|
||||
var rdr = cmd.ExecuteReader();
|
||||
while (rdr.Read())
|
||||
{
|
||||
retval.Add(rdr[0].ToString());
|
||||
}
|
||||
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return retval;
|
||||
|
||||
}
|
||||
|
||||
public static bool GetMagamStatus(DateTime mon)
|
||||
{
|
||||
return GetMagamStatus(mon.ToString("yyyy-MM"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 머감상태를 확인합니다.
|
||||
/// </summary>
|
||||
/// <param name="mon">yyyy-MM</param>
|
||||
/// <returns></returns>
|
||||
public static bool GetMagamStatus(string mon)
|
||||
{
|
||||
var gcode = FCOMMON.info.Login.gcode;
|
||||
var sdate = mon;// DateTime.Now.AddMonths(-6).ToString("yyyy-MM");
|
||||
//var edate = DateTime.Now.AddMonths(1).ToString("yyyy-MM");
|
||||
|
||||
//해당기간내의 마감 자료를 조회해서 넣는다.
|
||||
var cn = getCn();
|
||||
cn.Open();
|
||||
|
||||
var retval = new List<string>();
|
||||
|
||||
string sql = "select count(*)" +
|
||||
" from EETGW_Magam " +
|
||||
" where gcode=@gcode and pdate = @sdate";
|
||||
|
||||
var cmd = new SqlCommand(sql, cn);
|
||||
cmd.Parameters.Add("gcode", System.Data.SqlDbType.VarChar).Value = gcode;
|
||||
cmd.Parameters.Add("sdate", System.Data.SqlDbType.VarChar).Value = sdate;
|
||||
|
||||
var cnt = int.Parse(cmd.ExecuteScalar().ToString());
|
||||
|
||||
|
||||
cn.Close();
|
||||
cn.Dispose();
|
||||
return cnt > 0;
|
||||
|
||||
}
|
||||
|
||||
public static sItemInfo getLastPurchaseInfo(int idx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user