Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MatterType matterType = dbContext.MatterTypes.Find(id);

            dbContext.MatterTypes.Remove(matterType);
            dbContext.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Active,CreateDate,UpdateDate")] MatterType matterType)
 {
     if (ModelState.IsValid)
     {
         matterType.UpdateDate             = DateTime.Now;
         dbContext.Entry(matterType).State = EntityState.Modified;
         dbContext.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(matterType));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "Id,Name,Active,CreateDate,UpdateDate")] MatterType matterType)
        {
            if (ModelState.IsValid)
            {
                matterType.CreateDate = DateTime.Now;
                matterType.Active     = true;
                dbContext.MatterTypes.Add(matterType);
                dbContext.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(matterType));
        }
Beispiel #4
0
        // GET: Admin/MatterType/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MatterType matterType = dbContext.MatterTypes.Find(id);

            if (matterType == null)
            {
                return(HttpNotFound());
            }
            return(View(matterType));
        }
Beispiel #5
0
 public MatterChange(MatterType _type, float _amount)
 {
     type   = _type;
     amount = _amount;
 }
Beispiel #6
0
 public Matter(MatterType _type, float _amount)
 {
     type   = _type;
     amount = 0;
     AddAmount(_amount);
 }
Beispiel #7
0
 private void SetType(MatterType type)
 {
     currentType = type;
     Env.CurrentTileText.text = currentType.ToString();
 }