Exemplo n.º 1
0
        public bool Update(Models.Domain.Status status)
        {
            _databaseContext.Update(status);
            int result = _databaseContext.SaveChanges();

            return(Convert.ToBoolean(result));
        }
Exemplo n.º 2
0
        public bool Delete(int id)
        {
            Models.Domain.Status model = this.GetById(id);
            _databaseContext.Remove(model);
            int result = _databaseContext.SaveChanges();

            return(Convert.ToBoolean(result));
        }
        public void InsertStatusCodeList()
        {
            Models.Domain.Status statusWaitingForApproval = new Models.Domain.Status {
                Name = "WaitingForApproval", Description = ""
            };
            Models.Domain.Status statusActive = new Models.Domain.Status {
                Name = "Active", Description = ""
            };
            Models.Domain.Status statusPassive = new Models.Domain.Status {
                Name = "Passive", Description = ""
            };
            Models.Domain.Status statusWaiting = new Models.Domain.Status {
                Name = "Waiting", Description = ""
            };
            Models.Domain.Status statusDeleted = new Models.Domain.Status {
                Name = "Deleted", Description = ""
            };
            Models.Domain.Status statusReserve = new Models.Domain.Status {
                Name = "Reserve", Description = ""
            };

            if (_statusService.GetByName("WaitingForApproval") == null)
            {
                _statusService.Save(statusWaitingForApproval);
            }

            if (_statusService.GetByName("Active") == null)
            {
                _statusService.Save(statusActive);
            }

            if (_statusService.GetByName("Passive") == null)
            {
                _statusService.Save(statusPassive);
            }

            if (_statusService.GetByName("Waiting") == null)
            {
                _statusService.Save(statusWaiting);
            }

            if (_statusService.GetByName("Deleted") == null)
            {
                _statusService.Save(statusDeleted);
            }
            if (_statusService.GetByName("Reserve") == null)
            {
                _statusService.Save(statusReserve);
            }
        }
 public bool Update(Models.Domain.Status status)
 {
     return(_statusRepository.Update(status));
 }
 public int Save(Models.Domain.Status status)
 {
     _statusRepository.Save(status);
     return(status.Id);
 }
Exemplo n.º 6
0
 public int Save(Models.Domain.Status status)
 {
     _databaseContext.Add(status);
     _databaseContext.SaveChanges();
     return(status.Id);
 }
Exemplo n.º 7
0
 public Models.Domain.Status GetById(int id)
 {
     Models.Domain.Status model = _databaseContext.Set <Models.Domain.Status>().Where(p => p.Id == id).FirstOrDefault();
     return(model);
 }
Exemplo n.º 8
0
 public Models.Domain.Status GetByName(string name)
 {
     Models.Domain.Status model = _databaseContext.Set <Models.Domain.Status>().Where(p => p.Name == name).FirstOrDefault();
     return(model);
 }