Beispiel #1
0
        public IActionResult Search()
        {
            MemberSearchModel model = new MemberSearchModel()
            {
                FindMode = 1
            };

            return(View(model));
        }
Beispiel #2
0
        public ActionResult MemberFastOperations(MemberSearchModel msm)
        {
            IEnumerable <Uye> sorgulama = _uyeService.GetAllWInc();

            if (msm.AktifPasif != 0)
            {
                sorgulama = sorgulama.Where(x => x.Aktif == (msm.AktifPasif == 1));
            }
            if (msm.IsimSoyisimKurum != null)
            {
                sorgulama = sorgulama.Where(x =>
                                            msm.IsimSoyisimKurum.ToLower().Contains(x.Unvan.ToLower()) ||
                                            x.Unvan.ToLower().Contains(msm.IsimSoyisimKurum.ToLower()) ||
                                            msm.IsimSoyisimKurum.ToLower().Contains(x.Adi.ToLower()) ||
                                            x.Adi.ToLower().Contains(msm.IsimSoyisimKurum.ToLower()) ||
                                            msm.IsimSoyisimKurum.ToLower().Contains(x.Soyadi.ToLower()) ||
                                            x.Soyadi.ToLower().Contains(msm.IsimSoyisimKurum.ToLower()) ||
                                            msm.IsimSoyisimKurum.ToLower().Contains(x.Kurum.ToLower()) ||
                                            x.Kurum.ToLower().Contains(msm.IsimSoyisimKurum.ToLower()));
            }
            if (msm.YazarEditorHakem != 0)
            {
                if (msm.YazarEditorHakem == 1)
                {
                    sorgulama = sorgulama.Where(x => x.Yazar);
                }
                else if (msm.YazarEditorHakem == 2)
                {
                    sorgulama = sorgulama.Where(x => x.Editor);
                }
                else if (msm.YazarEditorHakem == 3)
                {
                    sorgulama = sorgulama.Where(x => x.Hakem);
                }
            }
            if (msm.BilimselOrganizasyon != 0)
            {
                if (msm.BilimselOrganizasyon == 1)
                {
                    sorgulama = sorgulama.Where(x => x.BilimselKomite);
                }
                else if (msm.BilimselOrganizasyon == 2)
                {
                    sorgulama = sorgulama.Where(x => x.OrganizasyonKomite);
                }
            }
            var model = new MemberListViewModel
            {
                UyeList      = sorgulama.ToList(),
                MemberSearch = msm
            };

            return(View(model));
        }
Beispiel #3
0
        public ViewResult Members(MemberSearchModel msm)
        {
            IEnumerable <Uye> sorgulama = _uyeService.GetAllWInc();

            if (msm.AktifPasif != 0)
            {
                sorgulama = sorgulama.Where(x => x.Aktif == (msm.AktifPasif == 1));
            }

            if (msm.EmailTelefon != null)
            {
                sorgulama = sorgulama.Where(x =>
                                            msm.EmailTelefon.ToLower().Contains(x.Mail.ToLower()) ||
                                            x.Mail.ToLower().Contains(msm.EmailTelefon.ToLower()) ||
                                            msm.EmailTelefon.ToLower().Contains(x.Telefon.ToLower()) ||
                                            x.Telefon.ToLower().Contains(msm.EmailTelefon.ToLower()));
            }

            if (msm.IsimSoyisimKurum != null)
            {
                sorgulama = sorgulama.Where(x =>
                                            msm.IsimSoyisimKurum.ToLower().Contains(x.Unvan.ToLower()) ||
                                            x.Unvan.ToLower().Contains(msm.IsimSoyisimKurum.ToLower()) ||
                                            msm.IsimSoyisimKurum.ToLower().Contains(x.Adi.ToLower()) ||
                                            x.Adi.ToLower().Contains(msm.IsimSoyisimKurum.ToLower()) ||
                                            msm.IsimSoyisimKurum.ToLower().Contains(x.Soyadi.ToLower()) ||
                                            x.Soyadi.ToLower().Contains(msm.IsimSoyisimKurum.ToLower()) ||
                                            msm.IsimSoyisimKurum.ToLower().Contains(x.Kurum.ToLower()) ||
                                            x.Kurum.ToLower().Contains(msm.IsimSoyisimKurum.ToLower()));
            }

            if (msm.YazarEditorHakem != 0)
            {
                if (msm.YazarEditorHakem == 1)
                {
                    sorgulama = sorgulama.Where(x => x.Yazar);
                }
                if (msm.YazarEditorHakem == 2)
                {
                    sorgulama = sorgulama.Where(x => x.Editor);
                }
                if (msm.YazarEditorHakem == 3)
                {
                    sorgulama = sorgulama.Where(x => x.Hakem);
                }
            }
            var model = new MemberListViewModel
            {
                UyeList      = sorgulama.ToList(),
                MemberSearch = msm
            };

            return(View(model));
        }
