SaleFundCommon.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Data;
  5. namespace Core.StlMes.Client.Sale.SaleFundMgt.Common
  6. {
  7. public class SaleFundCommon
  8. {
  9. /// <summary>
  10. /// 检查结算单位,客户名称,二级单位,合同单位有效性
  11. /// </summary>
  12. /// <param name="balancesubject"></param>
  13. /// <param name="buyercode"></param>
  14. /// <param name="secondaccount"></param>
  15. /// <param name="pactno"></param>
  16. /// <param name="errMsg"></param>
  17. /// <returns></returns>
  18. public static Boolean IsReasonable(string balancesubject, string buyercode, string secondaccount, string pactno, out string errMsg)
  19. {
  20. errMsg = "";
  21. try
  22. {
  23. if (balancesubject.Length == 0)
  24. {
  25. errMsg = "结算单位空";
  26. return false;
  27. }
  28. if (buyercode.Length == 0)
  29. {
  30. errMsg = "客户单位空";
  31. return false;
  32. }
  33. if (secondaccount.Length == 0)
  34. {
  35. errMsg = "二级账户单位空";
  36. return false;
  37. }
  38. if (pactno.Length == 0)
  39. {
  40. errMsg = "合同号空";
  41. return false;
  42. }
  43. }
  44. catch(Exception ex)
  45. {
  46. errMsg = ex.Message;
  47. return false;
  48. }
  49. return true;
  50. }
  51. public static Boolean IsReasonable(string balancesubject, string buyercode, string secondaccount,out string errMsg)
  52. {
  53. errMsg = "";
  54. return IsReasonable(balancesubject, buyercode, secondaccount, "PACT", out errMsg);
  55. }
  56. public static Boolean IsReasonable(string balancesubject, string buyercode, out string errMsg)
  57. {
  58. errMsg = "";
  59. return IsReasonable(balancesubject, buyercode, "secondaccount", "PACT", out errMsg);
  60. }
  61. public static string GetBusiSeq()
  62. {
  63. return Util.DateTimeUtil.GetSystemDate() + new System.Random().Next(100000);
  64. }
  65. }
  66. }