public JsonResult SetGetFromDone(GetFromInterviewModel ajaxData) { Guid trackId; Guid studentID; if (ajaxData.trackID == string.Empty || ajaxData.trackID == null) { return(Json(false)); } trackId = new Guid(ajaxData.trackID); SaleTrackEntity trackItem = repository.SaleTrack.SingleOrDefault(s => s.TrackItemID == trackId); studentID = trackItem.StudentID; trackItem.IsGetFromDone = true; trackItem.GetFromTrack = ajaxData.getFrom; trackItem.ClientMostCare = ajaxData.clientMostCare; trackItem.SignIntention = ajaxData.isSign; repository.SaveSaleTrack(trackItem); AppRelationsEntity appRelation = repository.AppRelation.SingleOrDefault(s => s.StudentID == studentID); if (ajaxData.isSign == IsSign.已签约) { appRelation.IsSign = IsSign.已签约; appRelation.SignDate = ajaxData.signDate; appRelation.SignTrackItem = trackId; } else { appRelation.IsSign = trackItem.SignIntention; } repository.SaveAppRelation(appRelation); return(Json(true)); }
public JsonResult SetGetFromDone(GetFromInterviewModel ajaxData) { Guid trackId; Guid studentID; if (ajaxData.trackID == string.Empty || ajaxData.trackID == null) return Json(false); trackId = new Guid(ajaxData.trackID); SaleTrackEntity trackItem = repository.SaleTrack.SingleOrDefault(s => s.TrackItemID == trackId ); studentID = trackItem.StudentID; trackItem.IsGetFromDone = true; trackItem.GetFromTrack = ajaxData.getFrom; trackItem.ClientMostCare = ajaxData.clientMostCare; trackItem.SignIntention = ajaxData.isSign; repository.SaveSaleTrack(trackItem); AppRelationsEntity appRelation = repository.AppRelation.SingleOrDefault(s => s.StudentID == studentID); if (ajaxData.isSign == IsSign.已签约) { appRelation.IsSign = IsSign.已签约; appRelation.SignDate = ajaxData.signDate; appRelation.SignTrackItem = trackId; } else { appRelation.IsSign = trackItem.SignIntention; } repository.SaveAppRelation(appRelation); return Json(true); }