示例#1
0
        public bool addData(modelreg mr)
        {
            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <modelreg, dbo_t_Users>();
            });

            IMapper mapper = config.CreateMapper();
            //var source = new Source();
            var dest = mapper.Map <modelreg, dbo_t_Users>(mr);

            dest.IsActive    = true;
            dest.CreatedDate = DateTime.Now;
            db.dbo_t_Users.Add(dest);
            db.SaveChanges();
            int?id = (from s in db.dbo_t_Users
                      orderby s.UserId descending
                      select s.UserId).Take(1).SingleOrDefault();
            var config1 = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <modelreg, dbo_t_User_PersonalDetails>();
            });

            IMapper mapper1 = config1.CreateMapper();

            var d = mapper1.Map <modelreg, dbo_t_User_PersonalDetails>(mr);

            d.UserId      = (int)id;
            d.CreatedDate = DateTime.Now;
            db.dbo_t_User_PersonalDetails.Add(d);
            db.SaveChanges();
            return(true);
        }
示例#2
0
        public bool verifyUser(modelreg mr)
        {
            var k = db.dbo_t_Users.Where(t => t.EMail.Equals(mr.EMail) && t.Password.Equals(mr.Password)).FirstOrDefault();

            if (k != null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
        public bool verifyDbUser(modelreg mr)
        {
            var k = bl.verifyUser(mr);

            if (k)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#4
0
        public bool addDbData(modelreg mr)
        {
            var k = bl.addData(mr);

            if (k)
            {
                return(true);
            }

            else
            {
                return(false);
            }
        }
示例#5
0
        public IEnumerable <modelreg> userDbDetails()
        {
            List <modelreg> tuser = bl.userDetails().ToList();
            List <modelreg> list  = new List <modelreg>();

            foreach (var item in tuser)
            {
                modelreg Details = new modelreg();
                // Details.UserId = item.UserId;
                Details.FName  = item.FName;
                Details.LName  = item.LName;
                Details.EMail  = item.EMail;
                Details.Phone  = item.Phone;
                Details.Gender = item.Gender;
                Details.DOB    = item.DOB;
                //Details.Adderss = item.Adderss;
                Details.UserPersonalId = item.UserPersonalId;
                // Details.CreatedDate = item.CreatedDate;
                Details.LastUpdatedDate = item.LastUpdatedDate;
                list.Add(Details);
            }
            return(list);
        }