public IActionResult ToggleJawn(int jawnId, string status) { User current = GetUser(); if (current == null) { return(Redirect("/")); } if (status == "join") { GetTogether newParty = new GetTogether(); newParty.UserId = current.UserId; newParty.JawnId = jawnId; _context.GetTogethers.Add(newParty); } else if (status == "leave") { GetTogether flake = _context.GetTogethers .FirstOrDefault(g => g.UserId == current.UserId && g.JawnId == jawnId); _context.GetTogethers.Remove(flake); } _context.SaveChanges(); return(RedirectToAction("Home")); }
public static Wsdl GetWsdl(GetTogether.Studio.WebService.ProjectParameter parameter, bool isRefresh) { Wsdl wsdl = GetTogether.Web.CacheHelper.GetCache(parameter.ProjectName) as Wsdl; if (wsdl == null || isRefresh) { wsdl = new Wsdl(parameter.Address, parameter.AddressType); wsdl.Generate(); if (parameter.Timeout > 0) { wsdl.SetTimeout(parameter.Timeout); } GetTogether.Web.CacheHelper.SetCache(parameter.ProjectName, wsdl); } return wsdl; }
public static Language GetResoureces(GetTogether.Utility.MutiLanguage.Languages lang, string filePath, string cacheKey) { return GetResoureces(GetTogether.Utility.MutiLanguage.EnumToString(lang), filePath, cacheKey); }
public static string SendWebRequest(GetTogether.Studio.WebService.ProjectParameter parameter, System.Reflection.MethodInfo methodInfo, string requestXml) { System.Type declaringType = methodInfo.DeclaringType; string action = ""; System.Web.Services.Protocols.SoapDocumentMethodAttribute[] customAttributes = (System.Web.Services.Protocols.SoapDocumentMethodAttribute[])methodInfo.GetCustomAttributes( typeof(System.Web.Services.Protocols.SoapDocumentMethodAttribute), true); for (int i = 0; i < customAttributes.Length; i++) { System.Web.Services.Protocols.SoapDocumentMethodAttribute attribute = customAttributes[i]; action = attribute.Action; } string url = parameter.Address; string contentType = "text/xml; charset=utf-8"; string method = "post"; int timeout = parameter.Timeout; return SendWebRequest(url, action, requestXml, method, contentType, timeout); }