public async Task <bool> AddRegisterGroup(tblRegistedGroup model)
 {
     model.CreatedDate = DateTime.UtcNow;
     model.IsDeleted   = false;
     model.IsActivate  = false;
     _context.tblRegistedGroups.Add(model);
     return(await _context.SaveChangesAsync() > 0);
 }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> UpdateRegisterGroup(tblRegistedGroup model)
        {
            var user = await GetUserId(Authentication.User.Identity.Name);

            if (model != null && user != null && model.RGroupId > 0)
            {
                model.UpdatedBy = user.UserId;
                return(Ok(await registerGroupRepo.UpdateRegisterGroup(model)));
            }
            return(Ok(false));
        }
Ejemplo n.º 3
0
        public async Task <IHttpActionResult> AddRegisterGroup(tblRegistedGroup model)
        {
            try
            {
                var user = await GetUserId(Authentication.User.Identity.Name);

                if (model != null && user != null)
                {
                    model.CreatedBy = user.UserId;
                    return(Ok(await registerGroupRepo.AddRegisterGroup(model)));
                }
                return(Ok(false));
            }
            catch (Exception ex)
            {
                return(Ok(ex.ToString()));
            }
        }
        public async Task <bool> UpdateRegisterGroup(tblRegistedGroup model)
        {
            var data = await _context.tblRegistedGroups.FindAsync(model.RGroupId);


            data.RGType         = model.RGType;
            data.RGName         = model.RGName;
            data.StartFrom      = model.StartFrom;
            data.EndFrom        = model.EndFrom;
            data.RGDesc         = model.RGDesc;
            data.RGImagePath    = model.RGImagePath;
            data.IsAutoRegister = model.IsAutoRegister;
            data.RGLink         = model.RGLink;
            data.IsRanking      = 1;//default set
            data.City           = model.City;
            data.Country        = model.Country;
            data.UpdatedBy      = model.UpdatedBy;
            data.IsDeleted      = false;
            data.GroupAdmin     = model.GroupAdmin;
            data.UpdatedDate    = DateTime.UtcNow;
            return(await _context.SaveChangesAsync() > 0);
        }