Commit dc4dfe2e authored by 黄奎's avatar 黄奎

页面修改

parent acd05225
......@@ -19,5 +19,26 @@ namespace Edu.Model.ViewModel.Mall
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 学员信息
/// </summary>
public List<GuestItem> GuestIdList { get; set; }
}
/// <summary>
/// 学员信息
/// </summary>
public class GuestItem
{
/// <summary>
/// 学员编号RB_Order_Guest表编号
/// </summary>
public int GuestId { get; set; }
/// <summary>
/// 学员姓名
/// </summary>
public string GuestName { get; set; }
}
}
......@@ -52,23 +52,34 @@ namespace Edu.Module.Goods
public bool SetActivitySurveyGuestModule(RB_ActivitySurvey_Guest_Extend model)
{
bool flag = false;
if (model.Id > 0)
foreach (var item in model.GuestIdList)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
var oldModel = activitySurvey_GuestRepository.GetActivitySurveyGuestListRepository(new RB_ActivitySurvey_Guest_Extend()
{
{nameof(RB_ActivitySurvey_Guest_Extend.GuestType),model.GuestType },
{nameof(RB_ActivitySurvey_Guest_Extend.GuestId),model.GuestId },
{nameof(RB_ActivitySurvey_Guest_Extend.StartTime),model.StartTime },
{nameof(RB_ActivitySurvey_Guest_Extend.EndTime),model.EndTime },
};
flag = activitySurvey_GuestRepository.Update(fileds, new WhereHelper(nameof(RB_ActivitySurvey_Guest_Extend.Id), model.Id));
}
else
{
var newId = activitySurvey_GuestRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
GuestId = item.GuestId,
SurveyId = model.SurveyId
})?.FirstOrDefault();
model.Id = oldModel?.Id ?? 0;
model.GuestId = item.GuestId;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_ActivitySurvey_Guest_Extend.GuestType),model.GuestType },
{nameof(RB_ActivitySurvey_Guest_Extend.GuestId),model.GuestId },
{nameof(RB_ActivitySurvey_Guest_Extend.StartTime),model.StartTime },
{nameof(RB_ActivitySurvey_Guest_Extend.EndTime),model.EndTime },
};
flag = activitySurvey_GuestRepository.Update(fileds, new WhereHelper(nameof(RB_ActivitySurvey_Guest_Extend.Id), model.Id));
}
else
{
var newId = activitySurvey_GuestRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
}
return flag;
}
......
......@@ -1343,6 +1343,7 @@ namespace Edu.Module.User
item.StuId,
item.StuName,
item.CreateBy,
AppointmentTime = Common.ConvertHelper.FormatTime(item.AppointmentTime),
EmployeeName = tempEmp?.AccountName,
CreateTime = Common.ConvertHelper.FormatTime(item.CreateTime),
item.Feedback,
......
......@@ -75,6 +75,10 @@ WHERE 1=1
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_ActivitySurvey_Guest_Extend.SurveyId), query.SurveyId);
}
if (query.GuestId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_ActivitySurvey_Guest_Extend.GuestId), query.GuestId);
}
}
return Get<RB_ActivitySurvey_Guest_Extend>(builder.ToString()).ToList();
}
......
......@@ -76,7 +76,17 @@ namespace Edu.WebApi.Controllers.Goods
StartTime = base.ParmJObj.GetDateTime("StartTime"),
EndTime = base.ParmJObj.GetDateTime("EndTime"),
SurveyId = base.ParmJObj.GetInt("SurveyId"),
GuestIdList=new List<GuestItem> ()
};
string GuestIdList = base.ParmJObj.GetStringValue("GuestIdList");
if (!string.IsNullOrEmpty(GuestIdList))
{
extModel.GuestIdList = JsonHelper.DeserializeObject<List<GuestItem>>(GuestIdList);
}
if ((extModel.GuestIdList == null || extModel.GuestIdList.Count == 0) && extModel.GuestId > 0)
{
extModel.GuestIdList.Add(new GuestItem() { GuestId = extModel.GuestId });
}
extModel.Status = 0;
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateDate = DateTime.Now;
......
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