public async Task <JsonResult> GDGetByCategory(string id, string cid, string aid)
 {
     try {
         var data = GroupingsDataService.GetByOIDCIDAID(Guid.Parse(id), Guid.Parse(cid), Guid.Parse(aid), false);
         var vms  = GroupingsDataService.SetSubDatas(data, Guid.Parse(aid), 0);
         return(Success(vms));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public static List <AdsInformation> GetByAdCategoryID(Guid acid, Guid cid)
 {
     using (var context = new CentralProcessContext()) {
         var gds  = GroupingsDataService.GetBySIDCID(acid, cid);
         var list = new List <AdsInformation>();
         foreach (var gd in gds)
         {
             list.Add(GetByID(gd.OwnerID));
         }
         return(list);
     }
 }
Beispiel #3
0
 public async Task <JsonResult> MRGetRoom()
 {
     try {
         var oid = Guid.Parse(Request.Form["oid"]);
         var aid = Guid.Parse(Request.Form["aid"]);
         var cid = Guid.Parse(Request.Form["cid"]);
         //category can be userToUser, storeToUser
         var data = GroupingsDataService.GetByOIDCIDAID(oid, cid, aid, false);
         var vms  = GroupingsDataService.SetSubDatas(data, aid, 1);
         return(Success(vms));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
 public async Task <JsonResult> GDRemove()
 {
     try {
         var id  = Guid.Parse(Request.Form["id"]);
         var oid = Guid.Parse(Request.Form["oid"]);
         var aid = Guid.Parse(Request.Form["aid"]);
         if (GroupingsDataService.Remove(id, oid, aid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.FailedRemove("")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Beispiel #5
0
        private static bool MCRInsert(Guid rid, Guid mcid, Guid cid)
        {
            //every time you send insert MC please invoke this after that item has been insert
            var members = GroupingsDataService.GetBySIDCID(rid, cid);

            foreach (var member in members)
            {
                if (!MessagingConversationReceipentService.Insert(Guid.NewGuid(), rid, mcid, false, member.OwnerID))
                {
                    return(false);
                }
            }
            return(true);
        }
 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> NMCheckUserNotification()
 {
     try {
         var uid     = Guid.Parse(Request.Form["id"]);
         var aid     = Guid.Parse(Request.Form["aid"]);
         var gdCatID = Guid.Parse(Request.Form["gdcid"]);
         var notificationsReceipent = GroupingsDataService.GetBySIDCIDAID(uid, gdCatID, aid, false);
         foreach (var notif in notificationsReceipent)
         {
             var sid = SignalRDataService.GetByOIDAPI(notif.SourceID, aid);
             NotificationManagerHub.NewNotification(notif.OwnerID.ToString(), sid.SignalRID.ToString());
             //remove the receipent from database after it sents the notification to the receiver
             GroupingsDataService.Remove(notif.ID, notif.OwnerID, notif.API);
         }
         return(Success(""));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }