/// <summary> /// 生成id /// </summary> /// <returns></returns> private int GenerateId(EnrollPaytHdr model) { string id; string tag = "E"; string now = tag + DateTime.Now.ToString("yyyyMM"); if (model != null) { string s = model.refNo.ToString(); string prefix = s.Substring(0, 7); id = (prefix == now ? int.Parse(s.Remove(0, 7)) + 1 : 1).ToString().PadLeft(4, '0'); } else { id = "0001"; } return int.Parse(now + id); }