Commit 92ef29a1 authored by 黄奎's avatar 黄奎

新增流水号字段

parent ffe4ce65
...@@ -17,12 +17,16 @@ namespace Edu.Model.Entity.Course ...@@ -17,12 +17,16 @@ namespace Edu.Model.Entity.Course
/// </summary> /// </summary>
public int Id { get; set; } public int Id { get; set; }
/// <summary>
/// 流水号
/// </summary>
public string SerialNum { get; set; }
/// <summary> /// <summary>
/// 报价单名称 /// 报价单名称
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// 有效期开始时间 /// 有效期开始时间
/// </summary> /// </summary>
......
...@@ -85,6 +85,8 @@ namespace Edu.Module.Course ...@@ -85,6 +85,8 @@ namespace Edu.Module.Course
} }
else else
{ {
//生成报价单流水号
model.SerialNum = course_OfferRepository.CreateSerialNumRepository();
var newId = course_OfferRepository.Insert(model); var newId = course_OfferRepository.Insert(model);
model.Id = newId; model.Id = newId;
flag = newId > 0; flag = newId > 0;
......
...@@ -148,5 +148,22 @@ WHERE 1=1 ...@@ -148,5 +148,22 @@ WHERE 1=1
} }
return Get<RB_Course_Offer_ViewModel>(builder.ToString(), parameters).ToList(); return Get<RB_Course_Offer_ViewModel>(builder.ToString(), parameters).ToList();
} }
/// <summary>
/// 生成报价单流水号
/// </summary>
/// <returns></returns>
public string CreateSerialNumRepository()
{
int count = 0;
string sql = " SELECT COUNT(1) FROM RB_Course_Offer ";
var obj = base.ExecuteScalar(sql);
if (obj != null)
{
Int32.TryParse(obj.ToString(), out count);
}
string result = DateTime.Now.ToString("yyyyMMdd") + (count + 1).ToString("D4");
return result;
}
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment