공정 항목 추가 (업무일지, 프로젝트)
구매내역에 s/c 정렬 기능 추가
This commit is contained in:
@@ -8,23 +8,43 @@ namespace MailManager
|
||||
{
|
||||
class Program
|
||||
{
|
||||
|
||||
static CSetting setting = new CSetting();
|
||||
static DateTime ChkAutoDate = DateTime.Now.AddDays(-1);
|
||||
static void Main(string[] args)
|
||||
{
|
||||
//먼저 보낼 메일이 있다면 전송을 한다
|
||||
setting = new CSetting();
|
||||
setting.Load();
|
||||
if (setting.Xml.Exist() == false)
|
||||
{
|
||||
Console.WriteLine("new setting file make");
|
||||
setting.Save();
|
||||
}
|
||||
|
||||
var cn = false;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if(cn ==false)
|
||||
{
|
||||
cn = connechk();
|
||||
if(cn==false)
|
||||
{
|
||||
Console.WriteLine("wait for next connect");
|
||||
System.Threading.Thread.Sleep(60000);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
SendMail();
|
||||
SendMail();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("send error:" + ex.Message);
|
||||
System.Threading.Thread.Sleep(60000);
|
||||
}
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
@@ -37,12 +57,35 @@ namespace MailManager
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("MakeAutoMail error:" + ex.Message);
|
||||
System.Threading.Thread.Sleep(60000);
|
||||
}
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
static Boolean connechk()
|
||||
{
|
||||
var retval = false;
|
||||
Properties.Settings.Default["cs"] = setting.connstr; // "Data Source=10.131.15.18;Initial Catalog=EE;Persist Security Info=True;User ID=eeuser;Password=Amkor123!";
|
||||
var client = new SqlConnection(setting.connstr);
|
||||
try
|
||||
{
|
||||
Console.WriteLine("connectino check");
|
||||
client.Open();
|
||||
Console.WriteLine("connection ok");
|
||||
client.Close();
|
||||
retval = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Console.WriteLine("conn error: " + ex.ToString());
|
||||
if (ex.ToString().ToLower().IndexOf("fail") != -1)
|
||||
Console.WriteLine(setting.connstr);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
static void SendMail()
|
||||
{
|
||||
Console.WriteLine("Check Send Mail Data");
|
||||
@@ -59,7 +102,6 @@ namespace MailManager
|
||||
var list_bcc = getMaillist(dr.bcc);
|
||||
var list_cc = getMaillist(dr.cc);
|
||||
|
||||
|
||||
string sendMsg = "";
|
||||
if (list_from == "")
|
||||
{
|
||||
@@ -145,7 +187,7 @@ namespace MailManager
|
||||
if (string.Compare(curTime, dr.stime) < 0) continue; //지정된 시간 이전이면 생성 안한다
|
||||
|
||||
//자동생성 구분용 카테고리
|
||||
var cate = string.Format("{0},{1}", dr.sday[0], dr.sday[1]);
|
||||
var cate = string.Format("{0},{1}", dr.sday[0], dr.sday[1]);
|
||||
|
||||
//동륵일
|
||||
var pdate = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
@@ -169,7 +211,7 @@ namespace MailManager
|
||||
if (dr.sday[1] != DateTime.Now.Day) continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//같은날, 같은 atime aidx pdate 의 같이 있으면 이미 생성된것이므로 추가하지 않는다
|
||||
//생성해야할 자료라면 만들어 준다
|
||||
|
||||
Reference in New Issue
Block a user