Esempio n. 1
0
        private BaseFormContent GetBaseFormContent(RaeClassContentType contentType, FormContent formContent)
        {
            BaseFormContent baseFormContent = new BaseFormContent();

            baseFormContent.FContentType = contentType.ToString();
            baseFormContent.FDocStatus   = DocStatus.SAVE;
            baseFormContent.FNumber      = formContent.fnumber;
            baseFormContent.FName        = formContent.fname;
            baseFormContent.FLevel       = formContent.flevel;
            baseFormContent.FJsonData    = JsonHelper.SerializeObject(formContent);
            baseFormContent.FCreateTime  = DateTime.Now;
            baseFormContent.FModifyTime  = DateTime.Now;
            return(baseFormContent);
        }
 public int GetMaxIndex(RaeClassContentType contentType)
 {
     return(raeClassContext.SerialNumberSet.Where(x => x.FContentType.Equals(contentType.ToString())).FirstOrDefault().FCurrentGeneratedIndex);
 }
        public void UpdateMaxIndex(RaeClassContentType contentType, int gap = 1)
        {
            var query = raeClassContext.SerialNumberSet.Where(x => x.FContentType.Equals(contentType.ToString())).FirstOrDefault();

            query.FCurrentGeneratedIndex += gap;
            raeClassContext.SaveChanges();
        }
        public string GetSerialNumber(RaeClassContentType contentType)
        {
            int maxIndex = GetMaxIndex(contentType) + 1;

            return(contentType.ToString() + CommonUtils.GetDateTimeNowSerial() + maxIndex.ToString());
        }