Exemple #1
0
 public async Task <JsonResult> MRRemove()
 {
     try {
         var id  = Guid.Parse(Request.Form["id"]);
         var oid = Guid.Parse(Request.Form["oid"]);
         var aid = Guid.Parse(Request.Form["aid"]);
         if (MessagingRoomService.Remove(id, oid, aid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedRemove("Room")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #2
0
 //receiverID, MessagingConversationID
 //receiver=userID find its signalRConnection
 //mcid=messageConversationID
 public async Task <JsonResult> NewMessageSent()
 {
     try{
         var rmid = Guid.Parse(Request.Form["rmid"]);
         var mcid = Guid.Parse(Request.Form["mcid"]);
         var rid  = Guid.Parse(Request.Form["rid"]);
         var aid  = Guid.Parse(Request.Form["aid"]);
         var sid  = SignalRDataService.GetByOIDAPI(rid, aid);
         MessagingAppHub.NewMessage(rmid.ToString(), mcid.ToString(), aid.ToString(), sid.SignalRID.ToString());
         return(Success(sid.SignalRID.ToString()));
     }
     catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #3
0
        public async Task <JsonResult> MSGetByRoom()
        {
            try {
                var rid = Guid.Parse(Request.Form["id"]);
                var aid = Guid.Parse(Request.Form["aid"]);
                var ia  = Boolean.Parse(Request.Form["ia"]);
                var id  = Boolean.Parse(Request.Form["isDesc"]);

                var data = MessagingConversationService.GetByRID(rid, ia);
                var vms  = MessagingConversationService.SetSubDatas(data);
                return(Success(MessagingConversationService.OrderByDateTime(vms, id)));
            } catch { return(Failed(MessageUtilityService.ServerError())); }
        }
 public async Task <JsonResult> QQGetQUA()
 {
     try
     {
         var qiid        = Guid.Parse(Request.Form["qiid"]);
         var qtid        = Guid.Parse(Request.Form["qtid"]);
         var aid         = Guid.Parse(Request.Form["aid"]);
         var questions   = QuizQuestionsService.GetByQIID(qiid);
         var vmQuestions = QuizQuestionsService.SetSubDatas(questions, aid);
         vmQuestions = QuizQuestionsService.SetUserAnswers(qtid, vmQuestions);
         return(Success(vmQuestions));
     }
     catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> QQARemove()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var qqid = Guid.Parse(Request.Form["qqid"]);
         var cid  = Guid.Parse(Request.Form["cid"]);
         var aid  = Guid.Parse(Request.Form["aid"]);
         if (QuizQuestionAnswerService.Remove(id, qqid, aid, cid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedRemove("Choice")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> QUARemove()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var qtid = Guid.Parse(Request.Form["qtid"]);
         var qqid = Guid.Parse(Request.Form["qqid"]);
         var qaid = Guid.Parse(Request.Form["qaid"]);
         if (QuizUserAnswerService.Remove(id, qtid, qqid, qaid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedRemove("Answer")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #7
0
 public async Task <JsonResult> UUploadBase64()
 {
     try
     {
         var company  = Request.Form["company"];
         var source   = Request.Form["image"];
         var fname    = Guid.NewGuid().ToString();
         var path     = Path.Combine(Server.MapPath("~/UPLOADS/" + company), fname.ToString() + ".png");
         var byteData = Convert.FromBase64String(source);
         System.IO.File.WriteAllBytes(path, byteData);
         return(Success("/UPLOADS/" + company + "/" + fname.ToString() + ".png"));
     }
     catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> SMUpdatePI()
 {
     try {
         var id  = Guid.Parse(Request.Form["id"]);
         var oid = Guid.Parse(Request.Form["oid"]);
         var aid = Guid.Parse(Request.Form["aid"]);
         var pi  = Guid.Parse(Request.Form["pi"]);
         if (ShopManagementService.UpdatePI(id, oid, aid, pi))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.ServerError()));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #9
0
 public async Task <JsonResult> DSUpdate()
 {
     try {
         var id  = Guid.Parse(Request.Form["id"]);
         var oid = Guid.Parse(Request.Form["oid"]);
         var aid = Guid.Parse(Request.Form["aid"]);
         var ca  = DateTime.Parse(Request.Form["ca"]);
         var ua  = DateTime.Parse(Request.Form["ua"]);
         if (DateTimeStorageService.Update(id, oid, ua))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("DateTime")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> LSUpdate()
 {
     try {
         var id    = Guid.Parse(Request.Form["id"]);
         var oid   = Guid.Parse(Request.Form["oid"]);
         var longi = float.Parse(Request.Form["longi"]);
         var lat   = float.Parse(Request.Form["lat"]);
         var desc  = Request.Form["desc"];
         if (LocationStorageService.Update(id, oid, longi, lat, desc))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Location")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> QQAUpdate()
 {
     try {
         var id    = Guid.Parse(Request.Form["id"]);
         var desc  = Request.Form["desc"];
         var point = float.Parse(Request.Form["p"]);
         var ic    = Boolean.Parse(Request.Form["ic"]);
         var qqid  = Guid.Parse(Request.Form["qqid"]);
         if (QuizQuestionAnswerService.Update(id, qqid, desc, point, ic))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Choice")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> QTUpdate()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var qiid = Guid.Parse(Request.Form["qiid"]);
         var uid  = Guid.Parse(Request.Form["uid"]);
         var tp   = int.Parse(Request.Form["tp"]);
         var dtid = Guid.Parse(Request.Form["dtid"]);
         if (QuizTakerService.Update(id, qiid, uid, tp, dtid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Takers")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #13
0
 public async Task <JsonResult> MCUpdate()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var text = Request.Form["text"];
         var rid  = Guid.Parse(Request.Form["rid"]);
         var dtid = Guid.Parse(Request.Form["dtid"]);
         var ia   = Boolean.Parse(Request.Form["ia"]);
         if (MessagingConversationService.Update(id, text, rid, dtid, ia))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Conversation")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> SRDUpdate()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var oid  = Guid.Parse(Request.Form["oid"]);
         var sid  = Guid.Parse(Request.Form["sid"]);
         var api  = Guid.Parse(Request.Form["aid"]);
         var dtid = Guid.Parse(Request.Form["dtid"]);
         if (SignalRDataService.Update(id, oid, api, sid, dtid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Signal")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> QIGetByTakers()
 {
     try {
         var uid    = Guid.Parse(Request.Form["id"]);
         var aid    = Guid.Parse(Request.Form["aid"]);
         var data   = QuizTakerService.GetByUserID(uid, aid);
         var vms    = QuizTakerService.SetSubDatas(data, aid);
         var vmList = new List <QuizInfoVM>();
         foreach (var vm in vms)
         {
             vmList.Add(vm.QuizInfo);
         }
         return(Success(vmList));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> SIUpdate()
 {
     try {
         var id     = Guid.Parse(Request.Form["id"]);
         var sinput = Request.Form["input"];
         var oid    = Guid.Parse(Request.Form["oid"]);
         var dtid   = Guid.Parse(Request.Form["dtid"]);
         var api    = Guid.Parse(Request.Form["aid"]);
         if (SearchInputService.Update(id, sinput, oid, dtid, api))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Input")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> ELUpdate()
 {
     try {
         var id    = Guid.Parse(Request.Form["id"]);
         var name  = Request.Form["name"];
         var email = Request.Form["email"];
         var dtid  = Guid.Parse(Request.Form["dtid"]);
         var cnum  = Request.Form["cnum"];
         if (EmailListService.Update(id, name, email, dtid, cnum))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Email")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #18
0
 public async Task <JsonResult> STUpdate()
 {
     try {
         var id       = Guid.Parse(Request.Form["id"]);
         var aid      = Guid.Parse(Request.Form["aid"]);
         var oid      = Guid.Parse(Request.Form["oid"]);
         var name     = Request.Form["name"];
         var desc     = Request.Form["desc"];
         var category = Guid.Parse(Request.Form["cid"]);
         if (StatusTypesReferencesService.Update(id, aid, oid, name, desc, category))
         {
             return(Success(id.ToString()));
         }
         return(Success(MessageUtilityService.FailedUpdate("")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> QUAUpdate()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var qtid = Guid.Parse(Request.Form["qtid"]);
         var qqid = Guid.Parse(Request.Form["qqid"]);
         var qaid = Guid.Parse(Request.Form["qaid"]);
         var oa   = Request.Form["oa"];
         var pe   = float.Parse(Request.Form["pe"]);
         if (QuizUserAnswerService.Update(id, qtid, qqid, qaid, oa, pe))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Answer")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #20
0
 public async Task <JsonResult> DSInsertTZ()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var oid  = Guid.Parse(Request.Form["oid"]);
         var aid  = Guid.Parse(Request.Form["aid"]);
         var tz   = Request.Form["tz"];
         var cid  = Guid.Parse(Request.Form["cid"]);
         var time = DateTimeUtil.GetTimeNowByUTC(tz);
         if (DateTimeStorageService.Insert(id, oid, aid, time, time, cid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedInsert("DateTime")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> GDUpdate()
 {
     try {
         var id    = Guid.Parse(Request.Form["id"]);
         var oid   = Guid.Parse(Request.Form["oid"]);
         var aid   = Guid.Parse(Request.Form["aid"]);
         var sid   = Guid.Parse(Request.Form["sid"]);
         var order = int.Parse(Request.Form["order"]);
         var ia    = Boolean.Parse(Request.Form["ia"]);
         if (GroupingsDataService.Update(id, oid, aid, sid, order, ia))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> QQUpdate()
 {
     try {
         var id     = Guid.Parse(Request.Form["id"]);
         var ques   = Request.Form["ques"];
         var qiid   = Guid.Parse(Request.Form["qiid"]);
         var order  = int.Parse(Request.Form["order"]);
         var points = int.Parse(Request.Form["p"]);
         var sid    = Guid.Parse(Request.Form["sid"]);
         if (QuizQuestionsService.Update(id, qiid, ques, order, points, sid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.ServerError()));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
        public async Task <JsonResult> QIEnterCode()
        {
            try {
                var code = Request.Form["qc"];
                var aid  = Guid.Parse(Request.Form["aid"]);
                var uid  = Guid.Parse(Request.Form["uid"]);

                var data = QuizInfoService.GetByQuizCode(code, aid);
                var vms  = QuizInfoService.SetSubData(data, aid);
                if (vms.QuizStatus.Name.Equals("Closed"))
                {
                    return(Failed(MessageUtilityService.ContactAdmin("Quiz")));
                }
                return(Success(vms));
            } catch { return(Failed(MessageUtilityService.ServerError())); }
        }
 public async Task <JsonResult> UALGetByUID()
 {
     try {
         var email = Request.Form["email"];
         var pass  = Request.Form["pass"];
         var uid   = Guid.Parse(Request.Form["uid"]);
         if (UsersService.HasUserAccess(email, pass, superAdmin))
         {
             var data = UserAccessLevelService.GetByUID(uid, false);
             return(Success(UserAccessLevelService.SetSubDatasAdmin(data)));
         }
         return(Failed(MessageUtilityService.ContactAdmin("Content")));
     } catch {
         return(Failed(MessageUtilityService.ServerError()));
     }
 }
Exemple #25
0
 public async Task <JsonResult> SBUpdate()
 {
     try {
         var id      = Guid.Parse(Request.Form["id"]);
         var sid     = Guid.Parse(Request.Form["sid"]);
         var aid     = Guid.Parse(Request.Form["aid"]);
         var gid     = Guid.Parse(Request.Form["gid"]);
         var address = Request.Form["add"];
         var dtid    = Guid.Parse(Request.Form["dtid"]);
         if (StoreBranchService.Update(id, sid, aid, gid, address, dtid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.ServerError()));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> UALInsert()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var uid  = Guid.Parse(Request.Form["uid"]);
         var alid = Guid.Parse(Request.Form["alid"]);
         var aid  = Guid.Parse(Request.Form["aid"]);
         var dtid = Guid.Parse(Request.Form["dtid"]);
         var ia   = Boolean.Parse(Request.Form["ia"]);
         if (UserAccessLevelService.Insert(id, uid, alid, aid, dtid, ia))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedInsert("")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> ICInsert()
 {
     try {
         var id    = Guid.Parse(Request.Form["id"]);
         var color = Request.Form["color"];
         var desc  = Request.Form["desc"];
         var oid   = Guid.Parse(Request.Form["oid"]);
         var aid   = Guid.Parse(Request.Form["aid"]);
         var cid   = Guid.Parse(Request.Form["cid"]);
         if (IS_ItemColorService.Insert(id, color, desc, oid, aid, cid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedInsert("ItemColor")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #28
0
 public async Task <JsonResult> SLUpdate()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var oid  = Guid.Parse(Request.Form["oid"]);
         var aid  = Guid.Parse(Request.Form["aid"]);
         var desc = Request.Form["desc"];
         var dtid = Guid.Parse(Request.Form["dtid"]);
         var ia   = Boolean.Parse(Request.Form["ia"]);
         if (SystemLogsService.Update(id, oid, aid, desc, dtid, ia))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Logs")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #29
0
 public async Task <JsonResult> ILSUpdate()
 {
     try {
         var id     = Guid.Parse(Request.Form["id"]);
         var oid    = Guid.Parse(Request.Form["oid"]);
         var aid    = Guid.Parse(Request.Form["aid"]);
         var source = Request.Form["source"];
         var dtid   = Guid.Parse(Request.Form["dtid"]);
         var ia     = Boolean.Parse(Request.Form["ia"]);
         if (ImageLinkStorageService.Update(id, oid, aid, source, dtid, ia))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedUpdate("Image")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> SRDInsert()
 {
     try {
         var id   = Guid.Parse(Request.Form["id"]);
         var oid  = Guid.Parse(Request.Form["oid"]);
         var sid  = Guid.Parse(Request.Form["sid"]);
         var api  = Guid.Parse(Request.Form["aid"]);
         var dtid = Guid.Parse(Request.Form["dtid"]);
         var h    = Request.Form["h"];
         if (SignalRDataService.Insert(id, oid, sid, api, dtid, h, false))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedInsert("Signal")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }