Пример #1
0
        private void AddReasonCondition(ComboboxItem reason)
        {
            if (this.list_reason_all.Find(t => t.string_value == reason.string_value) == null)
                return;

            this.list_reason_all.Remove(this.list_reason_all.Find(t => t.string_value == reason.string_value));
            this.reason_all_source.DataSource = this.list_reason_all;
            this.reason_all_source.ResetBindings(true);

            int r = this.dgvReason.Rows.Add();
            this.dgvReason.Rows[r].Tag = reason;

            this.dgvReason.Rows[r].Cells[0].ValueType = typeof(string);
            this.dgvReason.Rows[r].Cells[0].Value = reason.ToString();

            this.dgvReason.Rows[r].Cells[1].Value = "x";
            this.dgvReason.Rows[r].Cells[1].ToolTipText = "ลบ";
        }
Пример #2
0
        private void AddProblemCondition(ComboboxItem prob)
        {
            if (this.list_problem_all.Find(t => t.string_value == prob.string_value) == null)
                return;

            this.list_problem_all.Remove(this.list_problem_all.Find(t => t.string_value == prob.string_value));
            this.problem_all_source.DataSource = this.list_problem_all;
            this.problem_all_source.ResetBindings(true);

            int r = this.dgvProblem.Rows.Add();
            this.dgvProblem.Rows[r].Tag = prob;

            this.dgvProblem.Rows[r].Cells[0].ValueType = typeof(string);
            this.dgvProblem.Rows[r].Cells[0].Value = prob.ToString();

            this.dgvProblem.Rows[r].Cells[1].Value = "x";
            this.dgvProblem.Rows[r].Cells[1].ToolTipText = "ลบ";
        }