public async Task <ActionResult> Create([Bind(Include = "Id,Title,Description")] PropertyViewModel model)
        {
            if (ModelState.IsValid)
            {
                await _propertyManager.Add(model, User.Identity.Name);

                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
Пример #2
0
        public virtual object Execute(CommandContext commandContext)
        {
            IPropertyManager propertyManager = commandContext.PropertyManager;

            PropertyEntity property = propertyManager.FindPropertyById(Name);

            if (property != null)
            {
                // update
                property.Value = Value;
            }
            else
            {
                // create
                property = new PropertyEntity(Name, Value);
                propertyManager.Add(property);
            }

            return(null);
        }
Пример #3
0
 public void AddProperty(string Name, string Description, string Type, string Prefix, string Sufix, int Category_Id, string DefaultValue)
 {
     propertyManager.Add(Name, Description, Type, Prefix, Sufix, Category_Id, DefaultValue);
     Response.Redirect("EditCategories");
 }