Selaa lähdekoodia

app2.0 我的应用 空应用报错

临城职教中职
ndbs 1 vuosi sitten
vanhempi
commit
cf3fade696
1 muutettua tiedostoa jossa 22 lisäystä ja 14 poistoa
  1. +22
    -14
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.AppMagager/MyFunction/MyFunctionService.cs

+ 22
- 14
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.AppMagager/MyFunction/MyFunctionService.cs Näytä tiedosto

@@ -13,7 +13,7 @@ namespace Learun.Application.AppMagager
/// 日 期:2018-06-26 10:32 /// 日 期:2018-06-26 10:32
/// 描 述:我的常用移动应用 /// 描 述:我的常用移动应用
/// </summary> /// </summary>
public class MyFunctionService: RepositoryFactory
public class MyFunctionService : RepositoryFactory
{ {
#region 构造函数和属性 #region 构造函数和属性


@@ -44,7 +44,7 @@ namespace Learun.Application.AppMagager
strSql.Append("SELECT "); strSql.Append("SELECT ");
strSql.Append(fieldSql); strSql.Append(fieldSql);
strSql.Append(" FROM LR_App_MyFunction t where t.F_UserId = @userId Order by t.F_Sort "); strSql.Append(" FROM LR_App_MyFunction t where t.F_UserId = @userId Order by t.F_Sort ");
return this.BaseRepository().FindList<MyFunctionEntity>(strSql.ToString(),new { userId });
return this.BaseRepository().FindList<MyFunctionEntity>(strSql.ToString(), new { userId });
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -66,22 +66,30 @@ namespace Learun.Application.AppMagager
/// <param name="keyValue">主键</param> /// <param name="keyValue">主键</param>
/// <summary> /// <summary>
/// <returns></returns> /// <returns></returns>
public void SaveEntity(string userId,string strFunctionId)
public void SaveEntity(string userId, string strFunctionId)
{ {
var db = this.BaseRepository().BeginTrans(); var db = this.BaseRepository().BeginTrans();
try try
{ {
string[] functionIds = strFunctionId.Split(',');
db.Delete<MyFunctionEntity>(t=>t.F_UserId.Equals(userId));
int num = 0;
foreach (var functionId in functionIds) {
MyFunctionEntity entity = new MyFunctionEntity();
entity.Create();
entity.F_UserId = userId;
entity.F_FunctionId = functionId;
entity.F_Sort = num;
db.Insert(entity);
num++;
if (!string.IsNullOrEmpty(strFunctionId))
{
string[] functionIds = strFunctionId.Split(',');
db.Delete<MyFunctionEntity>(t => t.F_UserId.Equals(userId));
int num = 0;
foreach (var functionId in functionIds)
{
MyFunctionEntity entity = new MyFunctionEntity();
entity.Create();
entity.F_UserId = userId;
entity.F_FunctionId = functionId;
entity.F_Sort = num;
db.Insert(entity);
num++;
}
}
else
{
db.Delete<MyFunctionEntity>(t => t.F_UserId.Equals(userId));
} }
db.Commit(); db.Commit();
} }


Ladataan…
Peruuta
Tallenna