示例#1
0
 public async Task <JsonResult> DSRemove()
 {
     try {
         var id  = Guid.Parse(Request.Form["id"]);
         var aid = Guid.Parse(Request.Form["aid"]);
         var oid = Guid.Parse(Request.Form["oid"]);
         if (DateTimeStorageService.Remove(id, aid, oid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedRemove("DateTime")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
示例#2
0
 public static bool Remove(Guid id, Guid oid, Guid api)
 {
     try {
         using (var context = new CentralProcessContext()){
             var query = (from i in context.ImageLinkStorageDB where i.ID == id && i.OwnerID == oid && i.API == api select i).FirstOrDefault();
             context.ImageLinkStorageDB.Remove(query);
             context.SaveChanges();
             if (DateTimeStorageService.Remove(query.DateTimeStorageID, api, query.ID))
             {
                 return(true);
             }
             return(false);
         }
     } catch { return(false); }
 }
示例#3
0
 public static bool Remove(Guid id, Guid aid, Guid oid, Guid cid)
 {
     try {
         using (var context = new CentralProcessContext()) {
             var query = (from i in context.QuizInfoDB where i.ID == id && i.ApplicationID == aid && i.OwnerID == oid select i).FirstOrDefault();
             context.QuizInfoDB.Remove(query);
             context.SaveChanges();
             //removes quizQuestions and datetime associated with this tables
             if (QuizQuestionsService.RemoveByQIID(id, aid, cid) && DateTimeStorageService.Remove(query.DateTimeStorageID, aid, query.ID))
             {
                 return(true);
             }
             return(false);
         }
     } catch { return(false); }
 }
 public static bool Remove(Guid id, Guid qiid, Guid aid)
 {
     try {
         using (var context = new CentralProcessContext()) {
             var query = (from i in context.QuizTakersDB where i.ID == id && i.QuizInfoID == qiid select i).FirstOrDefault();
             context.QuizTakersDB.Remove(query);
             context.SaveChanges();
             //remove quizUserAnswers
             if (QuizUserAnswerService.RemoveByQTID(id) && DateTimeStorageService.Remove(query.DateTimeStorageID, aid, query.ID))
             {
                 return(true);
             }
             return(false);
         }
     } catch { return(false); }
 }
示例#5
0
 public static bool Remove(Guid id, Guid uid, Guid aid)
 {
     try {
         using (var context = new CentralProcessContext()){
             var query = (from i in context.CustomerOrderDB where i.ID == id && i.UserID == uid && i.API == aid select i).FirstOrDefault();
             context.CustomerOrderDB.Remove(query);
             context.SaveChanges();
             //remove customerOrderItem
             //remove date time
             if (DateTimeStorageService.Remove(query.DateTimeID, aid, id) && CustomerOrderItemService.RemoveByCOID(id, aid))
             {
                 return(true);
             }
             return(false);
         }
     } catch { return(false); }
 }