Beispiel #1
0
        public void SaveAccount(Guid id, UserAccountRegister entity)
        {
            var model = _mapper.Map <ClamDataLibrary.Models.ClamUserAccountRegister>(entity);

            Context.Set <ClamDataLibrary.Models.ClamUserAccountRegister>().Update(model);
            Context.SaveChanges();
        }
Beispiel #2
0
        public void AddGenre(AreaFilmflixCategory model)
        {
            var result = _mapper.Map <ClamUserFilmCategory>(model);

            _context.ClamUserFilmCategories.Add(result);
            _context.SaveChanges();
        }
Beispiel #3
0
        public async Task <IActionResult> Create(StreamFileUploadDatabase model)
        {
            // Perform an initial check to catch FileUpload class
            // attribute violations.
            if (!ModelState.IsValid)
            {
                _uploadContent.Result = "Please correct the form.";

                return(View());
            }

            var formFileContent =
                await FileHelpers.ProcessFormFile <StreamFileUploadDatabase>(
                    model.FormFile, ModelState, _permittedExtentions,
                    _fileSizeLimit);

            // Perform a second check to catch ProcessFormFile method
            // violations. If any validation check fails, return to the
            // page.
            if (!ModelState.IsValid)
            {
                _uploadContent.Result = "Please correct the form.";

                return(View());
            }

            // **WARNING!**
            // In the following example, the file is saved without
            // scanning the file's contents. In most production
            // scenarios, an anti-virus/anti-malware scanner API
            // is used on the file before making the file available
            // for download or for use by other systems.
            // For more information, see the topic that accompanies
            // this sample.

            var file = new ClamSectionAcademicSubCategoryItem
            {
                ItemPath        = null,
                ItemTitle       = model.FormFile.FileName,
                ItemDescription = model.Note,
                Size            = model.FormFile.Length,
                SubCategoryId   = new Guid("8d7af8fa-4659-4aef-1746-08d7d7789232")
                                  //AcademicId = new Guid("a7e95d01-3a1c-474c-d5ab-08d7d76073f2")
            };

            _context.Set <ClamSectionAcademicSubCategoryItem>().Add(file);
            //_context.Entry(file).State = EntityState.Modified;
            _context.SaveChanges();
            //await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }
Beispiel #4
0
        public async Task AddTicket(AreaUserTicket model, string userName)
        {
            var user = await _userManager.FindByNameAsync(userName);

            var ticketResponse          = "Please be patient, will look into the matter as soon as possible.";
            var standardStatus          = "Pending Review";
            var standardDesignation     = "Unassigned Member";
            ClamUserSystemTicket result = new ClamUserSystemTicket()
            {
                TicketTitle      = model.TicketTitle,
                TicketMessage    = model.TicketMessage,
                TicketStatus     = standardStatus,
                TicketResponse   = ticketResponse,
                UserId           = user.Id,
                DesignatedMember = standardDesignation,
                LastModified     = DateTime.Now,
                DateCreated      = DateTime.Now
            };

            _context.Add(result);
            _context.SaveChanges();
        }
Beispiel #5
0
 public int Complete()
 {
     return(_context.SaveChanges());
 }