Exemplo n.º 1
0
 public async Task <JsonResult> QTGetByUIDQuizInfoID(string id, string qiid)
 {
     try {
         var data = QuizTakersService.GetByUIDQuizInfoID(Guid.Parse(id), Guid.Parse(qiid));
         return(Success(QuizTakersVM.MsToVMs(data)));
     } catch { return(Failed(MessageUtility.ServerError())); }
 }
        public static QuizTakersVM SetSubData(QuizTakers data, Guid aid)
        {
            var model = QuizTakersVM.MToVM(data);

            model.QuizInfo = QuizInfoService.SetSubData(QuizInfoService.GetByID(data.QuizInfoID, data.UserID, aid), aid);
            model.DateTime = DateTimeStorageVM.MToVM(DateTimeStorageService.GetByID(data.DateTimeStorageID));
            return(model);
        }
 public static bool Insert(Guid id, Guid qiid, Guid uid, float tp, Guid dtid, Guid aid)
 {
     try {
         var data = QuizTakersVM.set(id, qiid, uid, tp, dtid, aid);
         using (var context = new CentralProcessContext()) {
             context.QuizTakersDB.Add(data);
             context.SaveChanges();
             return(true);
         }
     } catch { return(false); }
 }
Exemplo n.º 4
0
 public static bool Insert(Guid id, Guid qiid, Guid uid, DateTime ca, int tp)
 {
     try {
         using (var context = new GeopersonContext()) {
             var data = QuizTakersVM.set(id, qiid, uid, ca, tp);
             context.QuizTakersDB.Add(data);
             context.SaveChanges();
             return(true);
         }
     } catch { return(false); }
 }