Ejemplo n.º 1
0
        public JsonResult SetGetFromDone(string id, string trackID, int trackNo, bool isSign, DateTime signDate, string getFrom)
        {
            Guid studentID = new Guid(id);
            Guid trackId;

            if (trackID == string.Empty)
            {
                trackId = Guid.NewGuid();
            }
            else
            {
                trackId = new Guid(trackID);
            }
            SaleTrackEntity trackItem = repository.SaleTrack.SingleOrDefault(s => s.StudentID == studentID && (s.TrackItemID == trackId || s.TrackNo == trackNo));

            trackItem.IsGetFromDone = true;
            trackItem.GetFromTrack  = getFrom;
            repository.SaveSaleTrack(trackItem);

            if (isSign == true)
            {
                AppRelationsEntity appRelation = repository.AppRelation.SingleOrDefault(s => s.StudentID == studentID);
                appRelation.IsSign        = IsSign.已签约;
                appRelation.SignDate      = signDate;
                appRelation.SignTrackItem = trackId;
                repository.SaveAppRelation(appRelation);
            }

            return(Json(new { StudentID = id, SetResult = true, SignResult = isSign }));
        }
Ejemplo n.º 2
0
        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));
        }