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

新增流水号字段

parent ffe4ce65
......@@ -17,12 +17,16 @@ namespace Edu.Model.Entity.Course
/// </summary>
public int Id { get; set; }
/// <summary>
/// 流水号
/// </summary>
public string SerialNum { get; set; }
/// <summary>
/// 报价单名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 有效期开始时间
/// </summary>
......
......@@ -85,6 +85,8 @@ namespace Edu.Module.Course
}
else
{
//生成报价单流水号
model.SerialNum = course_OfferRepository.CreateSerialNumRepository();
var newId = course_OfferRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
......
......@@ -148,5 +148,22 @@ WHERE 1=1
}
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