Song.ServiceImpls/UserCom.cs
(开头部分) 12KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using WeiSha.Common;
using Song.Entities;
using WeiSha.Data;
using Song.ServiceInterfaces;
using System.Data.Common;
namespace Song.ServiceImpls
{
public class UserCom : IUser
{
#region 用户组部分
public void AddGroup(UserGroup entity)
{
object obj = Gateway.Default.Max<UserGroup>(UserGroup._.UGrp_Tax, UserGroup._.UGrp_Id > -1);
if (obj != DBNull.Value)
{
entity.UGrp_Tax = Convert.ToInt32(obj)+1;
}
else
{
entity.UGrp_Tax = 1;
}
Song.Entities.Organization org = Business.Do<IOrganization>().OrganCurrent();
if (org != null)
{
entity.Org_ID = org.Org_ID;
entity.Org_Name = org.Org_Name;
}
Gateway.Default.Save<UserGroup>(entity);
}
public void SaveGroup(UserGroup entity)
{
using (DbTrans tran = Gateway.Default.BeginTrans())
{
try
{
tran.Save<UserGroup>(entity);
//修改用户信息中的组名称
tran.Update<User>(new Field[] { User._.UGrp_Name }, new object[] { entity.UGrp_Name }, User._.UGrp_Id == entity.UGrp_Id);
tran.Commit();
}
catch
{
tran.Rollback();
throw;
}
finally
{
后面还有 303 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
