public ActionResult GetVillagesOfSubDistrictPocket(string pocketId, string SubDistrictId) { pocketId = Convert.ToString(JsonConvert.DeserializeObject <int>(pocketId)); ServiceInputObject serviceInputsForDocType = new ServiceInputObject { baseURL = ConfigSettings.WebApiBaseAddress, controllerName = "Pocket", methodName = "GetPocketDetail", parameterValue = pocketId }; PocketInfoEntities pocketDetail = new PocketInfoEntities(); pocketDetail = ServiceMethods.GenerateGatRequest <PocketInfoEntities>(serviceInputsForDocType); List <PocketVillageMappingEntities> pocketVillages = new List <PocketVillageMappingEntities>(); pocketVillages = pocketDetail.PocketVillageMappingList.Select(x => x).Where(x => x.SubDistrictId == Convert.ToInt32(SubDistrictId)).ToList(); List <VillageInfoEntities> villageList = new List <VillageInfoEntities>(); foreach (var villages in pocketVillages) { villageList.AddRange(villages.villages); } List <SelectListItem> FinalVillageList = CommonOperations.BindDropdwon <VillageInfoEntities>(villageList, "VillageID", "VILLAGE"); return(Json(FinalVillageList)); }
public ActionResult SelectedFarmerDetail(int id) { ServiceInputObject serviceInputObject = new ServiceInputObject { baseURL = ConfigSettings.WebApiBaseAddress, controllerName = "FarmerDetail", parameterValue = Convert.ToString(id) }; FarmerDetailEntities farmerDetail = ServiceMethods.GenerateGatRequest <FarmerDetailEntities>(serviceInputObject); FarmerDetailModel farmerDetailModel = new FarmerDetailModel(); FarmerDetailPageUIvalues pageUIValues = GetPageUIvalues(); farmerDetailModel.crops = CommonOperations.BindDropdwon <CropInfoEntities>(pageUIValues.CropList, "CropID", "CropName"); farmerDetailModel.farmerTypes = CommonOperations.BindDropdwon <FarmerTypeEntities>(pageUIValues.FarmerTypeList, "id", "farmerType"); farmerDetailModel.countryCodes = CommonOperations.GetCountryCodes(); farmerDetailModel.DealerList = CommonOperations.BindDropdwon <DealerDetailEntities>(pageUIValues.DealerList, "id", "dealerName"); farmerDetailModel.pocketList = CommonOperations.BindDropdwon <PocketInfoEntities>(pageUIValues.PocketList, "PocketID", "PocketName"); farmerDetailModel.irrigationSourceList = CommonOperations.BindDropdwon <IrrigationSourceEntities>(pageUIValues.irrigationSourceList, "Id", "SourceName").ToList(); farmerDetailModel.isInDetailMode = true; farmerDetailModel.farmerDetail = farmerDetail; farmerDetailModel.Action = ActionTypeEnum.Select; return(View("AddFarmerDetail", farmerDetailModel)); }
public ActionResult GetSubDistrictsOfPocket(string pocketId) { pocketId = Convert.ToString(JsonConvert.DeserializeObject <int>(pocketId)); ServiceInputObject serviceInputsForDocType = new ServiceInputObject { baseURL = ConfigSettings.WebApiBaseAddress, controllerName = "Pocket", methodName = "GetPocketDetail", parameterValue = pocketId }; PocketInfoEntities pocketDetail = new PocketInfoEntities(); pocketDetail = ServiceMethods.GenerateGatRequest <PocketInfoEntities>(serviceInputsForDocType); List <SubDistrictInfoEntities> subDistricts = new List <SubDistrictInfoEntities>(); foreach (var villageMapping in pocketDetail.PocketVillageMappingList) { subDistricts.AddRange(villageMapping.subDistricts); } subDistricts = subDistricts.Distinct(new DistinctItemComparer()).ToList(); List <SelectListItem> SubDistricts = CommonOperations.BindDropdwon <SubDistrictInfoEntities>(subDistricts, "SubDistID", "SubDistrictName"); return(Json(SubDistricts)); }
public ActionResult GetDistrictByStateId(string stateId) { stateId = Convert.ToString(JsonConvert.DeserializeObject <int>(stateId)); ServiceInputObject serviceObject = new ServiceInputObject { baseURL = ConfigSettings.WebApiBaseAddress, controllerName = "District", methodName = "GetDistrictOfState", parameterValue = stateId }; List <DistrictInfoEntities> districtInfo = ServiceMethods.GenerateGatRequest <List <DistrictInfoEntities> >(serviceObject); List <SelectListItem> districtList = CommonOperations.BindDropdwon <DistrictInfoEntities>(districtInfo, "DistID", "DistrictName"); return(Json(districtList)); }
public ActionResult GetPocketByDistrictId(string districtId) { districtId = Convert.ToString(JsonConvert.DeserializeObject <int>(districtId)); ServiceInputObject serviceObject = new ServiceInputObject { baseURL = ConfigSettings.WebApiBaseAddress, controllerName = "Pocket", methodName = "GetActivePocketsByDistrictId", parameterValue = districtId }; List <PocketInfoEntities> pocketIfo = ServiceMethods.GenerateGatRequest <List <PocketInfoEntities> >(serviceObject); List <SelectListItem> pocketList = CommonOperations.BindDropdwon <PocketInfoEntities>(pocketIfo, "PocketID", "PocketName"); return(Json(pocketList)); }
public ActionResult GetVillageBySubDistrictId(string subDistrictId) { subDistrictId = Convert.ToString(JsonConvert.DeserializeObject <int>(subDistrictId)); ServiceInputObject serviceObject = new ServiceInputObject { baseURL = ConfigSettings.WebApiBaseAddress, controllerName = "Village", methodName = "GetVillageListofSubDistrict", parameterValue = subDistrictId }; List <VillageInfoEntities> villageInfoEntities = ServiceMethods.GenerateGatRequest <List <VillageInfoEntities> >(serviceObject); List <SelectListItem> villageList = CommonOperations.BindDropdwon <VillageInfoEntities>(villageInfoEntities, "VillageID", "VILLAGE"); return(Json(villageList)); }
public ActionResult GetDistrictsOfPocket(string pocketId) { pocketId = Convert.ToString(JsonConvert.DeserializeObject <int>(pocketId)); ServiceInputObject serviceInputsForDocType = new ServiceInputObject { baseURL = ConfigSettings.WebApiBaseAddress, controllerName = "Pocket", methodName = "GetPocketDetail", parameterValue = pocketId }; PocketInfoEntities pocketDetail = new PocketInfoEntities(); pocketDetail = ServiceMethods.GenerateGatRequest <PocketInfoEntities>(serviceInputsForDocType); List <SelectListItem> Districts = CommonOperations.BindDropdwon <DistrictInfoEntities>(pocketDetail.districts, "DistID", "DistrictName"); return(Json(Districts)); }
public ActionResult GetPocketInitialValues() { ServiceInputObject serviceObject = new ServiceInputObject { baseURL = ConfigSettings.WebApiBaseAddress, controllerName = "Pocket", methodName = "GetPocketPageUIvalues" }; PocketPageUIvalues pageUiValues = ServiceMethods.GenerateGatRequest <PocketPageUIvalues>(serviceObject); PocketDropdownValueForAddPage dropdownValue = new PocketDropdownValueForAddPage(); dropdownValue.states = CommonOperations.BindDropdwon <StateInfoEntities>(pageUiValues.states, "StateID", "StateName"); dropdownValue.crops = CommonOperations.BindDropdwon <CropInfoEntities>(pageUiValues.crops, "CropID", "CropName"); dropdownValue.fertilizers = CommonOperations.BindDropdwon <FertilizerInfoEntities>(pageUiValues.fertilizers, "Id", "Fertilizer"); dropdownValue.pocketStatusList = CommonOperations.BindDropdwon <PocketStatusEntities>(pageUiValues.pocketStatusList, "Id", "PocketStatus"); return(Json(dropdownValue)); }
public ActionResult GetPageUIvaluesForPocket(string pocketId) { pocketId = Convert.ToString(JsonConvert.DeserializeObject <int>(pocketId)); ServiceInputObject serviceInputObject = new ServiceInputObject { baseURL = ConfigSettings.WebApiBaseAddress, controllerName = "FarmerDetail", methodName = "GetPocketMappingData", parameterValue = pocketId }; FarmerDetailPageUIvalues pageUIvalues = ServiceMethods.GenerateGatRequest <FarmerDetailPageUIvalues>(serviceInputObject); PocketDropdownValueForAddPage dropdownValue = new PocketDropdownValueForAddPage(); dropdownValue.crops = CommonOperations.BindDropdwon <CropInfoEntities>(pageUIvalues.CropList, "CropID", "CropName"); dropdownValue.villages = CommonOperations.BindDropdwon <VillageInfoEntities>(pageUIvalues.villageList, "VillageID", "VILLAGE"); return(Json(dropdownValue)); }
public ActionResult AddFarmerDetail() { FarmerDetailModel farmerDetailModel = new FarmerDetailModel(); farmerDetailModel.farmerDetail = new FarmerDetailEntities(); FarmerDetailPageUIvalues pageUIValues = GetPageUIvalues(); farmerDetailModel.crops = CommonOperations.BindDropdwon <CropInfoEntities>(pageUIValues.CropList, "CropID", "CropName"); farmerDetailModel.farmerTypes = CommonOperations.BindDropdwon <FarmerTypeEntities>(pageUIValues.FarmerTypeList, "id", "farmerType"); farmerDetailModel.countryCodes = CommonOperations.GetCountryCodes(); farmerDetailModel.DealerList = CommonOperations.BindDropdwon <DealerDetailEntities>(pageUIValues.DealerList, "id", "dealerName"); farmerDetailModel.pocketList = CommonOperations.BindDropdwon <PocketInfoEntities>(pageUIValues.PocketList, "PocketID", "PocketName"); farmerDetailModel.irrigationSourceList = CommonOperations.BindDropdwon <IrrigationSourceEntities>(pageUIValues.irrigationSourceList, "Id", "SourceName").ToList(); farmerDetailModel.farmerDetail.farmerLandMappingList.Add(new FarmerLandMappingEntities()); farmerDetailModel.farmerDetail.farmerConsumptionMappingList.Add(new FarmerConsumptionMappingEntities()); farmerDetailModel.farmerDetail.farmerCropMappingList.Add(new FarmerCropMappingEntities()); farmerDetailModel.farmerDetail.farmerPestiesMappingList.Add(new FarmerPesticesMappingEntities()); farmerDetailModel.farmerDetail.inputSoruceList.Add(new FarmerInputSourceMappingEntities()); farmerDetailModel.Action = ActionTypeEnum.Insert; return(View("AddFarmerDetail", farmerDetailModel)); }