Beispiel #4
0
        // GET: backend/Member
        public ActionResult Index(MemberSearchModel searchTo, int page = 0)
        {
            var filter = new JL.Core.Filters.MemberFilter();

            filter.NickName     = searchTo.NickName;
            filter.JoinTimeFrom = searchTo.JoinTimeFrom;
            filter.JoinTimeTo   = searchTo.JoinTimeTo;
            var pager = PageReq <JL.Core.Filters.MemberFilter> .Create(filter, page);

            // search page
            var data = jlService.MemberPage(pager);

            ViewBag.productQuery = searchTo;
            return(View(data));
        }
Beispiel #5
0
        public IHttpActionResult Search(MemberSearchModel model)
        {
            string firstName      = string.IsNullOrWhiteSpace(model.FirstName) ? null : model.FirstName.Trim();
            string lastName       = string.IsNullOrWhiteSpace(model.LastName) ? null : model.LastName.Trim();
            int?   categoryId     = model.CategoryID.HasValue && model.CategoryID.Value > 0 ? model.CategoryID : null;
            int?   nukhId         = model.NukhID.HasValue && model.NukhID.Value > 0 ? model.NukhID : null;
            string city           = string.IsNullOrWhiteSpace(model.City) ? null : model.City.Trim();
            string district       = string.IsNullOrWhiteSpace(model.District) ? null : model.District.Trim();
            string state          = string.IsNullOrWhiteSpace(model.State) ? null : model.State.Trim();
            string emailAddress   = string.IsNullOrWhiteSpace(model.Email) ? null : model.Email.Trim();
            string phoneNumber    = string.IsNullOrWhiteSpace(model.PhoneNumber) ? null : model.PhoneNumber.Trim();
            string sortOrder      = string.IsNullOrWhiteSpace(model.SortOrder) ? null : model.SortOrder.Trim();
            int?   currentPage    = model.CurrentPage.HasValue && model.CurrentPage.Value > 0 ? model.CurrentPage : null;
            int?   pageSize       = model.PageSize.HasValue && model.PageSize.Value > 0 ? model.PageSize : null;
            int?   memberId       = model.MemberId > 0 ? model.MemberId : (int?)null;
            bool   includeOnlyHOF = model.IncludeOnlyHOF;

            MemberSearchResultModel mvm = new MemberSearchResultModel();

            using (bkContext context = new bkContext())
            {
                ObjectParameter oParameter = new ObjectParameter("TotalRecords", typeof(int));

                List <bk_MemberSearch_Result> results = context.bk_MemberSearch(firstName, lastName, categoryId, nukhId, city, district, state, emailAddress, phoneNumber, pageSize, currentPage, includeOnlyHOF, sortOrder, memberId, null, oParameter).ToList();

                mvm.TotalRecords = (int)oParameter.Value;

                foreach (var result in results)
                {
                    var item = new MemberSearchResultItemModel();

                    item.Name     = $"{result.FirstName} {result.LastName}";
                    item.Address1 = $"{result.Address1}, {result.Address2}".TrimEnd(' ').TrimEnd(',').TrimStart(',');
                    item.Address2 = $"{result.City}, {result.District}, {result.State}, {result.Country}".TrimEnd(' ').TrimEnd(',').TrimStart(',').Replace(", , ", ", ");
                    item.MemberId = result.MemberID;
                    item.FamilyId = result.FamilyID;
                    item.Gender   = result.Gender;
                    item.Alive    = result.Alive;
                    item.DOB      = result.DOB;
                    item.DOD      = result.DOD;
                    item.PhotoUrl = MemberWrapper.ProfilePhoto(result.MemberID, result.Gender, result.ModifiedOn);

                    mvm.Results.Add(item);
                }
            }

            return(Ok(mvm));
        }
        public List <MemberViewModel> Search(MemberSearchModel searchModel)
        {
            var query = _hContext.Members.Select(x => new MemberViewModel
            {
                Id       = x.Id,
                FullName = x.FullName,
                Mobile   = x.Mobile
            });

            if (!string.IsNullOrWhiteSpace(searchModel.FullName))
            {
                query = query.Where(x => x.FullName.Contains(searchModel.FullName));
            }

            return(query.OrderByDescending(x => x.Id).ToList());
        }
