Пример #1
0
        public IEnumerable <TEQueueModel> GetQueueList(int Uniqueid)
        {
            //List<TEQueue> listOfQueue = db.TEQueues.Where(x => x.IsDeleted == false).ToList();
            int raisedby = (from iss in db.TEIssues
                            where (iss.Uniqueid == Uniqueid)
                            select
                            iss.RaisedBy).FirstOrDefault().Value;
            var listOfQueue = (from q in db.TEQueues
                               join i in db.TEIssues on q.Uniqueid equals i.QueueID
                               where           //(i.RaisedBy == RaisedBy) &&
                               (q.IsDeleted == false) &&
                               (i.RaisedBy == raisedby)
                               orderby q.PROJECTID descending
                               select new
            {
                q.Uniqueid,
                q.PROJECTID,
                q.QueueID,
                q.QueueName
            }).Distinct().ToList();

            List <TEQueueModel> result = new List <TEQueueModel>();

            foreach (var item in listOfQueue)
            {
                TEQueueModel            qModel     = new TEQueueModel();
                TETransformEntityNModel translator = new TETransformEntityNModel();

                qModel = translator.TransformAtoB(item, qModel);
                #region Commented due to entity change
                //if (item.PROJECTID != null)
                //{
                //    TEProject proj = db.TEProjects.Find(item.PROJECTID.Value);
                //    if (proj != null)
                //        qModel.TEProject = new TEProject()
                //        {
                //            Uniqueid = proj.Uniqueid,
                //            ProjectCode = proj.ProjectCode,
                //            ProjectName = proj.ProjectName,
                //            ProjectShortName = proj.ProjectShortName
                //        };
                //}

                //if (qModel.TEProject == null)
                //{
                //    qModel.TEProject = new TEProject();
                //}
                #endregion
                result.Add(qModel);
            }
            return(result);
        }
Пример #2
0
        public IEnumerable <TEQueueModel> GetQueueList()
        {
            //db.Configuration.ProxyCreationEnabled = false;
            List <TEQueue> listOfQueue = db.TEQueues.Where(x => (x.IsDeleted == false)).ToList();
            //&& (x.PROJECTID != null)).ToList();

            List <TEQueueModel> result = new List <TEQueueModel>();

            foreach (var item in listOfQueue)
            {
                if (item.Admin != null)
                {
                    TETransformEntityNModel translator = new TETransformEntityNModel();
                    TEQueueModel            qModel     = translator.TransformAtoB(item, new TEQueueModel());
                    qModel.UserProfile = db.UserProfiles.Where(x => x.UserId == item.Admin).FirstOrDefault();
                    result.Add(qModel);
                }
                //UserProfile AdminName = db.UserProfiles.Where(x => x.- == item.admin).FirstOrDefault();
                //UserProfile   AdminName = db.u

                //qModel.

                #region Commented due to entity change
                //if (item.PROJECTID != null)
                //{
                //    TEProject proj = db.TEProjects.Find(item.PROJECTID.Value);
                //    if (proj != null)
                //        qModel.TEProject = new TEProject()
                //        {
                //            Uniqueid = proj.Uniqueid,
                //            ProjectCode = proj.ProjectCode,
                //            ProjectName = proj.ProjectName,
                //            ProjectShortName = proj.ProjectShortName
                //        };
                //}

                //if (qModel.TEProject == null)
                //{
                //    qModel.TEProject = new TEProject();
                //}
                #endregion
                // result.Add(AdminName);
            }
            return(result);
        }
Пример #3
0
        public TEQueue GetQueuebyId(int id)
        {
            TEQueue                 item       = db.TEQueues.Find(id);
            TEQueueModel            qModel     = new TEQueueModel();
            TETransformEntityNModel translator = new TETransformEntityNModel();

            qModel = translator.TransformAtoB(item, qModel);
            #region Commented due to entity change
            //if (item.PROJECTID != null)
            //{
            //    TEProject proj = db.TEProjects.Find(item.PROJECTID.Value);
            //    qModel.TEProject = new TEProject()
            //    {
            //        Uniqueid = proj.Uniqueid,
            //        ProjectCode = proj.ProjectCode,
            //        ProjectName = proj.ProjectName,
            //        ProjectShortName = proj.ProjectShortName
            //    };
            //}
            #endregion
            return(qModel);
        }
Пример #4
0
        public List <TEQueueModel> GetQueueListinternal()
        {
            List <TEQueue> listOfQueue = db.TEQueues.Where(x => (x.IsDeleted == false && x.PROJECTID == null)).ToList();
            //&&(x.PROJECTID == null)).ToList();

            List <TEQueueModel> result = new List <TEQueueModel>();

            foreach (var item in listOfQueue)
            {
                TEQueueModel            qModel     = new TEQueueModel();
                TETransformEntityNModel translator = new TETransformEntityNModel();

                qModel             = translator.TransformAtoB(item, qModel);
                qModel.UserProfile = null;
                #region Commented due to entity change
                //if (item.PROJECTID != null)
                //{
                //    TEProject proj = db.TEProjects.Find(item.PROJECTID.Value);
                //    if (proj != null)
                //        qModel.TEProject = new TEProject()
                //        {
                //            Uniqueid = proj.Uniqueid,
                //            ProjectCode = proj.ProjectCode,
                //            ProjectName = proj.ProjectName,
                //            ProjectShortName = proj.ProjectShortName
                //        };
                //}

                //if (qModel.TEProject == null)
                //{
                //    qModel.TEProject = new TEProject();
                //}
                #endregion
                result.Add(qModel);
            }
            return(result);
        }