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 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)); }