/// <summary> /// 获取最大流水号 出货单 /// </summary> /// <param name="prefix"></param> /// <returns></returns> public static int getQcOutCheckHeadMaxNumber(string prefix) { int returnNumber = 0; TC_QCYY_FILE model = Tcqcyys.GetMaxModel(prefix); if (model != null) { //取最后三位流水号 string flow = model.TC_QCYY01.Substring(model.TC_QCYY01.Length - 3); returnNumber = TypeHelper.StringToInt(flow); } return(returnNumber); }
public static void addQcOutCheckHead(TC_QCYY_FILE model, string qcx06) { //开启事务管理1.添加记录。2.添加 tc_qcz_file 。 using (TransactionScope sc = new TransactionScope()) { try { //1.添加 Tcqcyys.AddModel(model); //2.添加 tc_qcz_file List <TC_QCXX_FILE> qcxlist = Tcqcxxs.GetList(qcx06, 1); foreach (TC_QCXX_FILE qcx in qcxlist) { TC_QCZZ_FILE qcz = new TC_QCZZ_FILE(); qcz.TC_QCZZ01 = model.TC_QCYY01; qcz.TC_QCZZ02 = qcx.TC_QCXX02; qcz.TC_QCZZ06 = qcx.TC_QCXX01; qcz.TC_QCZZ07 = qcx.TC_QCXX03; qcz.TC_QCZZ08 = qcx.TC_QCXX07; qcz.TC_QCZZ10 = qcx.TC_QCXX04; qcz.TC_QCZZ11 = qcx.TC_QCXX08; qcz.TC_QCZZ09 = qcx.TC_QCXX09; Tcqczzs.AddModel(qcz); } //事务提交 sc.Complete(); } catch (Exception Ex) { throw Ex; } } }