private void OpenNewDesignation() { AddDesignationViewModel addDesignationViewModel = new AddDesignationViewModel(); AddDesignationView addDesignationView = new AddDesignationView(); addDesignationView.DataContext = addDesignationViewModel; addDesignationView.Show(); }
public void AddDesignation(AddDesignationViewModel model) { try { if (model != null) { MasterDesignation entity = new MasterDesignation(); entity.DesignationName = model.DesignationName; entity.DepartmentRowID = model.DepartmentRowID; db.MasterDesignations.Add(entity); } else { throw new Exception("Designation could not be blank!"); } } catch (Exception) { throw; } }