Browse Source

-

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
ba34eb58ac
  1. 39
      Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs

39
Src/Asp.Net/SqlServerTest/BugTest/Bug2.cs

@ -21,6 +21,11 @@ namespace OrmTest.BugTest
DbType = DbType.SqlServer,
IsAutoCloseConnection = true
});
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql + "\r\n" + db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value)));
Console.WriteLine();
};
return db;
}
}
@ -108,7 +113,7 @@ namespace OrmTest.BugTest
Guid newCarTypePictureId = Guid.Empty;
Guid carTypePictureId = Guid.Empty;
DB.CodeFirst.InitTables(typeof(Picture));
DB.CodeFirst.InitTables(typeof(Picture),typeof(JobPlan));
DB.Updateable<Picture>()
.UpdateColumns(p => p.Value == SqlFunc.Subqueryable<Picture>()
.Where(pp => pp.ID == newCarTypePictureId)
@ -120,7 +125,39 @@ namespace OrmTest.BugTest
.Select(pp => pp.Value))
.Where(p => p.ID == carTypePictureId).ExecuteCommand();
var list = new List<JobPlan>()
{
new JobPlan() { },
new JobPlan() { }
};
DB.Updateable(new JobPlan() { })
.WhereColumns(s => new { s.CmdNo })
.UpdateColumns(s => new
{
s.HeatNo,
s.CmdNo
}).ExecuteCommand();
}
}
/// <summary>
/// 表示作业计划表,保存用户确认的作业计划。
/// </summary>
[SugarTable("PL_JOB_PLAN")]
public class JobPlan
{
public long Id { get; set; }
/// <summary>
/// 获取或设置炉次号。
/// </summary>
public string HeatNo { get; set; }
/// <summary>
/// 获取或设置制造命令号。
/// </summary>
[SugarColumn(ColumnName = "PONO")]
public string CmdNo { get; set; }
}
public partial class Picture
{

Loading…
Cancel
Save