FrmPmsBase.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using CoreFS.CA06;
  11. using Pur.Entity;
  12. namespace Pur.Entity
  13. {
  14. public partial class FrmPmsBase : FrmBase
  15. {
  16. public FrmPmsBase()
  17. {
  18. InitializeComponent();
  19. }
  20. private void FrmPmsBase_Load(object sender, EventArgs e)
  21. {
  22. }
  23. public T execute<T>(string className, string methodName, object[] param)
  24. {
  25. T t = GetJsonService().execute<T>(className, methodName, param);
  26. if (typeof(T).FullName == "System.Data.DataTable" && t == null)
  27. {
  28. DataTable dt = new DataTable();
  29. return (T)Convert.ChangeType(dt, typeof(T));
  30. }
  31. if (typeof(T).FullName.IndexOf( "System.Collections.Generic.List")>-1 && t == null)
  32. {
  33. T t1 = System.Activator.CreateInstance<T>();
  34. return t1;
  35. }
  36. return t;
  37. }
  38. public void execute(string className, string methodName, object[] param)
  39. {
  40. GetJsonService().execute(className, methodName, param);
  41. }
  42. }
  43. }