Exemplo n.º 1
0
 void Start()
 {
     tops = GameObject.Find("Top").GetComponent<Tops>();
     mat = gameObject.GetComponent<Renderer>().material;
     name = gameObject.name;
     initial = mat.color;
     final = new Color(1, 1, 1, 0.8f);
 }
Exemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Tops tops = db.Tops.Find(id);

            db.Tops.Remove(tops);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "TopsID,Nickname,PhotoURL,Type,Color,Season,Occasion")] Tops tops)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tops).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tops));
 }
Exemplo n.º 4
0
 public ActionResult Edit([Bind(Include = "TopID,TopName,TopType,TopColor,TopSeason,TopOccasion,TopPhoto")] Tops tops)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tops).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tops));
 }
Exemplo n.º 5
0
 public ActionResult Edit([Bind(Include = "TopID,TopNameDescription,PhotoLink,ColorPrimary,ColorSecondary,ColorTertiary,Season,Occasion")] Tops tops)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tops).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tops));
 }
Exemplo n.º 6
0
        public ActionResult Create([Bind(Include = "TopsID,Nickname,PhotoURL,Type,Color,Season,Occasion")] Tops tops)
        {
            if (ModelState.IsValid)
            {
                db.Tops.Add(tops);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tops));
        }
Exemplo n.º 7
0
        public ActionResult Create([Bind(Include = "TopID,TopName,TopType,TopColor,TopSeason,TopOccasion,TopPhoto")] Tops tops)
        {
            if (ModelState.IsValid)
            {
                db.Tops.Add(tops);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tops));
        }
Exemplo n.º 8
0
        public ActionResult Create([Bind(Include = "TopID,TopNameDescription,PhotoLink,ColorPrimary,ColorSecondary,ColorTertiary,Season,Occasion")] Tops tops)
        {
            if (ModelState.IsValid)
            {
                db.Tops.Add(tops);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tops));
        }
Exemplo n.º 9
0
        // GET: Tops/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tops tops = db.Tops.Find(id);

            if (tops == null)
            {
                return(HttpNotFound());
            }
            return(View(tops));
        }
Exemplo n.º 10
0
 public static void ChangeProperty(Tops topsItem)
 {
     while (true)
     {
         try
         {
             topsItem.Brand      = Misc.GetParameter("Brand");
             topsItem.WaterProof = Boolean.Parse(Misc.GetParameter("WaterProof"));
             topsItem.Size       = Int32.Parse(Misc.GetParameter("Size"));
             topsItem.Price      = Int32.Parse(Misc.GetParameter("Price"));
             topsItem.Color      = Misc.GetParameter("Color");
             break;
         }
         catch (Exception)
         {
             Misc.ConsoleLog(ConsoleColor.Yellow, "Incorrect input, try again");
         }
     }
 }
Exemplo n.º 11
0
        public List <Tops> showTops()
        {
            List <Tops> topsList = new List <Tops>();

            Connection();
            SqlDataReader reader;
            //Creating an instance of SqlCommand
            SqlCommand cmd;

            //Intialising SqlCommand
            cmd             = new SqlCommand("uspShowAllTops", conn);
            cmd.CommandType = CommandType.StoredProcedure;
            try
            {
                conn.Open();
                reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    Tops top = new Tops();
                    top.ProductId           = reader["TopID"].ToString();
                    top.ProductName         = reader["TopName"].ToString();
                    top.ProductDescription  = reader["TopDescription"].ToString();
                    top.ProductPricePerUnit = decimal.Parse(reader["TopPricePerUnit"].ToString());
                    top.ProductQuantity     = int.Parse(reader["TopQuantity"].ToString());
                    top.ProductSize         = reader["TopSize"].ToString();
                    top.ProductColour       = reader["ToprColour"].ToString();
                    top.TopImage            = (byte[])reader["TopImage"];
                    topsList.Add(top);
                }
            }
            catch (Exception ex)
            {
                message = ex.Message;
            }
            finally
            {
                conn.Close();
            }

            return(topsList);
        }
Exemplo n.º 12
0
    public void OnSow(SowPlant2Type Sow)
    {
        if (Sow.Cultivar == "")
        {
            throw new Exception("Cultivar not specified on sow line.");
        }

        SowingData = Sow;

        // Go through all our children and find all organs.
        Organ1s.Clear();
        foreach (object ChildObject in My.ChildrenAsObjects)
        {
            Organ1 Child1 = ChildObject as Organ1;
            if (Child1 != null)
            {
                Organ1s.Add(Child1);
                if (Child1 is AboveGround)
                {
                    Tops.Add(Child1);
                }
            }
        }

        if (NewCrop != null)
        {
            NewCropType Crop = new NewCropType();
            Crop.crop_type = CropType;
            Crop.sender    = Name;
            NewCrop.Invoke(Crop);
        }

        if (Sowing != null)
        {
            Sowing.Invoke();
        }

        WriteSowReport(Sow);
    }
Exemplo n.º 13
0
 public static void ShowItem(Tops topsItem)
 {
     Misc.ConsoleLog(ConsoleColor.Cyan, $"Brand: {topsItem.Brand}\nWaterProof: {topsItem.WaterProof}\nSize: {topsItem.Size}\nPrice: {topsItem.Price}\nColor: {topsItem.Color}\nid: {topsItem.Id}\n");
 }
Exemplo n.º 14
0
 public void Reverse()
 {
     Tops.Reverse();
     TopsForMove.Reverse();
 }