/// <summary> /// 保存用户表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="userEntity">用户实体</param> /// <returns></returns> public string SaveForm(string keyValue, RegisterUserEntity userEntity) { try { if (string.IsNullOrWhiteSpace(userEntity.SimpleSpelling)) { if (Str.CheckStringChineseReg(userEntity.RealName)) { userEntity.SimpleSpelling = Str.PinYin(userEntity.RealName).ToUpper(); userEntity.Initials = userEntity.SimpleSpelling.Substring(0, 1); } else { userEntity.SimpleSpelling = userEntity.RealName.ToUpper(); userEntity.Initials = userEntity.SimpleSpelling.Substring(0, 1); } } keyValue = service.SaveForm(keyValue, userEntity); CacheFactory.Cache().RemoveCache(cacheKey); //UpdateIMUserList(keyValue, true, userEntity); return(keyValue); } catch (Exception) { throw; } }
/// <summary> /// 保存用户表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="userEntity">用户实体</param> /// <returns></returns> public void SaveForm(string keyValue, CollectionEntity collection) { try { if (string.IsNullOrWhiteSpace(collection.SimpleSpelling)) { if (Str.CheckStringChineseReg(collection.Title)) { collection.SimpleSpelling = Str.PinYin(collection.Title).ToUpper(); collection.Initials = collection.SimpleSpelling.Substring(0, 1); } else { collection.SimpleSpelling = collection.Title.ToUpper(); collection.Initials = collection.SimpleSpelling.Substring(0, 1); } } service.SaveForm(keyValue, collection); } catch (Exception) { throw; } }