public FormPo() { InitializeComponent(); _taBilltype = GlobalBuffer.BillTypeList.Single(p => p.BillType == (int)_billType); _report = ReportHelper.InitReport(_billType); _report.Initialize += () => ReportHelper._report_Initialize(_report, _bill, DetailTableName, IndexColumnName); }
private static string CreateNewBillNum(string[] rules, TA_BILLTYPE bt) { var sb = new StringBuilder(); foreach (var rule in rules) { var cs = rule.Split(':'); var condName = cs[0]; var condValue = ""; if (cs.Length > 1) { condValue = cs[1]; } switch (condName) { case "P": sb.Append(bt.Prefix); break; case "D": var sDate = string.Empty; switch (condValue) { case "l": sDate = DateTime.Now.ToString("yyyyMMdd"); break; case "s": sDate = DateTime.Now.ToString("yyMMdd"); break; } sb.Append(sDate); break; case "T": var sTime = string.Empty; switch (condValue) { case "l": sTime = DateTime.Now.ToString("hhmmss"); break; case "s": sTime = DateTime.Now.ToString("hhmm"); break; } sb.Append(sTime); break; case "N": if (DateTime.Now.DayOfYear - bt.LastBillTime.DayOfYear > 0) { bt.LastNumber = 1; } var serialCount = Convert.ToInt32(condValue); var sNumber = GetSerialNumStr(serialCount, bt.LastNumber); sb.Append(sNumber); break; } sb.Append(Separator); } return(sb.ToString()); }