private async void btnAdd_Click(object sender, EventArgs e) { if (btnAdd.Text == "Add") { if (IsValid()) { HealtCrisisList obj = new HealtCrisisList(); obj.ListHealthCrisis = txtHealthCrisis.Text; await healthCrisisList.Create(obj); frmSurveyQuestionnaire questionnaire = (frmSurveyQuestionnaire)Application.OpenForms["frmSurveyQuestionnaire"]; questionnaire.LoadHealthCrisis(); this.Close(); } } if (btnAdd.Text == "Update") { if (IsValidUpdate()) { HealtCrisisList obj = await healthCrisisList.Get(frmSettings.HealthCrisisID); obj.ListHealthCrisis = txtHealthCrisis.Text; await healthCrisisList.Update(obj); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadHealthCrisis(); this.Close(); } } }
private async void btnAdd_Click(object sender, EventArgs e) { if (btnAdd.Text == "Add") { if (IsValid()) { Municipality municipality = new Municipality(); municipality.MunicipalityName = txtMunicipality.Text.Trim(); municipality.District = district; await repository.Create(municipality); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadMunicipality(); this.Close(); } } if (btnAdd.Text == "Update") { if (IsValidUpdate()) { Municipality municipality = await repository.Get(frmSettings.MunID); municipality.MunicipalityName = txtMunicipality.Text.Trim(); municipality.District = district; await repository.Update(municipality); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadMunicipality(); this.Close(); } } }
private async void btnAdd_Click(object sender, EventArgs e) { if (btnAdd.Text == "Add") { if (IsValid()) { Cluster cluster = new Cluster(); cluster.ClusterName = txtCluster.Text; await repository.Create(cluster); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadCluster(); this.Close(); } } if (btnAdd.Text == "Update") { if (IsValidUpdate()) { Cluster cluster = await repository.Get(frmSettings.ClusID); cluster.ClusterName = txtCluster.Text; await repository.Update(cluster); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadCluster(); this.Close(); } } }
private async void btnAdd_Click(object sender, EventArgs e) { if (btnAdd.Text == "Add") { if (IsValid()) { OtherSourcesList obj = new OtherSourcesList(); obj.ListOtherSources = txtOtherSources.Text; await otherSourcesList.Create(obj); frmSurveyQuestionnaire questionnaire = (frmSurveyQuestionnaire)Application.OpenForms["frmSurveyQuestionnaire"]; await questionnaire.LoadOtherSources(); this.Close(); } } if (btnAdd.Text == "Update") { if (IsValidUpdate()) { OtherSourcesList obj = await otherSourcesList.Get(frmSettings.OtherSourcesID); obj.ListOtherSources = txtOtherSources.Text; await otherSourcesList.Update(obj); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadOtherSources(); this.Close(); } } }
private async void btnAdd_Click(object sender, EventArgs e) { if (btnAdd.Text == "Add") { if (IsValid()) { HealthRecommendationList obj = new HealthRecommendationList(); obj.ListHealthRecommendation = txtHealthRecommendation.Text; await healthRecommedationList.Create(obj); this.Close(); } } if (btnAdd.Text == "Update") { if (IsValidUpdate()) { HealthRecommendationList obj = await healthRecommedationList.Get(frmSettings.HealthRecommendationID); obj.ListHealthRecommendation = txtHealthRecommendation.Text; await healthRecommedationList.Update(obj); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadHealthRecommendation(); this.Close(); } } }
private async void btnAdd_Click(object sender, EventArgs e) { if (btnAdd.Text == "Add") { if (IsValid()) { ReasonList obj = new ReasonList(); obj.ListReason = txtReason.Text; await reasonList.Create(obj); frmSurveyQuestionnaire questionnaire = (frmSurveyQuestionnaire)Application.OpenForms["frmSurveyQuestionnaire"]; this.Close(); } } if (btnAdd.Text == "Update") { if (IsValidUpdate()) { ReasonList obj = await reasonList.Get(frmSettings.ReasonID); obj.ListReason = txtReason.Text; await reasonList.Update(obj); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadReason(); this.Close(); } } }
private async void btnAdd_Click(object sender, EventArgs e) { if (btnAdd.Text == "Add") { if (IsValid()) { EntrepreneurialActivitiesList obj = new EntrepreneurialActivitiesList(); obj.ListEntrepreneurialActivities = txtEntrepreneurial.Text; await entrepreneurialActivitiesList.Create(obj); frmSurveyQuestionnaire questionnaire = (frmSurveyQuestionnaire)Application.OpenForms["frmSurveyQuestionnaire"]; await questionnaire.LoadEntreprenuerial(); this.Close(); } } if (btnAdd.Text == "Update") { if (IsValidUpdate()) { EntrepreneurialActivitiesList obj = await entrepreneurialActivitiesList.Get(frmSettings.EntrepreneurialID); obj.ListEntrepreneurialActivities = txtEntrepreneurial.Text; await entrepreneurialActivitiesList.Update(obj); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadEntrepreneurial(); this.Close(); } } }
private async void btnAdd_Click(object sender, EventArgs e) { if (btnAdd.Text == "Add") { if (IsValid()) { Barangay barangay = new Barangay(); barangay.BarangayName = txtBarangay.Text; barangay.MunID = MunID; barangay.BarangayCluster = cbCluster.Text; await rep_Barangay.Create(barangay); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadBarangay(); this.Close(); } } if (btnAdd.Text == "Update") { if (IsValidUpdate()) { Barangay barangay = await rep_Barangay.Get(frmSettings.BrgyID); barangay.BarangayName = txtBarangay.Text; barangay.MunID = MunID; barangay.BarangayCluster = cbCluster.Text; await rep_Barangay.Update(barangay); frmSettings setting = (frmSettings)Application.OpenForms["frmSettings"]; await setting.LoadBarangay(); this.Close(); } } }
private async void btnVerify_Click(object sender, EventArgs e) { if (txtCode.Text != "00000000") { MessageBox.Show("Action failed! Invalid Verification Code!", "Error!"); return; } else { //var SalariesWagesID = GetRespondentSalariesWages.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < SalariesWagesID.Count; i++) // await respondentSalariesWages.Delete(SalariesWagesID[i].ID); //var EntrepreneurialID = GetRespondentEntrepreneurialActivities.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < EntrepreneurialID.Count; i++) // await respondentEntrepreneurialActivities.Delete(EntrepreneurialID[i].ID); //var OtherSourcesID = GetRespondentOtherSources.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < OtherSourcesID.Count; i++) // await respondentOtherSources.Delete(OtherSourcesID[i].ID); //var GoodsID = GetRespondentGoods.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < GoodsID.Count; i++) // await respondentGoods.Delete(GoodsID[i].ID); //var ServicesID = GetRespondentServices.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < ServicesID.Count; i++) // await respondentServices.Delete(ServicesID[i].ID); //var BreadID = GetBreads.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < BreadID.Count; i++) // await breadsAndCereals.Delete(BreadID[i].ID); //var MeatID = GetMeats.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < MeatID.Count; i++) // await Meats.Delete(MeatID[i].ID); //var SeafoodID = GetSeafoods.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < SeafoodID.Count; i++) // await fishAndSeafood.Delete(SeafoodID[i].ID); //var MilkCheeseID = GetMilkCheese.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < MilkCheeseID.Count; i++) // await milkCheeseEggs.Delete(MilkCheeseID[i].ID); //var OilFatID = GetOilsAndFats.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < OilFatID.Count; i++) // await oilsAndFats.Delete(OilFatID[i].ID); //var FruitID = GetFruits.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < FruitID.Count; i++) // await Fruit.Delete(FruitID[i].ID); //var VegetableID = GetVegetables.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < VegetableID.Count; i++) // await Vegetable.Delete(VegetableID[i].ID); //var SugarJamID = GetSugarJamHoneyChocolates.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < SugarJamID.Count; i++) // await sugarJamHoney.Delete(SugarJamID[i].ID); //var FoodProductID = GetFoodProducts.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < FoodProductID.Count; i++) // await foodProduct.Delete(FoodProductID[i].ID); //var NonAlcoholicID = GetNonAlcoholicBeverages.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < NonAlcoholicID.Count; i++) // await nonAlcoholicBeverages.Delete(NonAlcoholicID[i].ID); //var MineralID = GetMineralwaterSoftdrinkJuices.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < MineralID.Count; i++) // await mineralWaterSoftdrinks.Delete(MineralID[i].ID); //var AlcoholicID = GetAlcoholicBeverages.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < AlcoholicID.Count; i++) // await alcoholicBeverages.Delete(AlcoholicID[i].ID); //var TobaccoID = GetTobaccos.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < TobaccoID.Count; i++) // await Tobaccos.Delete(TobaccoID[i].ID); //var ClothingID = GetClothings.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < ClothingID.Count; i++) // await Clothings.Delete(ClothingID[i].ID); //var FootwearID = GetFootwears.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < FootwearID.Count; i++) // await Footwears.Delete(FootwearID[i].ID); //var HousingID = GetHousings.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < HousingID.Count; i++) // await Housings.Delete(HousingID[i].ID); //var WatersupplyID = GetWatersupplyMiscellaneous.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < WatersupplyID.Count; i++) // await waterSupplyMisc.Delete(WatersupplyID[i].ID); //var ElectricityID = GetElectricityGas.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < ElectricityID.Count; i++) // await electricityGasFuel.Delete(ElectricityID[i].ID); //var MedicalProductID = GetMedicalProducts.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < MedicalProductID.Count; i++) // await medicalProducts.Delete(MedicalProductID[i].ID); //var OutpatientID = GetOutpatientMedicalServices.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < OutpatientID.Count; i++) // await outpatientMedicalServices.Delete(OutpatientID[i].ID); //var InpatientID = GetInpatientMedicalServices.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < InpatientID.Count; i++) // await inpatientMedicalServices.Delete(InpatientID[i].ID); //var PersonalTransportID = GetPersonalTransports.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < PersonalTransportID.Count; i++) // await personalTransport.Delete(PersonalTransportID[i].ID); //var TransportServicesID = GetTransportServices.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < TransportServicesID.Count; i++) // await transportServices.Delete(TransportServicesID[i].ID); //var PostalID = GetPostalServices.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < PostalID.Count; i++) // await postalServices.Delete(PostalID[i].ID); //var TelephoneID = GetTelephoneTelefaxServices.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < TelephoneID.Count; i++) // await telephoneTelefaxes.Delete(TelephoneID[i].ID); //var RecreationalItemsID = GetRecreationalItemsEquipment.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < RecreationalItemsID.Count; i++) // await recreationalItemsEquipment.Delete(RecreationalItemsID[i].ID); //var RecreactionCultureID = GetRecreationAndCultures.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < RecreactionCultureID.Count; i++) // await recreationAndculture.Delete(RecreactionCultureID[i].ID); //var NewspaperID = GetNewspaperBookStationaries.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < NewspaperID.Count; i++) // await newspaperBookStationary.Delete(NewspaperID[i].ID); //var TuitionID = GetTuitionFees.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < TuitionID.Count; i++) // await tuitionFee.Delete(TuitionID[i].ID); //var EducationID = GetEducations.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < EducationID.Count; i++) // await Educations.Delete(EducationID[i].ID); //var AllowanceID = GetAllowanceOfStudents.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < AllowanceID.Count; i++) // await allowanceOfStudent.Delete(AllowanceID[i].ID); //var EducExpensesID = GetOtherEducationalExpenses.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < EducExpensesID.Count; i++) // await otherEducationalExpense.Delete(EducExpensesID[i].ID); //var PersonalCareID = GetPersonalCares.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < PersonalCareID.Count; i++) // await personalCare.Delete(PersonalCareID[i].ID); //var PersonalEffectID = GetPersonalEffects.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < PersonalEffectID.Count; i++) // await personalEffect.Delete(PersonalEffectID[i].ID); //var InsuranceID = GetInsurances.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < InsuranceID.Count; i++) // await Insurances.Delete(InsuranceID[i].ID); //var HealthCrisisID = GetRespondentHealthCrises.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < HealthCrisisID.Count; i++) // await respondentHealthCrisis.Delete(HealthCrisisID[i].ID); //var EconomicCrisisID = GetRespondentEconomicCrises.Where(x => x.RespondentID == frmSettings.RespondentID).ToList(); //for (int i = 0; i < EconomicCrisisID.Count; i++) // await respondentEconomicCrisis.Delete(EconomicCrisisID[i].ID); //await Survey.Delete(frmSettings.SurveyID); await Respondent.Delete(frmSettings.RespondentID); MessageBox.Show("Selected Survey Has been deleted", "Deleted!"); frmSettings obj = (frmSettings)Application.OpenForms["frmSettings"]; await obj.LoadSurveys(); this.Close(); } }