Example #1
0
        private void GenericDataGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            var x = (TempObj as BaseEntityCode);

            if (x != null)
            {
                SelectedType = TempObj.GetType();
                SelectedRow  = DataSourceList[e.RowIndex];
                return;
            }

            var x2 = (TempObj as BaseEntityIdentity);

            if (x2 != null)
            {
                SelectedType = TempObj.GetType();
                SelectedRow  = DataSourceList[e.RowIndex];
                return;
            }
        }
Example #2
0
    void  LoadItems()
    {
        int        TempInt = PlayerPrefs.GetInt("ContainerSavedItems" + ContainerID.ToString()); //Getting the number of the saved items.
        GameObject TempObj;

        for (int i = 1; i < TempInt; i++)        //Starting a loop
        {
            if (Resources.Load(PlayerPrefs.GetString("ContainerName" + i.ToString()) + "C", typeof(GameObject)))
            {
                TempObj = Instantiate(Resources.Load(PlayerPrefs.GetString("ContainerName" + i.ToString()) + "C", typeof(GameObject)), MyTransform.position, MyTransform.rotation) as GameObject;
            }
            else
            {
                TempObj = Instantiate(DefaultItem, MyTransform.position, MyTransform.rotation) as GameObject;
            }
            Item ItemScript = TempObj.GetComponent <Item>();                                                                          //Getting the item script.
            ItemScript.ItemType         = PlayerPrefs.GetInt("ContainerItemType" + i.ToString() + ContainerID.ToString());            //Loading the item's type
            ItemScript.MinDistance      = PlayerPrefs.GetFloat("ContainerMinDistance" + i.ToString() + ContainerID.ToString());       //Loading the item's pickup minimum distance.
            ItemScript.Name             = PlayerPrefs.GetString("ContainerName" + i.ToString() + ContainerID.ToString());             //Loading the item's name.
            ItemScript.Amount           = PlayerPrefs.GetInt("ContainerAmount" + i.ToString() + ContainerID.ToString());              //Loading the item's amount.
            ItemScript.Weight           = PlayerPrefs.GetInt("ContainerWeight" + i.ToString(), 1);                                    //Loading the item's weight
            ItemScript.ShortDescription = PlayerPrefs.GetString("ContainerShortDescription" + i.ToString() + ContainerID.ToString()); //Loading the item's short description.
            ItemScript.Icon             = Resources.Load(ItemScript.Name, typeof(Sprite)) as Sprite;
            ItemScript.Currency         = PlayerPrefs.GetString("ContainerCurrency" + i.ToString() + ContainerID.ToString());         //Loading the item's currency type.
            ItemScript.CurrencyAmount   = PlayerPrefs.GetInt("ContainerCurrencyAmount" + i.ToString() + ContainerID.ToString());      //Loading the item's currency amount.
            ItemScript.EquipmentSlot    = PlayerPrefs.GetString("ContainerEquipmentSlot" + i.ToString() + ContainerID.ToString());    //Loading the item's equipment slot.
            ItemScript.SkillSlot        = PlayerPrefs.GetString("ContainerSkillSlot" + i.ToString() + ContainerID.ToString());        //Loading the item's skill bar slot.
            //Is the item stackable?
            if (PlayerPrefs.GetInt("ContainerIsStackable" + i.ToString() + ContainerID.ToString()) == 0)
            {
                ItemScript.IsStackable = false;
            }
            else
            {
                ItemScript.IsStackable = true;
            }
            ItemScript.MaxAmount = PlayerPrefs.GetInt("ContainerMaxAmount" + i.ToString() + ContainerID.ToString());             //Loading the item's maximum amount.

            //Loading the item's equipment attributes:
            if (PlayerPrefs.GetString("EqHasAttributes" + i.ToString()) == "Yes")
            {
                ItemScript.Attributes = new Item.ItemAttributes[PlayerPrefs.GetInt("EqAttributesAmount" + i.ToString())];
                int a = 0;
                for (a = 0; a < ItemScript.Attributes.Length; a++)
                {
                    ItemScript.Attributes[a] = new Item.ItemAttributes();
                }

                for (a = 0; a < ItemScript.Attributes.Length; a++)
                {
                    ItemScript.Attributes[a].Name  = PlayerPrefs.GetString("EqAttributeName" + a.ToString() + i.ToString());
                    ItemScript.Attributes[a].Value = PlayerPrefs.GetInt("EqAttributeValue" + a.ToString() + i.ToString());
                }
            }

            LoadItem(TempObj.transform, PlayerPrefs.GetInt("ContainerItemSlot" + i.ToString() + ContainerID.ToString()));
        }
    }
        public int PatientPreparation(TempObj tempObj)
        {
            foreach (var data in tempObj.theatreOperationPersonel)
            {
                data.User = (int)Session["UserId"];
                db.TheatreOperationPersonels.Add(data);
            }

            return(db.SaveChanges());
        }
 public IActionResult DownloadExcel(TempObj tempObj)
 {
     try {
         var file = service.ExportData(
             tempObj.companyCodes,
             tempObj.startDate,
             tempObj.endDate
             );
         return(Ok(file));
     } catch (Exception ex) {
         return(StatusCode(500, ex.Message));
     }
 }
