锐腾搅拌上料功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using ICSSoft.Frame.Data.Entity;
  6. using ICSSoft.Base.Config.AppConfig;
  7. namespace ICSSoft.Frame.Data.DAL
  8. {
  9. public class ICSDataAcquiseDAL
  10. {
  11. public static int IncludingRes(string recCode, string dsconn)
  12. {
  13. FramDataContext db = new FramDataContext(dsconn);
  14. db.Connection.Open();
  15. db.Transaction = db.Connection.BeginTransaction();
  16. try
  17. {
  18. var line = db.ICSRES.SingleOrDefault(a => a.RESCODE == recCode);
  19. if (line == null)
  20. return 0;
  21. else
  22. {
  23. var lineone = db.ICSUser2Res.SingleOrDefault(a => a.RESCODE == recCode && a.USERCODE == AppConfig.UserCode);
  24. if (lineone == null)
  25. return 1;
  26. else
  27. return 2;
  28. }
  29. }
  30. catch (Exception ex)
  31. {
  32. db.Transaction.Rollback();
  33. throw ex;
  34. }
  35. }
  36. }
  37. }