Example #1
0
        // save list of halls to xml
        private static void SaveHalls(List<Hall> halls)
        {
            if (!halls.IsAny()) return;

            Console.WriteLine($"\nGet {halls.Count} halls.");

            var path = [email protected]"{HallsPath}Halls_{DateTime.Now.ToString("dd-MM-yyyy")}.xml";
            if (File.Exists(path))
            {
                Console.WriteLine($"File \"{Path.GetFileName(path)}\" [{new FileInfo(path).Length.ToReadableFileSize()}] loaded successfuly");
                return;
            }

            File.WriteAllText(path, halls.Serialize());
            Console.WriteLine($"File \"{Path.GetFileName(path)}\" [{new FileInfo(path).Length.ToReadableFileSize()}] saved successfuly to:\n{path}");
        }
        /// <summary>
        /// Production Jobs
        /// </summary>
        protected IQueryable<ProductionJob> JobsForRun(decimal? runID, List<string> statusList)
        {
            if ((runID == null) || (runID < 1))
            {
                return null;
            }
            else
            {
                var jobs = from j in PrdnDBContext.ProductionJobs
                            .Include("Customer")
                            .Include("Product.LeatherCharVW")
                            .Include("Product.LeatherCompVW")
                            .Include("Worksheet.WorksheetCharVW")
                            .Include("Worksheet.WorksheetCompVW")
                            .Include("Priority")
                            .Include("PrdnInvItem")
                        where j.RunID == runID
                        //orderby j.RunSeqNo
                        select j;

                if (statusList.IsAny())
                {
                    jobs = from j in jobs
                           where statusList.Contains(j.StatusStr)
                           select j;
                }

                jobs = from j in jobs
                       orderby j.RunSeqNo
                       select j;

                return jobs;
            }
        }
        public void LoadFromRequest(string requestID)
        {
            WorksheetOpts = WorksheetEditOpt.ReqWorksheet<WorksheetEditOpt>(requestID);

            //WorksheetOpts = WorksheetEditOpt.ReqWorksheetWith300Groups(requestID);
            DefineForProdType();

            if (WorksheetOpts.IsAny())
            {
                WorksheetOpts.ForEach(o => o.WorksheetID = WorksheetID);
            }
        }