예제 #1
0
        public async Task <int> UserTemplateInsertAsync(int templateID, string userCode, string templateName, string templateContent)
        {
            var usertemplate = await Store.GetUsertemplateAsync(a => a.Where(x => x.Usercode == userCode && x.Templatename == templateName && x.Templateid != templateID && x.Templateid > 0), true);

            if (usertemplate != null)
            {
                SobeyRecException.ThrowSelfOneParam(templateName, GlobalDictionary.GLOBALDICT_CODE_THE_USER_TEMPLATE_HAS_EXISTS_ONEPARAM, null, string.Format(GlobalDictionary.Instance.GetMessageByCode(GlobalDictionary.GLOBALDICT_CODE_THE_USER_TEMPLATE_HAS_EXISTS_ONEPARAM),
                                                                                                                                                              templateName), null);
                return(-1);
            }

            if (templateID <= 0)
            {
                templateID = IngestGlobalDBContext.next_val("DBP_SQ_UESRTEMPLATEID");
            }

            //DBACCESS.AddUserTemplate(userTemplate);
            if (!string.IsNullOrWhiteSpace(templateContent))
            {
                int byteLength = Encoding.UTF8.GetByteCount(templateContent);
                templateContent = FillBlankToString(templateContent, byteLength);
            }
            await Store.InsertUserTemplateAsync(templateID, userCode, templateName, templateContent);

            return(templateID);
        }
예제 #2
0
 public GlobalInfoStore(IngestGlobalDBContext baseDataDbContext)
 {
     Context = baseDataDbContext;
 }