Esempio n. 1
0
        public static dynamic GetClosureComment(string engNum)
        {
            using (var db = new AmDbContext())
            {
                using (var tran = db.Database.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted))
                {
                    var result = db.Set <WsActivityHistory>().Where(
                        x => (
                            x.EngNum.Equals(engNum, StringComparison.OrdinalIgnoreCase) &&
                            x.WsActivityTypeId == WsActivityType.CLOSURE &&
                            x.WsSubActivityTypeId == WsActivityType.CLOSURE_INITIATE &&
                            !(x.Comment == null || x.Comment.Trim() == string.Empty)
                            ))
                                 .Select(x => new { Comment = x.Comment, UserId = x.UserId, DateCreated = x.DateCreated }).ToList();

                    var dynamicResult = result.Select(x => x.ToDynamic()).ToList();

                    return(dynamicResult);
                }
            }
        }
Esempio n. 2
0
        public static dynamic GetClosureComment(string engNum)
        {
            using (var db = new AmDbContext())
            {
                using (var tran = db.Database.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted))
                {
                    var result = db.Set<WsActivityHistory>().Where(
                        x => (
                            x.EngNum.Equals(engNum, StringComparison.OrdinalIgnoreCase) &&
                            x.WsActivityTypeId == WsActivityType.CLOSURE &&
                            x.WsSubActivityTypeId == WsActivityType.CLOSURE_INITIATE &&
                            !(x.Comment == null || x.Comment.Trim() == string.Empty)
                            ))
                        .Select(x => new { Comment = x.Comment, UserId = x.UserId, DateCreated = x.DateCreated }).ToList();

                    var dynamicResult = result.Select(x => x.ToDynamic()).ToList();

                    return dynamicResult;
                }
            }
        }
Esempio n. 3
0
        public static dynamic GetClosurePastDue(int days, WsActivityType mailTypeEnum)
        {
            using (var db = new AmDbContext())
            {
                using (var tran = db.Database.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted))
                {
                    var result = db.Set<WsActivityHistory>().Where(
                        x => (
                            x.WsActivityTypeId == WsActivityType.CLOSURE &&
                            x.WsSubActivityTypeId == mailTypeEnum &&
                            x.DateCreated <= DbFunctions.AddDays(DateTime.Now, -(days))
                            )).Select(x => new
                            {
                                EngNum = x.EngNum
                                //, RecepientArray = x
                            }).ToList();

                    var dynamicResult = result.Select(x => x.ToDynamic()).ToList();

                    return dynamicResult;
                }
            }
        }
Esempio n. 4
0
        public static dynamic GetClosurePastDue(int days, WsActivityType mailTypeEnum)
        {
            using (var db = new AmDbContext())
            {
                using (var tran = db.Database.BeginTransaction(System.Data.IsolationLevel.ReadUncommitted))
                {
                    var result = db.Set <WsActivityHistory>().Where(
                        x => (
                            x.WsActivityTypeId == WsActivityType.CLOSURE &&
                            x.WsSubActivityTypeId == mailTypeEnum &&
                            x.DateCreated <= DbFunctions.AddDays(DateTime.Now, -(days))
                            )).Select(x => new
                    {
                        EngNum = x.EngNum
                                 //, RecepientArray = x
                    }).ToList();

                    var dynamicResult = result.Select(x => x.ToDynamic()).ToList();

                    return(dynamicResult);
                }
            }
        }