public UnidadeService ObterService()
        {
            Mocker         = new AutoMocker();
            UnidadeService = Mocker.CreateInstance <UnidadeService>();

            return(UnidadeService);
        }
예제 #2
0
        public static MvcHtmlString SelectUnidade(this HtmlHelper html, int idUnidade = 0, bool selecione = false)
        {
            var idEmpresa = new UsuarioService().GetUsuario(System.Web.HttpContext.Current.User.Identity.Name).IdEmpresa;

            var unidades = new UnidadeService().Listar()
                           .Where(x => x.IdEmpresa == idEmpresa)
                           .OrderBy(x => x.Descricao)
                           .ToList();

            TagBuilder tag = new TagBuilder("select");

            tag.MergeAttribute("id", "IdUnidade");
            tag.MergeAttribute("name", "IdUnidade");
            tag.MergeAttribute("class", "form-control");

            if (selecione == true)
            {
                TagBuilder itemSel = new TagBuilder("option");
                itemSel.MergeAttribute("value", "0");
                itemSel.SetInnerText("");
                tag.InnerHtml += itemSel.ToString();
            }

            foreach (var item in unidades)
            {
                TagBuilder itemTag = new TagBuilder("option");
                itemTag.MergeAttribute("value", item.Id.ToString());
                if (item.Id == idUnidade)
                {
                    itemTag.MergeAttribute("selected", "selected");
                }
                itemTag.SetInnerText(item.Descricao);
                tag.InnerHtml += itemTag.ToString();
            }
            return(new MvcHtmlString(tag.ToString()));
        }
 public UnidadeServiceTests(UnidadeTestsAutoMockerFixture unidadeTestsFixture)
 {
     _unidadeTestsAutoMockerFixture = unidadeTestsFixture;
     _unidadeService = _unidadeTestsAutoMockerFixture.ObterService();
 }
 public PactoRepository(PGDDbContext context, UnidadeService unidadeService, IIniciativaPlanoOperacionalRepository iniciativaPORepository)
     : base(context)
 {
     this._unidadeService         = unidadeService;
     this._iniciativaPORepository = iniciativaPORepository;
 }
예제 #5
0
 public UnidadeController()
 {
     unidadeService = new UnidadeService(NHibernateHelper.OpenSession());
 }
예제 #6
0
 public UnidadeController(UnidadeService unidadeService)
 {
     _unidadeService = unidadeService;
 }
예제 #7
0
 public UnidadeController(UnidadeService service)
 {
     this.service = service;
 }
 public FuncionariosController(
     FuncionarioService funcionarioService, UnidadeService unidadeService)
 {
     _funcionarioService = funcionarioService;
     _unidadeService     = unidadeService;
 }
예제 #9
0
        public void Update(Unidade entity)
        {
            var service = new UnidadeService(_unidadeRepository);

            service.Update(entity);
        }
예제 #10
0
        public void Register(Unidade user)
        {
            var service = new UnidadeService(_unidadeRepository);

            service.Registre(user);
        }
예제 #11
0
        public Unidade GetById(int id)
        {
            var service = new UnidadeService(_unidadeRepository);

            return(service.GetById(id));
        }
예제 #12
0
        public List <Unidade> GetAll()
        {
            var service = new UnidadeService(_unidadeRepository);

            return(service.GetAll());
        }
예제 #13
0
        public List <Unidade> Get(string name)
        {
            var service = new UnidadeService(_unidadeRepository);

            return(service.GetByName(name).ToList());
        }
예제 #14
0
        public void Delete(int id)
        {
            var service = new UnidadeService(_unidadeRepository);

            service.Delete(id);
        }