/// <summary> /// 餐饮系统注册 /// </summary> /// <param name="Param"></param> /// <returns></returns> public string RegistRepastAccount(RequestMerchant Param) { Param.AuditType = AuditEnum.WaitAduit; RepastRoleAuthor Author = Kily.Set <RepastRoleAuthor>().Where(t => t.IsDelete == false).Where(t => t.AuthorName.Contains("基本")).OrderBy(t => t.CreateTime).FirstOrDefault(); Param.DingRoleId = Author.Id; RepastInfo Info = Param.MapToEntity <RepastInfo>(); var IsReplay = Kily.Set <RepastInfo>().Where(t => t.Account == Param.Account).FirstOrDefault(); if (IsReplay != null) { return("账号已经被注册"); } var IsReplays = Kily.Set <RepastInfo>().Where(t => t.MerchantName == Param.MerchantName).FirstOrDefault(); if (IsReplays != null) { return("企业已经注册,请勿重复注册"); } if (!NormalUtil.CheckStringChineseUn(Info.Account)) { if (Insert <RepastInfo>(Info)) { return(ServiceMessage.INSERTSUCCESS); } else { return(ServiceMessage.INSERTFAIL); } } else { return("账号不能包含中文和特殊字符"); } }
/// <summary> ///编辑角色 /// </summary> /// <param name="Param"></param> /// <returns></returns> public string EditRole(RequestRepastRoleAuthor Param) { RepastRoleAuthor Author = Param.MapToEntity <RepastRoleAuthor>(); if (Param.Id == Guid.Empty) { if (Kily.Set <RepastRoleAuthor>().Where(t => t.IsDelete == false).Where(t => t.AuthorName.Equals(Author.AuthorName)).AsNoTracking().FirstOrDefault() != null) { return("角色名称重复请重新添加!"); } return(Insert <RepastRoleAuthor>(Author) ? ServiceMessage.INSERTSUCCESS : ServiceMessage.INSERTFAIL); } else { return(Update(Author, Param) ? ServiceMessage.UPDATESUCCESS : ServiceMessage.UPDATEFAIL); } }