public ModelViewProfile Insert(ModelViewProfile model)
        {
            var objRepository = new RepositoryProfile();

            model.Status = true;
            if (objRepository.GetAll().Where(p => p.Profile.ToUpper() == model.Profile.ToUpper()) != null)
            {
                throw new Exception("Duplicate");
            }

            EntityProfile data = new EntityProfile()
            {
                ProfileID   = model.ProfileID,
                Profile     = model.Profile,
                Description = model.Description,
                Status      = model.Status
            };



            data            = new RepositoryProfile().Insert(data);
            model.ProfileID = data.ProfileID;

            new BusinessPermission().Set(model.ProfileID, null);

            return(model);
        }
        public ModelViewProfile Get(int ID)
        {
            var data = new RepositoryProfile().Get(ID);

            var result = new ModelViewProfile()
            {
                ProfileID   = data.ProfileID,
                Profile     = data.Profile,
                Description = data.Description,
                Status      = data.Status
            };

            return(result);
        }
        public ModelViewProfile Update(ModelViewProfile model)
        {
            EntityProfile data = new EntityProfile()
            {
                ProfileID   = model.ProfileID,
                Profile     = model.Profile,
                Description = model.Description,
                Status      = model.Status
            };

            data            = new RepositoryProfile().Update(data);
            model.ProfileID = data.ProfileID;

            return(model);
        }