public static ItemMasterList GetItemDetails(int itemMasterID)
        {
            ItemMasterList returnObj = new ItemMasterList();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = -1001;
                    returnObj.ErrorMessage = "";
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetItemMasterList(currentUser.CompanyID, currentUser.UserId, itemMasterID, out returnObj))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = -1;
                    returnObj.ErrorMessage = "Failed to get Item Details. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
Example #2
0
        public static ItemMasterList GetItemList(string InvoiceID)
        {
            ItemMasterList returnObj = new ItemMasterList();
            LoginUser      currentUser;

            try
            {
                if (!GetUserSession(out currentUser))
                {
                    returnObj.ErrorCode    = 1001;
                    returnObj.ErrorMessage = "";
                    return(returnObj);
                }

                AdminManagerSP customerObj = new AdminManagerSP();
                if (customerObj.GetItemMasterList(currentUser.CompanyID, currentUser.UserId, 0, out returnObj, string.IsNullOrEmpty(InvoiceID) ? 0 : Convert.ToInt32(InvoiceID)))
                {
                    returnObj.ErrorCode    = 0;
                    returnObj.ErrorMessage = "";
                }
                else
                {
                    returnObj.ErrorCode    = -1;
                    returnObj.ErrorMessage = "Failed to get Item Details. please try again later";
                }
            }
            catch (Exception ex)
            {
                Utils.Write(ex);
            }

            return(returnObj);
        }
Example #3
0
    private void GetData(int x)
    {
        item = AccessJson("MasterItemSheet");
        foreach (int index in Enumerable.Range(0, item.Count))
        {
            count += 1;
            if ((int)item[index]["ID"] == x)
            {
                ItemMasterList itemMaster = new ItemMasterList(
                    (int)item[index]["ID"], (string)item[index]["Name"], (string)item[index]["Description"],
                    (string)item[index]["Flavor Text"], (string)item[index]["Name Hidden"],
                    (string)item[index]["Type"]);
                //Debug.Log((string)item[index]["Name"]);
                itemName = (string)item[index]["Name"];
                // prep to send to item cache
                //packagedData["ID"] = Convert.ToString(itemMaster.Id);
                //packagedData["Name"] = itemMaster.ItemName;
                //packagedData["Description"] = itemMaster.Descr;
                //packagedData["Flavor Text"] = itemMaster.FlvText;
                //packagedData["Name Hidden"] = itemMaster.NameHidden;

                // TODO should really use the TextBoxManager here instead of
                // being redundent which means I have to generalize the TBM.
                if (itemMaster.NameHidden == "TRUE")
                {
                    masterDescr = "???" + "\n" +
                                  itemMaster.Descr + "\n" + itemMaster.FlvText + "\n";
                }
                else
                {
                    masterDescr = itemMaster.ItemName + "\n" +
                                  itemMaster.Descr + "\n" + itemMaster.FlvText + "\n";
                }
                type = itemMaster.Type;
                break;
            }
        }

        if (type == "Quest")
        {
            foreach (int index in Enumerable.Range(0, item.Count))
            {
                item = AccessJson("QuestItems");
                if ((int)item[index]["ID"] == x)
                {
                    QuestItem questItem = new QuestItem((int)item[index]["ID"], (string)item[index]["Key"]);

                    //packagedData["Key"] = questItem.Key;
                    break;
                }
            }
        }
    }