Ejemplo n.º 1
0
        private static List <SZAservice> _getActZirSarfasls(DbAtiran2Entities context,
                                                            Expression <Func <act_zirsarfasls, bool> > where = null)
        {
            IQueryable <act_zirsarfasls> result = context.Set <act_zirsarfasls>().AsNoTracking();

            if (where != null)
            {
                result = result.Where(where);
            }

            //var x = (from read in context.act_zirsarfasls
            //    select new
            //    {
            //        ALi=read.zirsarfasls.sarfasls.rdf,
            //    }).ToList();
            int Row = 2;

            return(result.ToList().OrderBy(r => r.date).Select(a => new SZAservice()
            {
                Arow = Row++,
                AID = a.rdf,
                AZirSarfaslID = a.rdf_zirsarfasls,
                Adate = a.date,
                Abed = a.bed,
                Abes = a.bes,
                Abed_bes = (a.bed - a.bes) > 0?"بد": (a.bed - a.bes) == 0?"--":"بس",
                Adescription = a.dis,
                Akind = a.kind,
                AkindName = KindName.FirstOrDefault(k => k.Key == a.kind).Value,
                Asanadno = a.sanadno,
                Auser = a.user
            }).ToList());
        }
Ejemplo n.º 2
0
        private static List <SarfaslService> _getSarfaslses(DbAtiran2Entities context,
                                                            Expression <Func <sarfasls, bool> > where = null)
        {
            IQueryable <sarfasls> result = context.Set <sarfasls>().AsNoTracking();

            if (where != null)
            {
                result = result.Where(where);
            }

            int Row = 1;

            return(result.ToList().Select(s => new SarfaslService()
            {
                row = Row++,
                ID = s.rdf,
                GroupSarfaslID = s.GroupSarfaslID,
                Name = s.name
            }).ToList());
        }
Ejemplo n.º 3
0
        private static List <GroupSarfaslServes> _getGroupSarfaslses(DbAtiran2Entities context,
                                                                     Expression <Func <GroupSarfasl, bool> > where = null)
        {
            IQueryable <GroupSarfasl> result = context.Set <GroupSarfasl>().AsNoTracking();

            if (where != null)
            {
                result = result.Where(where);
            }

            int Row = 1;

            return(result.ToList().Select(g => new GroupSarfaslServes()
            {
                row = Row++,
                ID = g.GroupSarfaslID,
                Name = g.GroupSarfaslName,
                Active = g.Active
            }).ToList());
        }
Ejemplo n.º 4
0
        private static List <ZirSarfaslService> _getZirSarfasls(DbAtiran2Entities context,
                                                                Expression <Func <zirsarfasls, bool> > where = null)
        {
            IQueryable <zirsarfasls> result = context.Set <zirsarfasls>().AsNoTracking();

            if (where != null)
            {
                result = result.Where(where);
            }

            int Row = 1;

            return(result.ToList().Select(z => new ZirSarfaslService()
            {
                row = Row++,
                ID = z.rdf,
                SarfaslID = z.rdf_sarfasl,
                Name = z.name,
                has_dar = z.has_dar,
                Active = z.Active
            }).ToList());
        }