public frmQuestion() { this.questionBO = this.questionBO ?? new QuestionBO(); this.departmentBO = this.departmentBO ?? new DepartmentBO(); InitializeComponent(); QuestionBO q = new QuestionBO(); gridControl1.DataSource = q.GetDepartmentnameFromDepartmentID(1); }
private void cboDepartment_TextChanged(object sender, EventArgs e) { DepartmentBO department = new DepartmentBO(); QuestionBO q = new QuestionBO(); var a = department.getDepartmentName(cboDepartment.Text); string b = "0"; foreach (var temp in a) { b = temp.DepartmentID.ToString(); } if (b != "0") { gridControl1.DataSource = q.GetDepartmentnameFromDepartmentID(Int32.Parse(b)); } if (b == "0") { gridControl1.DataSource = q.GetDepartmentALL(); } }