Ejemplo n.º 1
0
        public static string GetDocLocation(string engNum, double docNum)
        {
            using (new TransactionScope(
                    TransactionScopeOption.Required,
                    new TransactionOptions { IsolationLevel = IsolationLevel.ReadUncommitted }))
            {
                using (var db = new IMDBContext())
                {
                    var docLoc = db.Set<DOCMASTER>().
                        Where(x =>
                            x.C2ALIAS.Equals(engNum, StringComparison.OrdinalIgnoreCase) &&
                            x.DOCNUM == docNum && x.VERSION == 1
                        ).Select(y => y.DOCLOC).ToList().FirstOrDefault();

                    var sp_docLoc = docLoc.Split(':');

                    var p1 = sp_docLoc[0].Trim();

                    var srvLoc =
                        db.Set<DOCSERVER>().
                        Where(x => x.DOCSERVER1.Equals(p1, StringComparison.OrdinalIgnoreCase)
                        ).Select(y => y.LOCATION).ToList().FirstOrDefault();

                    var result = string.Format("{0}{1}", srvLoc, sp_docLoc[1]);
                    return result;
                }
            }
        }
Ejemplo n.º 2
0
 public IQueryable <T> All()
 {
     return(context.Set <T>());
 }
Ejemplo n.º 3
0
        public static double? GetPrjIdForEng(string num)
        {
            using (new TransactionScope(
                    TransactionScopeOption.Required,
                    new TransactionOptions { IsolationLevel = IsolationLevel.ReadUncommitted }))
            {
                using (var db = new IMDBContext())
                {
                    var result = db.Set<PROJECT>().Include("DOCMASTER")
                        .Where(x => x.DOCMASTER.C2ALIAS.Equals(num, StringComparison.OrdinalIgnoreCase)
                        && x.DOCMASTER.C_ALIAS.Equals("WEBDOC", StringComparison.OrdinalIgnoreCase)
                        && x.DOCMASTER.DOCNAME.Equals(string.Empty, StringComparison.OrdinalIgnoreCase)
                        ).FirstOrDefault();

                    if (result == null)
                        return null;
                    else
                        return result.PRJ_ID;
                }
            }
        }
Ejemplo n.º 4
0
 public IMDBRepository(IMDBContext context)
 {
     _context = context;
     _dbSet   = _context.Set <TEntity>();
 }