Exemplo n.º 1
0
        public IHttpActionResult CreatePrivilegeModule(PrivilegeModulesModel model)
        {
            var response = new DataResponse <EntityPrivilegeModules>();

            if (ModelState.IsValid)
            {
                var entityPrivilegeModules = new EntityPrivilegeModules();
                entityPrivilegeModules.Title       = model.Title;
                entityPrivilegeModules.Description = model.Description;
                entityPrivilegeModules.CreatedBy   = CurrentUserId;
                entityPrivilegeModules.IsActive    = true;
                response = repository.Insert(entityPrivilegeModules);
            }
            return(Ok <DataResponse>(response));
        }
Exemplo n.º 2
0
        public IHttpActionResult UpdatePrivilegeModule(PrivilegeModulesModel model)
        {
            var response = new DataResponse <EntityPrivilegeModules>();

            if (ModelState.IsValid)
            {
                var entityPrivilegeModules = new EntityPrivilegeModules();
                entityPrivilegeModules.Id          = model.Id;
                entityPrivilegeModules.Title       = model.Title;
                entityPrivilegeModules.IsActive    = model.IsActive;
                entityPrivilegeModules.Description = model.Description;
                entityPrivilegeModules.UpdatedBy   = CurrentUserId;
                entityPrivilegeModules.UpdatedOn   = System.DateTime.UtcNow;
                response = repository.UpdatePrivilegeModuleById(entityPrivilegeModules);
            }
            return(Ok <DataResponse>(response));
        }