Ejemplo n.º 1
0
 /// <summary>
 /// Prepare new model for creating category view
 /// </summary>
 /// <param name="parentName">Parent Name of Category in what we want to create new</param>
 /// <returns>CategoryView model prepared for enter all needed data</returns>
 public static PropertyView CreateNewPropertyModel(long link_id)
 {
     var model = new PropertyView()
     {
         LinkId = link_id
     };
     return model;
 }
Ejemplo n.º 2
0
 public ActionResult CreateProperty(PropertyView property)
 {
     if (ModelState.IsValid)
     {
         PropertyManager.AddNewProperty(property);
         return RedirectToAction("Properties", new RouteValueDictionary(
             new { link_id = property.LinkId }));
     }
     return View(property);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Add new property to DB
 /// </summary>
 /// <param name="property">Property which will be added</param>
 public static void AddNewProperty(PropertyView property)
 {
     var mapProperty = (Property)App.Mapper.Map(property, typeof(PropertyView), typeof(Property));
     App.Rep.Insert<Property>(mapProperty, true);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Edit current property
 /// </summary>
 /// <param name="property">Current property</param>
 public static void UpdateProperty(PropertyView property)
 {
     App.Rep.Update<Property>((Property)
             App.Mapper.Map(property, typeof(PropertyView), typeof(Property)), true);
 }