예제 #1
0
        public IList <SoilDataResponse> GetSoilDetails()
        {
            IList <SoilDataResponse> dataresponse = new List <SoilDataResponse>();

            try
            {
                if (HttpContext.Current.Session[ApplicationConstant.UserSession] != null)
                {
                    SessionData sessionObject = (SessionData)HttpContext.Current.Session[ApplicationConstant.UserSession];

                    AggieGlobalLogManager.Info("PlotController :: GetSoilDetails started ");
                    var connectionString = "AggieGlobal";
                    var repo             = new PlotManager(connectionString);
                    dataresponse = repo.GetSoilDetails();
                    repo.Dispose();
                }
            }
            catch (Exception e)
            {
                SoilDataResponse det = new SoilDataResponse();
                det.Status = ResponseStatus.Failed;
                det.Error  = "Failed to retreive data";
                dataresponse.Add(det);
                AggieGlobalLogManager.Fatal("AccountRepository :: LoginCheck failed :: " + e.Message);
            }
            return(dataresponse);
        }
예제 #2
0
        public IList <SoilDataResponse> GetSoilDetails()
        {
            IList <SoilDataResponse> dataresponse = new List <SoilDataResponse>();

            try
            {
                SoilDataResponse responseAll = new SoilDataResponse();
                responseAll.soildetail   = new RepositoryCreator().SoilRepository.GetSoilDetails();
                responseAll.soilphdetail = new RepositoryCreator().SoilPhRepository.GetSoilPhDetails();
                responseAll.Status       = ResponseStatus.Successful;
                dataresponse.Add(responseAll);
            }
            catch (Exception e) { AggieGlobalLogManager.Fatal("AccountRepository :: LoginCheck failed :: " + e.Message); }

            return(dataresponse);
        }