public List <OrderGiftCard> get_by_gift_card_id(string id = "", string sortField = "", string sortOrder = "") { // Create the list to return List <OrderGiftCard> posts = OrderGiftCard.GetByGiftCardId(id, sortField, sortOrder); // Return the list return(posts); } // End of the get_by_gift_card_id method
public ActionResult orders(string id = "", string returnUrl = "") { // Get the current domain Domain currentDomain = Tools.GetCurrentDomain(); ViewBag.CurrentDomain = currentDomain; // Get query parameters ViewBag.QueryParams = new QueryParams(returnUrl); // Check if the administrator is authorized if (Administrator.IsAuthorized(new string[] { "Administrator", "Editor", "Translator" }) == true) { ViewBag.AdminSession = true; } else if (Administrator.IsAuthorized(Administrator.GetAllAdminRoles()) == true) { ViewBag.AdminSession = true; ViewBag.AdminErrorCode = 1; ViewBag.TranslatedTexts = StaticText.GetAll(currentDomain.back_end_language, "id", "ASC"); return(View("index")); } else { // Redirect the user to the start page return(RedirectToAction("index", "admin_login")); } // Get the gift card GiftCard giftCard = GiftCard.GetOneById(id); // Check if the gift card is null if (giftCard == null) { return(RedirectToAction("index")); } // Set form data ViewBag.CurrentDomain = currentDomain; ViewBag.GiftCard = giftCard; ViewBag.OrderGiftCards = OrderGiftCard.GetByGiftCardId(giftCard.id, "order_id", "ASC"); ViewBag.TranslatedTexts = StaticText.GetAll(currentDomain.back_end_language, "id", "ASC"); ViewBag.CultureInfo = Tools.GetCultureInfo(Language.GetOneById(currentDomain.back_end_language)); ViewBag.ReturnUrl = returnUrl; // Return the view return(View()); } // End of the orders method