Exemplo n.º 1
0
        public static UnitTypeModel FromBusinessEntity(Business.Entities.UnitType businessEntity)
        {
            UnitTypeModel model = new Models.UnitTypeModel();

            model.Id          = businessEntity.ID;
            model.Code        = businessEntity.Code;
            model.Description = businessEntity.Description;

            return(model);
        }
        public ActionResult Create([Bind(Include = "ID,Name,SortOrder,Type")] Models.UnitTypeModel unitType)
        {
            if (ModelState.IsValid)
            {
                db.UnitTypes.Add(unitType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(unitType));
        }