Example #5
0
        private TempObj GetTempObj(GameObject source, int index)
        {
            var tempObj = tempObjs.Find(t => t.Source == source && t.Index == index);

            if (tempObj != null)
            {
                tempObj.Dirty = false;
            }
            else
            {
                tempObj = new TempObj();

                tempObj.Source = source;
                tempObj.Index  = index;
            }

            return(tempObj);
        }
Example #6
0
    void  LoadSkillBar()
    {
        int        TempInt = PlayerPrefs.GetInt("SavedSkillSlots"); //Getting the number of the saved skill bar slots.
        GameObject TempObj;

        for (int i = 1; i < TempInt; i++)        //Starting a loop in the saved skill slots.
        {
            if (Resources.Load(PlayerPrefs.GetString("SkName" + i.ToString()) + "C", typeof(GameObject)))
            {
                TempObj = Instantiate(Resources.Load(PlayerPrefs.GetString("SkName" + i.ToString()) + "C", typeof(GameObject)), MyTransform.position, MyTransform.rotation) as GameObject;
            }
            else
            {
                TempObj = Instantiate(DefaultItem, MyTransform.position, MyTransform.rotation) as GameObject;
            }
            Item ItemScript = TempObj.GetComponent <Item>();                                          //Getting the item script.
            ItemScript.ItemType         = PlayerPrefs.GetInt("SkItemType" + i.ToString());            //Loading the item's type
            ItemScript.MinDistance      = PlayerPrefs.GetFloat("SkMinDistance" + i.ToString());       //Loading the item's pickup minimum distance.
            ItemScript.Name             = PlayerPrefs.GetString("SkName" + i.ToString());             //Loading the item's name.
            ItemScript.Amount           = PlayerPrefs.GetInt("SkAmount" + i.ToString());              //Loading the item's amount.
            ItemScript.Weight           = PlayerPrefs.GetInt("SkWeight" + i.ToString(), 1);           //Loading the item's weight
            ItemScript.ShortDescription = PlayerPrefs.GetString("SkShortDescription" + i.ToString()); //Loading the item's short description.
            ItemScript.Icon             = Resources.Load(ItemScript.Name, typeof(Sprite)) as Sprite;
            ItemScript.Currency         = PlayerPrefs.GetString("SkCurrency" + i.ToString());         //Loading the item's currency type.
            ItemScript.CurrencyAmount   = PlayerPrefs.GetInt("SkCurrencyAmount" + i.ToString());      //Loading the item's currency amount.
            ItemScript.EquipmentSlot    = PlayerPrefs.GetString("SkEquipmentSlot" + i.ToString());    //Loading the item's equipment slot.
            ItemScript.SkillSlot        = PlayerPrefs.GetString("SkSkillSlot" + i.ToString());        //Loading the item's skill bar slot.

            //Loading the item's equipment attributes:
            if (PlayerPrefs.GetString("EqHasAttributes" + i.ToString()) == "Yes")
            {
                ItemScript.Attributes = new Item.ItemAttributes[PlayerPrefs.GetInt("EqAttributesAmount" + i.ToString())];
                int a = 0;
                for (a = 0; a < ItemScript.Attributes.Length; a++)
                {
                    ItemScript.Attributes[a] = new Item.ItemAttributes();
                }

                for (a = 0; a < ItemScript.Attributes.Length; a++)
                {
                    ItemScript.Attributes[a].Name  = PlayerPrefs.GetString("EqAttributeName" + a.ToString() + i.ToString());
                    ItemScript.Attributes[a].Value = PlayerPrefs.GetInt("EqAttributeValue" + a.ToString() + i.ToString());
                }
            }

            //Adding the loaded items to their skill bar slots:
            for (int t = 0; t < SkillSlot.Length; t++)                                                                    //Starting a loop in the skill bar slots.
            {
                if (SkillSlot[t].Name == ItemScript.SkillSlot && PlayerPrefs.GetInt("SkSkillSlotID" + i.ToString()) == t) //If the current loaded item matches one of the skill bar slots.
                {
                    //Set the item and set the slot to taken.
                    SkillSlot[t].Item    = TempObj.transform;
                    SkillSlot[t].IsTaken = true;

                    CustomEvents.OnSkillBarAdd(ItemScript);

                    //Changing the settings of the item and parenting it to the inventory manager again.
                    if (SkillSlot[t].Item.GetComponent <Collider>() != null)
                    {
                        SkillSlot[t].Item.transform.GetComponent <Collider>().isTrigger = true;
                    }
                    SkillSlot[t].Item.transform.GetComponent <Renderer>().enabled = false;
                    SkillSlot[t].Item.transform.parent        = gameObject.transform;
                    SkillSlot[t].Item.transform.localPosition = Vector3.zero;
                    SkillSlot[t].Item.gameObject.SetActive(false);
                }
            }
        }
    }