JoinEditorForm.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Windows.Forms;
  3. using FastReport.Forms;
  4. using FastReport.Utils;
  5. namespace FastReport.FastQueryBuilder
  6. {
  7. internal partial class JoinEditorForm : BaseForm
  8. {
  9. internal Link link;
  10. public JoinEditorForm()
  11. {
  12. InitializeComponent();
  13. }
  14. private void JoinEditorForm_Load(object sender, EventArgs e)
  15. {
  16. MyRes res = new MyRes("Forms,QueryBuilder");
  17. Text = res.Get("JoinEditor");
  18. label3.Text = res.Get("Tables");
  19. label4.Text = res.Get("Condition");
  20. label1.Text = link.from.table.Name;
  21. label2.Text = link.to.table.Name;
  22. label6.Text = link.from.Name;
  23. label5.Text = link.to.Name;
  24. comboBox2.DataSource = QueryEnums.JoinTypesToStr;
  25. comboBox2.SelectedIndex = (int)link.join;
  26. res = new MyRes("Forms,QueryBuilder,Where");
  27. string[] whereTypes = new string[] {
  28. res.Get("Equal"),
  29. res.Get("NotEqual"),
  30. res.Get("GtOrEqual"),
  31. res.Get("Gt"),
  32. res.Get("LtOrEqual"),
  33. res.Get("Lt"),
  34. res.Get("Like"),
  35. res.Get("NotLike") };
  36. comboBox1.DataSource = whereTypes;
  37. comboBox1.SelectedIndex = (int)link.where;
  38. button1.Text = Res.Get("Buttons,OK");
  39. button2.Text = Res.Get("Buttons,Cancel");
  40. }
  41. private void JoinEditorForm_FormClosed(object sender, FormClosedEventArgs e)
  42. {
  43. if (DialogResult == DialogResult.OK)
  44. {
  45. link.where = (QueryEnums.WhereTypes)comboBox1.SelectedIndex;
  46. link.join = (QueryEnums.JoinTypes)comboBox2.SelectedIndex;
  47. }
  48. }
  49. }
  50. }