/// <summary> /// 获得凭证编号 /// </summary> /// <param name="pzlx"></param> /// <returns></returns> public static string GetZWPZBH(ZWPZLX pzlx) { using (CtxRuntime ctxBase = new CtxRuntime()) { string year = LoginInfo.LoginDate.Year.ToString(); string month = LoginInfo.LoginDate.Month.ToString("00"); ZWPZBH zWPZBH = (from t in ctxBase.ZWPZBH where t.ZWPZBH_KJND == year where t.ZWPZBH_KJQJ == month where t.ZWPZBH_PZZ == pzlx.ZWPZLX_PZZ select t).SingleOrDefault(); if (zWPZBH != null) { string result = $"{pzlx.ZWPZLX_PZZ}{zWPZBH.ZWPZBH_PZBH}"; zWPZBH.ZWPZBH_PZBH = (int.Parse(zWPZBH.ZWPZBH_PZBH) + 1).ToString("0000"); zWPZBH.ZWPZBH_PZRQ = DHelper.ConverToDateString(LoginInfo.LoginDate); try { ctxBase.SaveChanges(); return(result); } catch { return(null); } } return(null); } }
/// <summary> /// 表头赋值 /// </summary> /// <param name="vit"></param> private void IniPZK(VIT vit) { base.Entity.ZWPZK_KJND = LoginInfo.LoginDate.Year.ToString(); base.Entity.ZWPZK_KJQJ = LoginInfo.LoginDate.Month.ToString("00"); base.Entity.ZWPZK_PZRQ = DHelper.ConverToDateString(LoginInfo.LoginDate); base.Entity.ZWPZLX = CtxEntity.ZWPZLX.Single((ZWPZLX t) => t.ZWPZLX_LXBH == vit.VoucherType); base.Entity.ZWPZK_ZDR = LoginInfo.LoginName; base.Entity.ZWPZK_KJZG = vit.Supervisor; base.Entity.ZWPZK_FJZS = 0; base.Entity.ZWPZK_FHF = "0"; base.Entity.ZWPZK_JZF = "0"; base.Entity.ZWPZK_WZF = "1"; base.Entity.ZWPZK_ZFF = "0"; base.Entity.ZWPZK_XJDQ = "0"; base.Entity.ZWPZK_WBBM = string.Empty; base.Entity.ZWPZK_WBZJ = string.Empty; base.Entity.ZWPZK_WBPZ = string.Empty; base.Entity.ZWPZK_CWBZ = "0"; base.Entity.ZWPZK_CWXX = " "; }