Пример #1
0
        public ActionResult Edit(int id, Tug tug)
        {
            try
            {
                Tug tug1 = new Tug();
                tug1           = tugService.GetById(id);
                tug1.idCar     = tug.idCar;
                tug1.idTug     = tug.idTug;
                tug1.price     = tug.price;
                tug1.reference = tug.reference;
                tug1.startDate = tug.startDate;
                tug1.endDate   = tug.endDate;
                tug1.status    = tug.status;
                tug1.type      = tug.type;

                tugService.Update(tug1);
                tugService.Commit();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Пример #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Tug tug = db.Tugs.Find(id);

            db.Tugs.Remove(tug);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #3
0
 void Awake()
 {
     mainCharacter          = GameObject.FindWithTag("Player").GetComponent <ShootingMode>();
     fixedJoint             = GetComponent <FixedJoint2D> ();
     handleKilling          = GameObject.FindWithTag("Player").GetComponent <EnemyKilling>();
     arrowType              = GetComponent <Shoot> ();
     tugComponent           = mainCharacter.GetComponent <Tug> ();
     IgnoreOnCollisionEnter = false;
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "TugId,TugName,BollardPullName,EngineHPName,ClassTypeName")] Tug tug)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tug).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tug));
 }
Пример #5
0
        public ActionResult Create([Bind(Include = "TugId,TugName,BollardPullName,EngineHPName,ClassTypeName")] Tug tug)
        {
            if (ModelState.IsValid)
            {
                db.Tugs.Add(tug);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tug));
        }
Пример #6
0
 public ActionResult Create(Tug tug)
 {
     try
     {
         tugService.Add(tug);
         tugService.Commit();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Пример #7
0
        // GET: Tugs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tug tug = db.Tugs.Find(id);

            if (tug == null)
            {
                return(HttpNotFound());
            }
            return(View(tug));
        }
Пример #8
0
 public ActionResult Delete(int id, Tug tug)
 {
     try
     {
         Tug tug1 = new Tug();
         tug1 = tugService.GetById(id);
         tugService.Delete(tug1);
         tugService.Commit();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
    // Use this for initialization
    void Start()
    {
        chainConnectionComponent = GetComponent <ChainConnection>();
        tugComponent             = GetComponent <Tug>();
        rigidbodyComponent       = GetComponent <Rigidbody2D>();
        groundColliderComponent  = GetComponentInChildren <GroundCollider>();

        buttonLeftF  = swingForwardButton.GetComponent <MoveForward>().ButtonLeft;
        buttonRightF = swingForwardButton.GetComponent <MoveForward>().ButtonRight;
        buttonUpF    = swingForwardButton.GetComponent <MoveForward>().ButtonUp;
        buttonDownF  = swingForwardButton.GetComponent <MoveForward>().ButtonDown;

        buttonLeftB  = swingBackButton.GetComponent <MoveBack>().ButtonLeft;
        buttonRightB = swingBackButton.GetComponent <MoveBack>().ButtonRight;
        buttonUpB    = swingBackButton.GetComponent <MoveBack>().ButtonUp;
        buttonDownB  = swingBackButton.GetComponent <MoveBack>().ButtonDown;
    }
 // Use this for initialization
 void Start()
 {
     tugComponent = GetComponent <Tug> ();
 }