Beispiel #7
0
 public List <MemberViewModel> Search(MemberSearchModel searchModel)
 {
     return(_memberRepository.Search(searchModel));
 }
 public void r101Implementation(MemberSearchModel instance)
 {
     // This is the placeholder for method implementation.
 }
Beispiel #9
0
 private static void AssertSearch(MemberSearch expectedSearch, bool expectedIsAlert, MemberSearchModel model)
 {
     Assert.AreEqual(expectedSearch.Name, model.Name);
     Assert.AreEqual(expectedIsAlert, model.IsAlert);
     AssertAreEqual(expectedSearch.Criteria, model.Criteria);
 }
 public void OnGet(MemberSearchModel searchModel)
 {
     Members = _memberApplication.Search(searchModel);
 }
Beispiel #11
0
        public IActionResult Search(MemberSearchModel model)
        {
            if (ModelState.IsValid)
            {
                bool doSearch = false;
                IQueryable <AppUser> usersQuery = _dbContext.Users;

                if (!string.IsNullOrEmpty(model.UserName))
                {
                    doSearch = true;
                    if (model.FindMode == 1)
                    {
                        usersQuery = usersQuery.Where(u => u.UserName.Equals(model.UserName));
                    }
                    else if (model.FindMode == 2)
                    {
                        usersQuery = usersQuery.Where(u => u.UserName.StartsWith(model.UserName));
                    }
                    else
                    {
                        usersQuery = usersQuery.Where(u => u.UserName.Contains(model.UserName));
                    }
                }

                if (!string.IsNullOrEmpty(model.Email))
                {
                    doSearch = true;
                    if (model.FindMode == 1)
                    {
                        usersQuery = usersQuery.Where(u => u.Email.Equals(model.Email));
                    }
                    else if (model.FindMode == 2)
                    {
                        usersQuery = usersQuery.Where(u => u.Email.StartsWith(model.Email));
                    }
                    else
                    {
                        usersQuery = usersQuery.Where(u => u.Email.Contains(model.Email));
                    }
                }

                if (!string.IsNullOrEmpty(model.PhoneNumber))
                {
                    doSearch = true;
                    if (model.FindMode == 1)
                    {
                        usersQuery = usersQuery.Where(u => u.PhoneNumber.Equals(model.PhoneNumber));
                    }
                    else if (model.FindMode == 2)
                    {
                        usersQuery = usersQuery.Where(u => u.PhoneNumber.StartsWith(model.PhoneNumber));
                    }
                    else
                    {
                        usersQuery = usersQuery.Where(u => u.PhoneNumber.Contains(model.PhoneNumber));
                    }
                }

                model.Results = doSearch ? usersQuery.OrderBy(u => u.UserName).Take(200).ToList() : null;
            }

            return(View(model));
        }