Esempio n. 1
0
        public int UpdateReportGeneratedDetails(string FileName)
        {
            int affectedRows = 0;

            try
            {
                Library.WriteErrorLog("UpdateReportGeneratedDetails Function Entry");
                var    location        = ConfigurationManager.AppSettings["FTPLocation"];
                string locationAndFile = location + FileName;
                //Querying with LINQ to Entities
                using (var context = new qmEntities())
                {
                    affectedRows = context.InsertReport(FileName, DateTime.Now, "Windows Service", "Nightly Job", locationAndFile, location);
                    Library.WriteErrorLog("UpdateReportGeneratedDetails Function Exit");
                    return(affectedRows);
                }
            }
            catch (Exception ex)
            {
                Library.WriteErrorLog("Error from UpdateReportGeneratedDetails : " + ex.InnerException.ToString());
                return(affectedRows);

                throw ex;
            }
        }
Esempio n. 2
0
        public List <GetReportDailyJob_Result> GetValues(DateTime?fromDate, DateTime?toDate, string workgroupID)
        {
            Library.WriteErrorLog("GetValues Function Entry");

            List <GetReportDailyJob_Result> studentInfo = null;

            try
            {
                studentInfo = new List <GetReportDailyJob_Result>();
                //Querying with LINQ to Entities
                if (fromDate.HasValue && toDate.HasValue)
                {
                    using (var context = new qmEntities())
                    {
                        context.Configuration.AutoDetectChangesEnabled = false;
                        context.SetCommandTimeOut(10000);
                        var query = context.GetReportDailyJob(fromDate, toDate, workgroupID).ToList();
                        Library.WriteErrorLog("GetValues Function Exit");
                        return(studentInfo = query);
                    }
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                Library.WriteErrorLog("Error from GetValues : " + ex.InnerException.ToString());
                return(null);

                throw ex;
            }
        }