Example #1
0
        private string HandleMMSVerifyUASearch(string data, MMSListenerToken token)
        {
            ClientSearchModel clientSearchModel = CommonVariables.serializer.Deserialize <ClientSearchModel>(data.Remove(0, CommonFlag.F_MMSVerifyUASearch.Length));

            if (clientSearchModel != null && !string.IsNullOrEmpty(clientSearchModel.ObjectID))
            {
                CommonVariables.LogTool.Log("UA:" + clientSearchModel.ObjectID + "Type " + clientSearchModel.Type + " Search request  " + clientSearchModel.SearchKey);
                if (clientSearchModel.Type == 1)
                {
                    token.Models = ContactPersonToContacData(token.ContactPersonService.SearchPerson(clientSearchModel.ObjectID, clientSearchModel.SearchKey));
                }
                else if (clientSearchModel.Type == 2)
                {
                    token.Models = ContactGroupToContacData(token.ContactPersonService.SearchGroup(clientSearchModel.ObjectID, clientSearchModel.SearchKey));
                }

                if (token.Models != null && token.Models.Count > 0)
                {
                    return(CommonVariables.serializer.Serialize(token.Models[0]));
                }
                else
                {
                    CommonVariables.LogTool.Log("Search request Result null ");
                }
            }

            return(string.Empty);
        }
Example #2
0
        public ActionResult FindClient(ClientSearchModel model)
        {
            PharmacyEntities entities = new PharmacyEntities();

            model.ClientResultList = new ClientListModel();
            if (model.SearchingClientData.FirstName != null)
            {
                model.ClientResultList.ClientList = entities.MainClientDatas.Where(
                    x => (x.FirstName.Contains(model.SearchingClientData.FirstName))).ToList();
            }
            if (model.SearchingClientData.LastName != null)
            {
                model.ClientResultList.ClientList = entities.MainClientDatas.Where(
                    x => (x.LastName.Contains(model.SearchingClientData.LastName))).ToList();
            }
            if (model.SearchingClientData.Email != null)
            {
                model.ClientResultList.ClientList = entities.MainClientDatas.Where(
                    x => (x.Email.Contains(model.SearchingClientData.Email))).ToList();
            }

            model.SearchingClientData = new MainClientData();
            model.SearchStatus        = true;
            return(View(model));
        }
        private string HandleMMSVerifyUASearch(string data, MMSListenerUDPToken token)
        {
            ClientSearchModel clientSearchModel = JsonConvert.DeserializeObject <ClientSearchModel>(data.Remove(0, CommonFlag.F_MMSVerifyUASearch.Length));

            if (clientSearchModel != null && !string.IsNullOrEmpty(clientSearchModel.ObjectID))
            {
                IList <ContactData> contactdatas = null;
                //CommonVariables.LogTool.Log("UA:" + clientSearchModel.ObjectID + "Type " + clientSearchModel.Type + " Search request  " + clientSearchModel.SearchKey);
                if (clientSearchModel.Type == 1)
                {
                    contactdatas = ContactPersonToContacData(token.ContactPersonService.SearchPerson(clientSearchModel.ObjectID, clientSearchModel.SearchKey));
                    CommonVariables.UAInfoContorl.AddContactDataIntoBuffer(contactdatas,
                                                                           token.IP, token.Port, ServerType.UASearchPerson);
                }
                else if (clientSearchModel.Type == 2)
                {
                    contactdatas = ContactGroupToContacData(token.ContactPersonService.SearchGroup(clientSearchModel.ObjectID, clientSearchModel.SearchKey));
                    CommonVariables.UAInfoContorl.AddContactDataIntoBuffer(ContactGroupToContacData(token.ContactPersonService.SearchGroup(clientSearchModel.ObjectID, clientSearchModel.SearchKey)),
                                                                           token.IP, token.Port, ServerType.UASearchGroup);
                }

                if (contactdatas != null && contactdatas.Count > 0)
                {
                    return(contactdatas.Count.ToString());
                }
            }

            return(string.Empty);
        }
Example #4
0
        public ActionResult FindClient()
        {
            ClientSearchModel model = new ClientSearchModel();

            model.ClientResultList    = new ClientListModel();
            model.SearchingClientData = new MainClientData();
            model.SearchStatus        = false;
            return(View(model));
        }
