Esempio n. 1
0
 public void UpdateTdLoad(TdLoad curLoad)
 {
     using (var context = new EstimeContext(options, connString))
     {
         EFHelper.CallEF(() =>
         {
             context.TdLoad.Update(curLoad);
             context.SaveChanges();
         });
     }
 }
Esempio n. 2
0
 public TdLoad AddTdLoad(TdLoad newLoad)
 {
     using (var context = new EstimeContext(options, connString))
     {
         EFHelper.CallEF(() =>
         {
             context.TdLoad.Add(newLoad);
             context.SaveChanges();
         });
     }
     return(newLoad);
 }
Esempio n. 3
0
        public TcRefPeriod GetRefPeriodByCode(string refPeriodCode)
        {
            TcRefPeriod rp = null;

            using (var context = new EstimeContext(options, connString))
            {
                EFHelper.CallEF(() =>
                {
                    rp = context.TcRefPeriod.Include(r => r.RefPeriodType).FirstOrDefault(r => r.Code == refPeriodCode);
                });
            }
            return(rp);
        }
Esempio n. 4
0
        public int GetRefPeriodId(string refPeriodCode)
        {
            int id = 0;

            using (var context = new EstimeContext(options, connString))
            {
                EFHelper.CallEF(() =>
                {
                    id = context.TcRefPeriod.FirstOrDefault(r => r.Code == refPeriodCode).Id;
                });
            }
            return(id);
        }
Esempio n. 5
0
        public TlLoadStatus GetLoadStatusByCode(string loadStatusCode)
        {
            TlLoadStatus ls = null;

            using (var context = new EstimeContext(options, connString))
            {
                EFHelper.CallEF(() =>
                {
                    ls = context.TlLoadStatus.FirstOrDefault(l => l.Code == loadStatusCode);
                });
            }
            return(ls);
        }
Esempio n. 6
0
        public int GetLoadStatusId(string loadStatusCode)
        {
            int id = 0;

            using (var context = new EstimeContext(options, connString))
            {
                EFHelper.CallEF(() =>
                {
                    id = context.TlLoadStatus.FirstOrDefault(l => l.Code == loadStatusCode).Id;
                });
            }
            return(id);
        }
Esempio n. 7
0
        public TlEstimeFileType GetEstimeFileTypeByCode(string estimeFileTypeCode)
        {
            TlEstimeFileType eft = null;

            using (var context = new EstimeContext(options, connString))
            {
                EFHelper.CallEF(() =>
                {
                    eft = context.TlEstimeFileType.Include(e => e.FileType).FirstOrDefault(e => e.Code == estimeFileTypeCode);
                });
            }
            return(eft);
        }
Esempio n. 8
0
        public int GetEstimeFileTypeId(string estimeFileTypeCode)
        {
            int id = 0;

            using (var context = new EstimeContext(options, connString))
            {
                EFHelper.CallEF(() =>
                {
                    id = context.TlEstimeFileType.FirstOrDefault(eft => eft.Code == estimeFileTypeCode).Id;
                });
            }
            return(id);
        }
Esempio n. 9
0
        public IEnumerable <CodeSet> GetCodeSetList()
        {
            IQueryable <CodeSet> codesets = null;

            var            options = new DbContextOptions <EstimeContext>();
            List <CodeSet> myList  = new List <CodeSet>();

            using (var context = new EstimeContext(options, connString))
            {
                //codesets = context.CodeSet.Include(cs => cs.CodeSetType).Include(cs => cs.CodeMember);
                EFHelper.CallEF(() =>
                {
                    //codesets = context.CodeSet.Include(cs => cs.CodeMember);
                    codesets = context.CodeSet.Include(cs => cs.CodeSetType).Include(cs => cs.CodeMember);
                });
                myList = codesets.ToList();
            }
            return(myList);
        }
Esempio n. 10
0
        public IEnumerable <TlInputCoordinate> GetInputCoordinateListByEstimeFileType(int estFileTypeId)
        {
            IQueryable <TlInputCoordinate> coors  = null;
            List <TlInputCoordinate>       myList = new List <TlInputCoordinate>();



            using (var context = new EstimeContext(options, connString))
            {
                EFHelper.CallEF(() =>
                {
                    coors = (from ic in context.TlInputCoordinate.Include(ic => ic.InputVariable).ThenInclude(iv => iv.Variable)
                             join iv in context.TlInputVariable
                             on ic.InputVariableId equals iv.Id
                             where iv.EstimeFileTypeId == estFileTypeId
                             select ic);
                });
                myList = coors.ToList();
            }
            return(myList);
        }