123456789101112131415161718192021222324252627282930313233 |
- using EMIS.ViewModel;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace EMIS.CommonLogic.SystemServices
- {
- public class AlipayServices : BaseServices, IAlipayServices
- {
- public Lazy<IParameterServices> ParameterServices { get; set; }
- public string GetProductId()
- {
- DateTime today = DateTime.Today;
- string productId = ParameterServices.Value.GetParameterValue(CF_ParameterType.AlipayProductId);
- int seed = 1;
- if (productId != null)
- {
- if (productId.Substring(2, 8) == today.ToString("yyyyMMdd"))
- {
- seed = Convert.ToInt32(productId.Substring(10, productId.Length - 10)) + 1;
- }
- }
- productId = "ap" + today.ToString("yyyyMMdd") + seed.ToString().PadLeft(6, '0');
- ParameterServices.Value.SaveTo(CF_ParameterType.AlipayProductId, productId);
- return productId;
- }
- }
- }
|