Example #1
0
 public List <StateInfoEntities> GetAllStates()
 {
     try
     {
         IStateInfoOperations     stateInfo = new StateInfoOperations();
         List <StateInfoEntities> states    = MapEntities.MapList <StateInfo, StateInfoEntities>(stateInfo.GetAllStates());
         return(states);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private PocketInfoEntities MapToBusinessEntityForUpdate(PocketInfo pocketInfo)
        {
            IStateInfoOperations       stateOperations       = new StateInfoOperations();
            IDistrictInfoOperations    districtOperations    = new DistrictInfoOperations();
            IsubDistrictInfoOperations subDistrictOperations = new SubDistrictInfoOperations();
            IVillageInfoOperations     villageOperations     = new VillageInfoOperations();
            ICropInfoOperations        cropOperations        = new CropInfoOperations();
            IFertilizerInfoOperations  fertilizerOperations  = new FertilizerInfoOperations();
            IPocketInfoOperations      pocketOperations      = new PocketInfoOperations();

            List <CropInfoEntities>       crops       = MapEntities.MapList <CropInfo, CropInfoEntities>(cropOperations.GetAllCrops().ToList());
            List <FertilizerInfoEntities> fertilizers = MapEntities.MapList <FertilizerInfo, FertilizerInfoEntities>(fertilizerOperations.GetFertilizerList());

            PocketInfoEntities pocketInfoEntities = MapEntities.Map <PocketInfo, PocketInfoEntities>(pocketInfo);

            pocketInfoEntities.StateName    = pocketInfo.StateInfo.StateName;
            pocketInfoEntities.DistrictName = pocketInfo.DistrictInfo.DistrictName;

            pocketInfoEntities.PocketVillageMappingList    = MapEntities.MapList <PocketVillageMapping, PocketVillageMappingEntities>(pocketInfo.PocketVillageMappings.ToList());
            pocketInfoEntities.PocketCropMappingList       = MapEntities.MapList <PocketCropMapping, PocketCropMappingEntities>(pocketInfo.PocketCropMappings.ToList());
            pocketInfoEntities.PocketFertilizerMappingList = MapEntities.MapList <PocketFertilizerMapping, PocketFertilizerMappingEntities>(pocketInfo.PocketFertilizerMappings.ToList());

            pocketInfoEntities.states           = MapEntities.MapList <StateInfo, StateInfoEntities>(stateOperations.GetAllStates());
            pocketInfoEntities.districts        = MapEntities.MapList <DistrictInfo, DistrictInfoEntities>(districtOperations.GetDistrictListByStateId(pocketInfoEntities.StateID.Value));
            pocketInfoEntities.pocketStatusList = MapEntities.MapList <PocketStatu, PocketStatusEntities>(pocketOperations.GetpocketStatusList());
            pocketInfoEntities.pocketStatus     = MapEntities.Map <PocketStatu, PocketStatusEntities>(pocketInfo.PocketStatu);

            PocketVillageMapping pocketMappingTemp;

            pocketInfoEntities.PocketVillageMappingList.ForEach(y =>
            {
                pocketMappingTemp = pocketInfo.PocketVillageMappings.Select(r => r).Where(r => r.Id == y.Id).FirstOrDefault();
                y.SubDistrictName = pocketMappingTemp.SubDistrictInfo.SubDistrictName;
                y.VillageName     = pocketMappingTemp.VillageInfo.VILLAGE;
                y.subDistricts    = MapEntities.MapList <SubDistrictInfo, SubDistrictInfoEntities>(subDistrictOperations.GetSubDistrictByDistrictId(pocketInfoEntities.DistrictId.Value));
                y.villages        = MapEntities.MapList <VillageInfo, VillageInfoEntities>(villageOperations.GetAllVillagesBySubDistrictId(y.SubDistrictId.Value));
            });

            PocketCropMapping pocketCropMappingTemp;

            pocketInfoEntities.PocketCropMappingList.ForEach(y =>
            {
                pocketCropMappingTemp = pocketInfo.PocketCropMappings.Select(r => r).Where(r => r.id == y.id).FirstOrDefault();
                y.CropInfoEntity      = MapEntities.Map <CropInfo, CropInfoEntities>(pocketInfo.PocketCropMappings.Select(r => r).Where(r => r.id == y.id).FirstOrDefault().CropInfo);
                y.Crops = crops;
            });

            PocketFertilizerMapping pocketFertilizerMappingTemp;

            pocketInfoEntities.PocketFertilizerMappingList.ForEach(y =>
            {
                pocketFertilizerMappingTemp = pocketInfo.PocketFertilizerMappings.Select(r => r).Where(r => r.Id == y.Id).FirstOrDefault();
                y.FertilizerInfoEntity      = MapEntities.Map <FertilizerInfo, FertilizerInfoEntities>(pocketInfo.PocketFertilizerMappings.Select(r => r).Where(r => r.Id == y.Id).FirstOrDefault().FertilizerInfo);
                y.Fertilizers = fertilizers;
            });
            return(pocketInfoEntities);
        }
        public PocketPageUIvalues GetPocketPageUIvalues()
        {
            PocketPageUIvalues        pageUIvalues        = new PocketPageUIvalues();
            IStateInfoOperations      stateInfo           = new StateInfoOperations();
            ICropInfoOperations       cropOperations      = new CropInfoOperations();
            IFertilizerInfoOperations fertilizerOperation = new FertilizerInfoOperations();
            IPocketInfoOperations     pocketInfo          = new PocketInfoOperations();

            pageUIvalues.states           = MapEntities.MapList <StateInfo, StateInfoEntities>(stateInfo.GetAllStates());
            pageUIvalues.crops            = MapEntities.MapList <CropInfo, CropInfoEntities>(cropOperations.GetAllCrops().ToList());
            pageUIvalues.fertilizers      = MapEntities.MapList <FertilizerInfo, FertilizerInfoEntities>(fertilizerOperation.GetFertilizerList());
            pageUIvalues.pocketStatusList = MapEntities.MapList <PocketStatu, PocketStatusEntities>(pocketInfo.GetpocketStatusList());

            return(pageUIvalues);
        }
        public FAdetailPageUIvalues GetFAdetailPageUIvalues()
        {
            FAdetailPageUIvalues pageUIvalues = new FAdetailPageUIvalues();

            IFAdesignationOperations faDesignationOperation = new FAdesignationOperations();

            pageUIvalues.DesignationList = MapEntities.MapIEnumerableCollection <FAdesignation, FAdesignationEntities>(faDesignationOperation.GetFAdesignationList()).ToList();

            IFAdocumentTypeOperations faDocumentTypeOperations = new FAdocumentTypeOperations();

            pageUIvalues.DocumentTypeList = MapEntities.MapIEnumerableCollection <FAdocumentType, FAdocumentTypeEntities>(faDocumentTypeOperations.GetFAdocumentTypeList()).ToList();

            //IDistrictInfoOperations districtInfoOperations = new DistrictInfoOperations();
            //pageUIvalues.DistrictList = MapEntities.MapIEnumerableCollection<DistrictInfo, DistrictInfoEntities>(districtInfoOperations.GetAllDistricts()).ToList();

            IFApaymentAgencyOperations paymentAgencyOperations = new FApaymentAgencyOperations();

            pageUIvalues.PaymentAgencyList = MapEntities.MapIEnumerableCollection <FApaymentAgency, FApaymentAgencyEntities>(paymentAgencyOperations.GetAllPaymentAgency()).ToList();

            IFAstatusOperations targetStatusOperations = new FAstatusOperations();

            pageUIvalues.FAstatusList = MapEntities.MapIEnumerableCollection <FAStatu, FAstatusEntities>(targetStatusOperations.GetFAStatusList()).ToList();

            IDealerDetailOperations dealerDetailOperations = new DealerDetailOperations();

            pageUIvalues.DealerList = MapEntities.MapIEnumerableCollection <DealerDetail, DealerDetailEntities>(dealerDetailOperations.GetAllDealerList()).ToList();

            ICropInfoOperations cropInfoOperations = new CropInfoOperations();

            pageUIvalues.CropList = MapEntities.MapIEnumerableCollection <CropInfo, CropInfoEntities>(cropInfoOperations.GetAllCrops()).ToList();

            //IPocketInfoOperations pocketInfoOperations = new PocketInfoOperations();
            //pageUIvalues.PocketList = MapEntities.MapIEnumerableCollection<PocketInfo, PocketInfoEntities>(pocketInfoOperations.GetPocketList()).ToList();

            IFaApprovedByOperations faApprovedBY = new FaApprovedByOperations();

            pageUIvalues.approvedByList = MapEntities.MapIEnumerableCollection <FAapprovedBy, FAapprovedByEntities>(faApprovedBY.GetApprovedByList()).ToList();

            IStateInfoOperations stateOperation = new StateInfoOperations();

            pageUIvalues.stateList = MapEntities.MapList <StateInfo, StateInfoEntities>(stateOperation.GetAllStates());


            return(pageUIvalues);
        }