private static RelationshipType Map(EditViewModel editViewMode)
 {
     return new RelationshipType
                {
                    RelationshipTypeId = editViewMode.RelationshipTypesId,
                    Description = editViewMode.Description.ToUpper(),
                };
 }
 public ActionResult Create()
 {
     var editViewModel = new EditViewModel
                             {
                                 RelationshipTypesId = 0,
                                 Description = string.Empty,
                             };
     return View("Edit", editViewModel);
 }
        public ActionResult Save(EditViewModel editFormModel)
        {
            if (ModelState.IsValid)
            {
                _relationshipTypesManagement.Save(editFormModel);
                return RedirectToAction("Index");
            }

            return View("Edit", editFormModel);
        }
 public ActionResult Edit(int id)
 {
     var relationshipTypeInformation = _relationshipTypesManagement.GetRelationshipType(id);
     var editViewModel = new EditViewModel
                             {
                                 RelationshipTypesId = relationshipTypeInformation.RelationshipTypeId,
                                 Description = relationshipTypeInformation.Description,
                             };
     return View(editViewModel);
 }
        public void Save(EditViewModel editViewModel)
        {
            var relationshipType = Map(editViewModel);

            if (editViewModel.RelationshipTypesId.Equals(0))
            {
                relationshipType.CreatetedAt = DateTime.Now;
                relationshipType.UpdatedAt = DateTime.Now;
                AddRelationshipType(relationshipType);
            }
            else
            {
                relationshipType.UpdatedAt = DateTime.Now;
                EditRelationshipType(relationshipType);
            }
        }