Example #5
0
        public Task <ClientSearchModel> PrepareApiClientSearchModel(ClientSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            searchModel.SetGridPageSize();

            return(Task.FromResult(searchModel));
        }
        public JsonResult FetchClientList(ClientSearchModel Smodel)
        {
            string errMessage = string.Empty;

            if (ModelState.IsValid)
            {
                var validation = SecurityController.ValidateToken(Smodel.TokenCode);
                try
                {
                    if (validation.Validated == true)
                    {
                        var AccListResult = _db.Query <ClientListModel>(";Exec Supreme_SearchClientListing @Offset,@SearchTypeID,@SearchStatement",
                                                                        new
                        {
                            Offset          = Smodel.Offset,
                            SearchTypeID    = Smodel.SearchTypeID,
                            SearchStatement = Smodel.SearchStatement
                        }).ToList();

                        logger.LogWrite(JsonConvert.SerializeObject(Smodel).ToString() + ":-" + JsonConvert.SerializeObject(AccListResult).ToString());

                        return(Json(AccListResult, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        GenericResultModel AccListResult2 = new GenericResultModel();
                        AccListResult2.Status  = "Fail";
                        AccListResult2.Remarks = validation.Errors[0].ToString();
                        logger.LogWrite(JsonConvert.SerializeObject(validation).ToString());
                        return(Json(AccListResult2, JsonRequestBehavior.AllowGet));
                    }
                }
                catch (Exception ee)
                {
                    GenericResultModel AccListResult2 = new GenericResultModel();
                    AccListResult2.Status  = "Fail";
                    AccListResult2.Remarks = ee.Message;
                    GeneralService.WriteErrorLog(ref ee);
                    return(Json(AccListResult2, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                var message = string.Join(" | ", ModelState.Values
                                          .SelectMany(v => v.Errors)
                                          .Select(e => e.ErrorMessage));

                GenericResultModel AccListResult2 = new GenericResultModel();
                AccListResult2.Status  = "Fail";
                AccListResult2.Remarks = message;
                return(Json(AccListResult2, JsonRequestBehavior.AllowGet));
            }
        }
Example #7
0
        public async Task <DataSourceResult> PrepareApiClientListModel(ClientSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            var clients = await _clientService.GetAllClientsAsync();

            var model = new DataSourceResult
            {
                Data  = clients,
                Total = clients.Count
            };

            return(model);
        }
Example #8
0
        public IActionResult PostList(ClientSearchModel model)
        {
            ViewData.Add("GenderItems", EnumHelper.SelectListFor <GenderEnum>());
            ViewData.Add("TypePersonItems", EnumHelper.SelectListFor <TypePersonEnum>());

            JoinClass jointest = new JoinClass();

            jointest.ClientSearchModel = model;

            IQueryable <ClientWeb> clients = _context.ClientWeb;

            if (ModelState.IsValid)
            {
                if (model.SearchCodClient != null)
                {
                    clients = clients.Where(c => c.CodClient.Contains(model.SearchCodClient));
                }
                if (model.SearchEmail != null)
                {
                    clients = clients.Where(c => c.Email.Contains(model.SearchCodClient));
                }
                if (model.SearchSfirstName != null)
                {
                    clients = clients.Where(c => c.SfirstName.Contains(model.SearchSfirstName));
                }
                if (model.SearchSlastName != null)
                {
                    clients.Where(c => c.SlastName.Equals(model.SearchSlastName));
                }

                clients.Where(c => c.Gender.Equals(model.SearchGender));

                jointest.Clients = clients.ToList();

                return(View("list", jointest));
            }
            else
            {
                jointest.Clients = clients.Take(50).ToList();
            }

            return(View("list", jointest));
        }
Example #9
0
        public IActionResult List()
        {
            ClientSearchModel client = new ClientSearchModel();

            ViewData.Add("GenderItems", EnumHelper.SelectListFor <GenderEnum>());
            ViewData.Add("TypePersonItems", EnumHelper.SelectListFor <TypePersonEnum>());

            ViewData["messageAction"] = HttpContext.Session.GetString("messageAction");

            List <ClientWeb> clients = _context.ClientWeb.Take(50).ToList();

            JoinClass jointest = new JoinClass
            {
                Clients           = clients,
                ClientSearchModel = client
            };

            return(View(jointest));
        }
Example #10
0
 public ApiModel()
 {
     ApiConfiguration  = new ApiConfigurationModel();
     ClientSearchModel = new ClientSearchModel();
 }