Exemplo n.º 1
0
        public void LoadData(int clientId, bool showId)
        {
            // clear UI
            Clear();

            // set up parameters
            var data = new ClientDataModel();

            data.ClientId = clientId;

            // get data
            var items = ClientDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            // should only have single match -- should log exception.
            if (items.Count != 1)
            {
                return;
            }

            var item = items[0];

            SetData(item);

            if (!showId)
            {
                SystemKeyId = item.ClientId;

                // only show Audit History in case of Update page, not for Clone.
                oHistoryList.Setup(PrimaryEntity, clientId, PrimaryEntityKey);
            }
            else
            {
                CoreSystemKey.Text = String.Empty;
            }
        }
Exemplo n.º 2
0
        // GET api/<controller>
        public IEnumerable <ClientDataModel> GetAllClients()
        {
            int auditId = 10;
            var data    = new ClientDataModel();

            return(ClientDataManager.GetEntityDetails(data, SessionVariables.RequestProfile, 0));
        }
Exemplo n.º 3
0
        public JsonResult LoadComboData()
        {
            var clientNames = new List <string>();
            var list        = ClientDataManager.GetEntityDetails(ClientDataModel.Empty, SessionVariables.RequestProfile, 0);

            foreach (var item in list)
            {
                clientNames.Add(item.Name);
            }

            return(Json(clientNames, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        private DataTable GetClientData(int projectId)
        {
            var dt         = ClientXProjectDataManager.GetByProject(projectId, SessionVariables.RequestProfile.AuditId);
            var clientList = ClientDataManager.GetEntityDetails(ClientDataModel.Empty, SessionVariables.RequestProfile, 0);

            var resultList = new List <ClientDataModel>();

            foreach (DataRow row in dt.Rows)
            {
                var tmpClientId = Convert.ToInt32(row[ClientDataModel.DataColumns.ClientId]);
                resultList.AddRange(clientList.Where(item => item.ClientId == tmpClientId));
            }
            return(resultList.ToDataTable());
        }
Exemplo n.º 5
0
        private int GetNextValidId(int tempId)
        {
            var list = ClientDataManager.GetEntityDetails(ClientDataModel.Empty, SessionVariables.RequestProfile, 0);

            foreach (var item in list)
            {
                if (item.ClientId == tempId)
                {
                    tempId -= 1;
                    return(GetNextValidId(tempId));
                }
            }

            return(tempId);
        }
Exemplo n.º 6
0
        public JsonResult AutoComplete()
        {
            var clientNames = new List <string>();
            //strSearch = strSearch.Trim();
            //if (SearchFor.Trim() == "name")
            //{
            var list = ClientDataManager.GetEntityDetails(ClientDataModel.Empty, SessionVariables.RequestProfile, 0);

            foreach (var item in list)
            {
                clientNames.Add(item.Name);
            }

            return(Json(clientNames, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 7
0
        public ClientDataModel GetClient(int id)
        {
            int auditId = 10;
            var data    = new ClientDataModel();

            data.ClientId = id;
            var results = ClientDataManager.GetEntityDetails(data, SessionVariables.RequestProfile, 0);

            if (results == null || results.Count == 0)
            {
                var resp = new HttpResponseMessage(HttpStatusCode.NotFound)
                {
                    Content      = new StringContent(string.Format("No Client with ID = {0}", id)),
                    ReasonPhrase = "Client ID Not Found"
                };
                throw new HttpResponseException(resp);
            }
            return(results[0]);
        }
Exemplo n.º 8
0
        protected override void ShowData(int clientId)
        {
            base.ShowData(clientId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new ClientDataModel();

            data.ClientId = clientId;

            var items = ClientDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            if (items.Count == 1)
            {
                var item = items[0];
                SetData(item);
                oHistoryList.Setup(PrimaryEntity, clientId, "Client");
            }
        }