Example #1
0
        /// <summary>
        /// get data SynchroDate
        /// </summary>
        protected void GetDataSynchroDate()
        {
            AppLog.WriteLog("current connection:" + string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer));
            string today           = DateTime.Now.ToString(AppConst.Const_Format_YMD) + " 00:00:00";
            string lastUpdatedTime = today;

            //using (WFMDBDataContext db = new WFMDBDataContext())
            using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer)))
            {
                List <uspWFMGetDataSynchroResult> lst = db.uspWFMGetDataSynchro(this.TenantID).ToList();
                if (lst.Count > 0)
                {
                    lastUpdatedTime = lst[0].dtUpdated.Value.ToString(AppConst.Const_Format_YMDHMS);
                    if (string.Compare(today, lastUpdatedTime) > 0)
                    {
                        lastUpdatedTime = today;
                    }
                }
            }
            ViewBag.UpdatedTime = lastUpdatedTime;
        }
Example #2
0
 /// <summary>
 /// get data SynchroDate
 /// </summary>
 protected void GetDataSynchroDate()
 {
     AppLog.WriteLog("current connection:" + string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer));
     string today = DateTime.Now.ToString(AppConst.Const_Format_YMD) + " 00:00:00";
     string lastUpdatedTime = today;
     //using (WFMDBDataContext db = new WFMDBDataContext())
     using (WFMDBDataContext db = new WFMDBDataContext(string.Format(System.Configuration.ConfigurationManager.ConnectionStrings["SpecialConnection"].ConnectionString, DBServer)))
     {
         List<uspWFMGetDataSynchroResult> lst = db.uspWFMGetDataSynchro(this.TenantID).ToList();
         if (lst.Count > 0)
         {
             lastUpdatedTime = lst[0].dtUpdated.Value.ToString(AppConst.Const_Format_YMDHMS);
             if (string.Compare(today, lastUpdatedTime) > 0)
             {
                 lastUpdatedTime = today;
             }
         }
     }
     ViewBag.UpdatedTime = lastUpdatedTime;
 }