예제 #1
0
        public Object LoginValidate(string bankId, string password)
        {
            if ("".Equals(bankId))
            {
                return("Bank Id can't be blank");
            }

            if ("".Equals(password))
            {
                return("Password can't be blank");
            }

            var row = ctx.Set <User>().FirstOrDefault(u => u.bankId.Equals(bankId) && u.password.Equals(password));

            if (row == null)
            {
                return("Invalid bankId / Password");
            }
            else
            {
                return(row);
            }
        }
예제 #2
0
        public async Task <IDictionary <string, List <string> > > GetSectionFields()
        {
            IEnumerable <NamedBankingProductAttribute> list = await ctx.Set <NamedBankingProductAttribute>().AsNoTracking().ToListAsync();

            //IQueryable<NamedBankingProductAttribute> qlist = list.AsQueryable();

            //var o = (from n in qlist
            //         where n.section != null
            //         orderby n.section, n.description
            //         select new { n.section, n.description }).Distinct();

            IDictionary <string, List <string> > di = new Dictionary <string, List <string> >();

            foreach (NamedBankingProductAttribute n in list)
            {
                if (n.section != null)
                {
                    if (di.ContainsKey(n.section))
                    {
                        List <string> tmp = di[n.section];
                        tmp.Add(n.description);
                        di[n.section] = tmp;
                    }
                    else
                    {
                        List <string> tmp = new List <string>();
                        tmp.Add(n.description);
                        di.Add(n.section, tmp);
                    }

                    //System.Diagnostics.Debug.WriteLine(n.section + " " + n.description);
                }
            }


            return(di);
        }
예제 #3
0
        public async Task <IEnumerable <T> > GetAll()
        {
            var list = await ctx.Set <T>().AsNoTracking().ToListAsync();

            return(list);
        }