コード例 #1
0
        private void OpenNewDesignation()
        {
            AddDesignationViewModel addDesignationViewModel = new AddDesignationViewModel();
            AddDesignationView      addDesignationView      = new AddDesignationView();

            addDesignationView.DataContext = addDesignationViewModel;
            addDesignationView.Show();
        }
コード例 #2
0
        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;
            }
        }