Exemplo n.º 1
0
        public ActionResult GetClientsByOrganizationID(int OrganizationID)
        {
            PagedClient _clients = new PagedClient();

            _clients = Mapper.Map <PagedClient>(_clientService.GetClientsByOrganizationID(HCRGCLIENT.OrganizationID));
            return(Json(_clients.Clients));
        }
Exemplo n.º 2
0
        public void Roundtrip()
        {
            Console.WriteLine("Starting...");
            var client = new MemoryClient();
            var passed = false;
            var pager  = new PagedClient(client, "test");

            using (var s = new CancellationTokenSource(TimeSpan.FromSeconds(10))) {
                var unpackedMessage = new UnpackedMessage(GetBytes(Constants.MaxKeySize),
                                                          GetBytes(Constants.MaxValueSize * 5 + 1));
                Console.WriteLine("Pub...");
                pager.Publish(new[] { unpackedMessage }).Wait(s.Token);
                Console.WriteLine("Waiting...");

                pager.ChaseEventsForever(s.Token, (id, subscription) => {
                    CollectionAssert.AreEqual(unpackedMessage.Value, id.Value);
                    CollectionAssert.AreEqual(unpackedMessage.Key, id.Key);
                    passed = true;
                    Console.WriteLine("Got it" + id);
                    s.Cancel();
                });
            }

            if (!passed)
            {
                Assert.Fail("Failed");
            }
        }
Exemplo n.º 3
0
 public JsonResult GetNewClient(int skip)
 {
     try
     {
         PagedClient _clients = new PagedClient();
         _clients = Mapper.Map <PagedClient>(_clientService.GetClientVerifiedDetails(skip, GlobalConst.Records.Take));
         return(Json(_clients, GlobalConst.Message.text_html));
     }
     catch
     {
         return(Json(""));
     }
 }
Exemplo n.º 4
0
        public ActionResult GetClientsByName(string searchtext)
        {
            PagedClient clientModel = new PagedClient();

            clientModel = Mapper.Map <PagedClient>(_clientService.GetClientsByName(searchtext == null ? "" : searchtext, GlobalConst.Records.Skip, GlobalConst.Records.take500, HCRGCLIENT.ClientID));
            clientModel.PagedRecords = GlobalConst.Records.LandingTake;
            var ClientTypes = _commonService.getAllClientType();

            foreach (Client obj in clientModel.Clients)
            {
                var _ClientTypeName = ClientTypes.Where(mahi => mahi.ClientTypeID == obj.ClientTypeID).Select(mahi => new { mahi.ClientTypeName }).SingleOrDefault();
                obj.ClientTypeName = _ClientTypeName.ClientTypeName.ToString();
            }
            return(Json(clientModel, GlobalConst.Message.text_html));
        }
Exemplo n.º 5
0
        public ActionResult getAllClients()
        {
            PagedClient objClient = new PagedClient();

            if (HCRGCLIENT.ClientTypeID == 1)
            {
                objClient = Mapper.Map <PagedClient>(_clientService.GetClientsOrganization());
            }
            else
            {
                objClient = Mapper.Map <PagedClient>(_clientService.GetClientsByOrganizationID(HCRGCLIENT.OrganizationID));
            }
            foreach (var objClientResult in objClient.Clients)
            {
                objClientResult.EncryptedClientID = EncryptString(objClientResult.ClientID.ToString());
            }
            return(Json(objClient, GlobalConst.Message.text_html, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 6
0
        public ActionResult Index()
        {
            if (TempData["Message"] != null)
            {
                ViewBag.Message = TempData["Message"].ToString();
            }

            PagedClient objClient = new PagedClient();

            if (HCRGCLIENT.ClientTypeID == 1)
            {
                objClient = Mapper.Map <PagedClient>(_clientService.GetClientsOrganization());
            }
            else
            {
                objClient = Mapper.Map <PagedClient>(_clientService.GetClientsByOrganizationID(HCRGCLIENT.OrganizationID));
            }
            foreach (var objClientResult in objClient.Clients)
            {
                objClientResult.EncryptedClientID = EncryptString(objClientResult.ClientID.ToString());
            }
            return(View(objClient));
        }