Commit c9140752 authored by 黄奎's avatar 黄奎

页面修改

parent 523d014f
......@@ -344,5 +344,41 @@ namespace Edu.Common
builder.AppendFormat(@"<span style='text-decoration: underline;'>{1}{0}{1}</span>", value, (isAddNbsp ? "&nbsp;&nbsp;" : ""));
return builder.ToString();
}
/// <summary>
/// 根据出生日期计算年龄
/// </summary>
/// <param name="birthdate"></param>
/// <returns></returns>
public static int GetAgeByBirthdate(object birthdate)
{
int age = 0;
DateTime now = DateTime.Now;
if (birthdate != null)
{
try
{
var timeStr = Convert.ToDateTime(birthdate.ToString()).ToString("yyyy-MM-dd");
if (timeStr == "0001-01-01")
{
timeStr = "";
}
if (!string.IsNullOrEmpty(timeStr))
{
var newBirth = Convert.ToDateTime(timeStr);
age = now.Year - newBirth.Year;
if (now.Month < newBirth.Month || (now.Month == newBirth.Month && now.Day < newBirth.Day))
{
age--;
}
}
}
catch
{
}
}
return age < 0 ? 0 : age;
}
}
}
\ No newline at end of file
......@@ -67,6 +67,7 @@ namespace Edu.Model.Entity.Course
/// 学习分钟数(单位:分钟)
/// </summary>
public int StudyNum { get; set; }
/// <summary>
/// 创建人
/// </summary>
......@@ -77,6 +78,9 @@ namespace Edu.Model.Entity.Course
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 补课状态(1-正常,2-已处理,3-未处理)
/// </summary>
public int MakeUpStatus { get; set; }
}
}
......@@ -170,5 +170,25 @@ namespace Edu.Model.Entity.Course
/// 留学就业备注
/// </summary>
public string StudyRemark { get; set; }
/// <summary>
/// 出生日期
/// </summary>
public DateTime BirthDate { get; set; }
/// <summary>
/// 总课时
/// </summary>
public int TotalHours { get; set; }
/// <summary>
/// 完成课时
/// </summary>
public int CompleteHours { get; set; }
/// <summary>
/// 补课课时
/// </summary>
public int MakeUpHours { get; set; }
}
}
......@@ -92,7 +92,7 @@ namespace Edu.Module.Course
obj = new
{
StudentName=guestModel?.GuestName??"",
StuBirth="",
StuBirth=Common.ConvertHelper.FormatDate(guestModel?.BirthDate),
StuSex=(guestModel?.Sex??0)==1?0:1,
StuAddress=guestModel?.ContactAddress??"",
StuTel= guestModel?.Mobile??"",
......
......@@ -1372,6 +1372,10 @@ namespace Edu.Module.Course
public virtual bool SetOrderGuestInfo(RB_Order_Guest_ViewModel dmodel,out string message)
{
bool flag = false;
if (dmodel.BirthDate != null)
{
dmodel.Age = Common.ConvertHelper.GetAgeByBirthdate(dmodel.BirthDate);
}
message = "";
if (dmodel.Id > 0)
{
......@@ -1491,6 +1495,17 @@ namespace Edu.Module.Course
}
gModel.StudyRemark = dmodel.StudyRemark;
if (gModel.BirthDate != dmodel.BirthDate)
{
LogContent += ",出身日期由【" + gModel.BirthDate + "】修改为【" + dmodel.BirthDate + "】";
}
gModel.BirthDate = dmodel.BirthDate;
if (gModel.TotalHours != dmodel.TotalHours)
{
LogContent += ",总课时由【" + gModel.TotalHours + "】修改为【" + dmodel.TotalHours + "】";
}
gModel.TotalHours = dmodel.TotalHours;
gModel.UpdateTime = dmodel.UpdateTime;
flag = order_GuestRepository.Update(gModel);
if (flag)
......@@ -1566,7 +1581,7 @@ namespace Edu.Module.Course
ProviceId = 0,
School_Id = classmodel.School_Id,
Status = DateStateEnum.Normal,
StuBirth = null,
StuBirth = dmodel.BirthDate,
StuIcon = "",
StuName = dmodel.GuestName,
StuSex = dmodel.Sex - 1,
......
......@@ -195,6 +195,31 @@ namespace Edu.WebApi.Controllers.Course
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 复制合同
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetEducationContractCopy()
{
var userInfo = base.UserInfo;
int ContractId = base.ParmJObj.GetInt("ContractId", 0);//合同id
if (ContractId <= 0)
{
return ApiResult.ParamIsNull("请传递合同id");
}
var model= educationContractModule.GetEducationContractModule(ContractId);
model.Id = 0;
model.Group_Id = userInfo.Group_Id;
model.CreateBy = userInfo.Id;
model.CreateTime = DateTime.Now;
model.UpdateBy = userInfo.Id;
model.UpdateTime = DateTime.Now;
model.Status = 0;
bool flag = educationContractModule.SetEducationContractModule(model);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 合同签字
/// </summary>
......
......@@ -861,6 +861,8 @@ namespace Edu.WebApi.Controllers.Course
x.Sex,
SexStr= x.Sex==1?"男":"女",
x.Age,
BirthDate= Common.ConvertHelper.FormatDate(x.BirthDate),
x.TotalHours,
x.Mobile,
x.Basics,
x.Education,
......@@ -917,6 +919,8 @@ namespace Edu.WebApi.Controllers.Course
VolunteerMajor=base.ParmJObj.GetStringValue("VolunteerMajor"),
Price=base.ParmJObj.GetDecimal("Price"),
StudyRemark=base.ParmJObj.GetStringValue("StudyRemark"),
BirthDate=base.ParmJObj.GetDateTime("BirthDate"),
TotalHours=base.ParmJObj.GetInt("TotalHours")
};
if (dmodel.OrderId <= 0)
{
......
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