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()) { 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()) { 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 void btnForm_Click(object sender, EventArgs e) { Application.OpenForms.OfType <Form>().Where(x => x.Name != "Main").ToList().ForEach(x => x.Close()); frmSurveyQuestionnaire fsq = new frmSurveyQuestionnaire(); fsq.TopLevel = false; pnlContent.Controls.Add(fsq); fsq.Dock = DockStyle.Fill; fsq.Show(); btnHome.Enabled = true; btnForm.Enabled = false; btnSummary.Enabled = true; btnSettings.Enabled = true; }