Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CurrentOwner currentOwner = db.CurrentOwners.Find(id);

            db.CurrentOwners.Remove(currentOwner);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        // setting value to owner

        public void SetValueToOwner()
        {
            if (IsValueColor32)
            {
                CurrentOwner.SetUserValue((Color32)EditedColor);
            }
            else
            {
                CurrentOwner.SetUserValue(EditedColor);
            }
        }
Пример #3
0
 private void SetValueFromDropdown()
 {
     try
     {
         CurrentOwner.SetUserValue(ValueAtIdx(enumDropdown.value).ActualValue);
     }
     catch (Exception ex)
     {
         ExplorerCore.LogWarning("Exception setting from dropdown: " + ex);
     }
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "CurrentId,PetId,OwnerId")] CurrentOwner currentOwner)
 {
     if (ModelState.IsValid)
     {
         db.Entry(currentOwner).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.OwnerId = new SelectList(db.Owners, "OwnerId", "Name", currentOwner.OwnerId);
     ViewBag.PetId   = new SelectList(db.Pets, "PetId", "PetName", currentOwner.PetId);
     return(View(currentOwner));
 }
Пример #5
0
        public ActionResult Create([Bind(Include = "CurrentId,PetId,OwnerId")] CurrentOwner currentOwner)
        {
            if (ModelState.IsValid)
            {
                db.CurrentOwners.Add(currentOwner);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.OwnerId = new SelectList(db.Owners, "OwnerId", "Name", currentOwner.OwnerId);
            ViewBag.PetId   = new SelectList(db.Pets, "PetId", "PetName", currentOwner.PetId);
            return(View(currentOwner));
        }
Пример #6
0
        // GET: CurrentOwners/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CurrentOwner currentOwner = db.CurrentOwners.Find(id);

            if (currentOwner == null)
            {
                return(HttpNotFound());
            }
            return(View(currentOwner));
        }
        public override Grasshopper.GUI.Canvas.GH_ObjectResponse RespondToMouseDoubleClick(Grasshopper.GUI.Canvas.GH_Canvas sender, Grasshopper.GUI.GH_CanvasMouseEvent e)
        {
            if ((ContentBox.Contains(e.CanvasLocation)))
            {
                CurrentOwner.SOLVE = true;

                // hit the export straight away, where we handle the folder selection!
                CurrentOwner.Export();
                CurrentOwner.ExpireSolution(true);

                return(Grasshopper.GUI.Canvas.GH_ObjectResponse.Handled);
            }

            return(Grasshopper.GUI.Canvas.GH_ObjectResponse.Ignore);
        }
Пример #8
0
        private void OnApplyClicked()
        {
            try
            {
                for (int i = 0; i < CurrentInfo.Fields.Length; i++)
                {
                    CurrentInfo.SetValue(RefInstance, inputFields[i].Text, i);
                }

                CurrentOwner.SetUserValue(RefInstance);
            }
            catch (Exception ex)
            {
                ExplorerCore.LogWarning("Exception setting value: " + ex);
            }
        }
Пример #9
0
        // GET: CurrentOwners/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CurrentOwner currentOwner = db.CurrentOwners.Find(id);

            if (currentOwner == null)
            {
                return(HttpNotFound());
            }
            ViewBag.OwnerId = new SelectList(db.Owners, "OwnerId", "Name", currentOwner.OwnerId);
            ViewBag.PetId   = new SelectList(db.Pets, "PetId", "PetName", currentOwner.PetId);
            return(View(currentOwner));
        }
Пример #10
0
    public void ElementEffectSpawnOnEquip()
    {
        ElementItem EquippedElement = CurrentOwner.GetEquippedElement();

        if (!EquippedElement)
        {
            return;
        }

        ElementEffectDestroyInstance();

        ElementEffectInstance = Instantiate(EquippedElement.GetParticleEffectPrefab(), ElementEffectSpawnPoint.transform);

        if (EquippedElement.GetSpecialSkill())
        {
            EquipSpecialSkill(EquippedElement.GetSpecialSkill());
        }
    }
Пример #11
0
        private void SetValueFromFlags()
        {
            try
            {
                List <string> values = new List <string>();
                for (int i = 0; i < CurrentValues.Count; i++)
                {
                    if (flagToggles[i].isOn)
                    {
                        values.Add(ValueAtIdx(i).Name);
                    }
                }

                CurrentOwner.SetUserValue(Enum.Parse(EnumType, string.Join(", ", values.ToArray())));
            }
            catch (Exception ex)
            {
                ExplorerCore.LogWarning("Exception setting from flag toggles: " + ex);
            }
        }
Пример #12
0
        public string[] ListOwnershipInformation()
        {
            List <string> VehicleHistory = new List <string>();

            VehicleHistory.Add(this.ToString());
            if (CurrentOwner != null)
            {
                VehicleHistory.Add("       Owned By: " + CurrentOwner.ToString() +
                                   ", Since: " + this.getTheLastSale().DateOfPurchase + ", License Number: " + this.getTheLastSale().LicenseNumber +
                                   ", Price: $" + this.getTheLastSale().Price);
            }
            if (SalesInformation.Count > 1)
            {
                VehicleHistory.Add("   History: ");
            }
            foreach (Sale s in SalesInformation)
            {
                if (s.DateOfSale != null)
                {
                    VehicleHistory.Add("        " + s.ToString());
                }
            }
            return(VehicleHistory.ToArray());
        }
Пример #13
0
 private void OnApplyClicked()
 {
     CurrentOwner.SetUserValue(EditedValue);
 }