LogicHandler.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Text;
  5. using System.Windows.Forms;
  6. using UAS_DeviceMonitor.DataOperate;
  7. using UAS_DeviceMonitor.Entity;
  8. namespace UAS_DeviceMonitor.PublicMethod
  9. {
  10. class LogicHandler
  11. {
  12. public LogicHandler() { }
  13. static DataHelper dh = SystemInf.dh;
  14. //用于拼接SQL
  15. static StringBuilder sql = new StringBuilder();
  16. //用于存放批量执行的SQL
  17. static List<string> sqls = new List<string>();
  18. /// <summary>
  19. /// 验证用户身份信息
  20. /// </summary>
  21. /// <param name="iUserCode"></param>
  22. /// <param name="oErrorMessage"></param>
  23. /// <returns></returns>
  24. public static bool CheckUserLogin(string iUserCode, string iPassWord, out string oErrorMessage)
  25. {
  26. oErrorMessage = "";
  27. string SQL = "select em_code from employee where upper(em_code)=:UserName and em_password =:PassWord";
  28. DataTable dt;
  29. dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode.ToUpper(), iPassWord);
  30. if (dt.Rows.Count > 0)
  31. return true;
  32. else
  33. {
  34. oErrorMessage = "用户名或者密码不正确!";
  35. return false;
  36. }
  37. }
  38. }
  39. }