Esempio n. 1
0
        public static Products ConvertToProduct(ProductDto prodDto)
        {
            Products product = new Products();

            product.Category = CategoryDAO.getCategoryById(prodDto.CategoryId);
            if (prodDto.Code == null || prodDto.Code == "")
            {
                product.Code = null;
            }
            else
            {
                product.Code = prodDto.Code;
            }
            product.CreatedDate = DateTime.Now;
            product.Description = prodDto.Description;
            product.Name        = prodDto.Name;
            product.Price       = prodDto.Price;
            product.Status      = StatusDAO.getStatusById(CONST.STATUS.ACTIVE);

            ProductDetails productDetail = new ProductDetails();

            productDetail.ProductTypeId = StatusDAO.getStatusById(CONST.STATUS.P_IMAGE);
            productDetail.Status        = StatusDAO.getStatusById(CONST.STATUS.ACTIVE);
            productDetail.CreatedDate   = DateTime.Now;
            productDetail.Contents      = prodDto.Image;
            productDetail.Product       = product;

            product.ProductDetails.Add(productDetail);

            if (prodDto.Id != null)
            {
                product.Id = prodDto.Id;
            }
            return(product);
        }
Esempio n. 2
0
 public StatusTO(bool conbd)
 {
     if (conbd)
     {
         this._dao = new StatusDAO();
     }
 }
        public async Task <IActionResult> Gerenciar(int?id, [FromServices] StatusDAO statusDAO,
                                                    [FromServices] CursosDAO cursoDAO)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var pessoa = await _context.Pessoas.SingleOrDefaultAsync(m => m.PessoaID == id);

            if (pessoa == null)
            {
                return(NotFound());
            }

            var idEvento = int.Parse(Cookie.LerCookie("EventoSelecionado", Request));

            ViewData["Cursos"]           = cursoDAO.ListarPorEvento(idEvento);
            ViewData["Status"]           = statusDAO.Listar();
            ViewData["CursosVinculados"] = _context.CursoPresencas.Where(x => x.PessoaID == pessoa.PessoaID);

            var novaPessoaViewModel = new NovaPessoaViewModel()
            {
                Pessoa           = pessoa,
                ImprimirEtiqueta = true
            };

            return(View(novaPessoaViewModel));
        }
Esempio n. 4
0
        public static void insertsIniciais()
        {
            StatusDAO statusDAO = new StatusDAO();

            if (statusDAO.checarInserts() == 0)
            {
                for (int i = 0; i < insertStatus.Length; i++)
                {
                    Status status = new Status();
                    status.Nome = insertStatus[i];
                    statusDAO.insert(status);
                }

                EstadosDAO estadosDAO = new EstadosDAO();

                for (int i = 0; i < insertEstados.Length; i++)
                {
                    Estados estado = new Estados();
                    estado.Nome  = insertEstados[i];
                    estado.Sigla = insertSiglas[i];
                    estadosDAO.insert(estado);
                }

                AcoesDAO acoesDAO = new AcoesDAO();

                for (int i = 0; i < insertAcoes.Length; i++)
                {
                    Acoes acao = new Acoes();
                    acao.Descricao = insertAcoes[i];
                    acoesDAO.insert(acao);
                }
            }
        }
Esempio n. 5
0
        public Collection <clsFilme> listarFilme(string ano,
                                                 string tituloOriginal,
                                                 string tituloBr,
                                                 string codGenero,
                                                 string codStatus)
        {
            clsGenero objGenero    = new clsGenero();
            GeneroDAO objGeneroDAO = new GeneroDAO();
            int       intCodGenero;

            try{
                intCodGenero = Convert.ToInt32(codGenero);
            }catch {
                intCodGenero = -1;
            }
            objGenero = objGeneroDAO.obterGenero(intCodGenero);

            clsStatus objStatus    = new clsStatus();
            StatusDAO objStatusDAO = new StatusDAO();
            int       intCodStatus;

            try
            {
                intCodStatus = Convert.ToInt32(codStatus);
            }
            catch {
                intCodStatus = -1;
            }
            objStatus = objStatusDAO.obterStatus(intCodStatus);


            FilmeDAO objFilmeDAO = new FilmeDAO();

            return(objFilmeDAO.listarFilmes(ano, tituloOriginal, tituloBr, objGenero, objStatus));
        }
Esempio n. 6
0
 public ProjetoController(ProjetoDAO projetoDAO, JobDAO jobDAO, StatusDAO statusDAO, IHostingEnvironment hosting)
 {
     _projetoDAO = projetoDAO;
     _jobDAO     = jobDAO;
     _statusDAO  = statusDAO;
     _hosting    = hosting;
 }
Esempio n. 7
0
 public ActionResult Index(int?id)
 {
     if (StatusDAO.BuscarPorNome("A Fazer") == null)
     {
         Status statusAdd = new Status();
         statusAdd.DescricaoStatus = "A Fazer";
         StatusDAO.Adicionar(statusAdd);
     }
     if (StatusDAO.BuscarPorNome("Em Execução") == null)
     {
         Status statusAdd = new Status();
         statusAdd.DescricaoStatus = "Em Execução";
         StatusDAO.Adicionar(statusAdd);
     }
     if (StatusDAO.BuscarPorNome("Concluído") == null)
     {
         Status statusAdd = new Status();
         statusAdd.DescricaoStatus = "Concluído";
         StatusDAO.Adicionar(statusAdd);
     }
     ViewBag.Status = StatusDAO.ListarTodos();
     if (id == null)
     {
         return(View(AtividadeDAO.ListarTodos()));
     }
     return(View(AtividadeDAO.BuscarAtividadePorStatus(id)));
 }
Esempio n. 8
0
        public PosiljkaStatusDTO posiljkaStatusKartaIPosiljka(int posiljkaID, int kartaID)
        {
            // throw new NotImplementedException();
            MySqlConnection conn = new MySqlConnection(ConfigurationManager.ConnectionStrings["BP_PosteSrpske"].ConnectionString);

            conn.Open();

            // List<PosiljkaStatusDTO> posiljkeS = new List<PosiljkaStatusDTO>();
            PosiljkaStatusDTO pt = null;

            MySqlCommand cmd = conn.CreateCommand();

            cmd.CommandText = "SELECT * FROM posiljkastatus WHERE IdKartaZakljucka = @kartaId AND IdPosiljka = @IdPosiljka";//status poslane - te trebaju za prijem!
            cmd.Parameters.AddWithValue("@kartaId", kartaID);
            cmd.Parameters.AddWithValue("@IdPosiljka", posiljkaID);

            MySqlDataReader reader = cmd.ExecuteReader();

            if (reader.Read())
            {
                PosiljkaDAO posDAO   = DAOFactory.getDAOFactory().getPosiljkaDAO();
                PosiljkaDTO posiljka = posDAO.vratiPosiljku(reader.GetInt32(1));

                KartaZakljuckaDAO kzDAO = DAOFactory.getDAOFactory().getKartaZakljuckaDAO();
                KartaZakljuckaDTO karta = kzDAO.vratiKartaZakljucka(reader.GetInt32(2));

                StatusDAO sDAO = DAOFactory.getDAOFactory().getStatusDAO();
                StatusDTO sDTO = sDAO.vratiStatus(reader.GetInt32(3));

                pt = new PosiljkaStatusDTO(sDTO, posiljka, karta, reader.GetInt32(0));
            }
            reader.Close();
            conn.Close();
            return(pt);
        }
Esempio n. 9
0
        public void DeleteProduct(string productCode)
        {
            var product = ProductDAO.getProductByCode(productCode);

            product.Status = StatusDAO.getStatusById(CONST.STATUS.DELETE);

            DAO.Execute(product, Entity.PRODUCT, ExecuteType.UPDATE);
        }
 public Services()
 {
     _repOcorrencia = new OcorrenciaDAO();
     _repComentario = new ComentarioDAO();
     _repImagem = new ImagemDAO();
     _repStatus = new StatusDAO();
     _repCategoria = new CategoriaDAO();
 }
Esempio n. 11
0
        public void MessageDelete(MessageDto message)
        {
            Messages mess = new Messages();

            mess        = Common.ConvertToMessages(message);
            mess.Status = StatusDAO.getStatusById(CONST.STATUS.DELETE);
            DAO.Execute(mess, Entity.MESSAGE, ExecuteType.UPDATE);
        }
Esempio n. 12
0
        public Boolean cadastrarStatus(string descricao)
        {
            StatusDAO objStatusDAO = new StatusDAO();
            clsStatus objStatus    = new clsStatus();

            objStatus.Descricao = descricao;
            return(objStatusDAO.cadastrarStatus(objStatus));
        }
Esempio n. 13
0
        //private int JobId;

        public TarefaController(ProjetoDAO projetoDAO, JobDAO jobDAO, TarefaDAO tarefaDAO, FuncionarioDAO funcionarioDAO, StatusDAO statusDAO, IHostingEnvironment hosting)
        {
            _projetoDAO     = projetoDAO;
            _jobDAO         = jobDAO;
            _tarefaDAO      = tarefaDAO;
            _funcionarioDAO = funcionarioDAO;
            _statusDAO      = statusDAO;
            _hosting        = hosting;
        }
Esempio n. 14
0
        public Boolean alterarStatus(int codigo, string descricao)
        {
            StatusDAO objStatusDAO = new StatusDAO();
            clsStatus objStatus    = new clsStatus();

            objStatus.Codigo    = codigo;
            objStatus.Descricao = descricao;
            return(objStatusDAO.alterarStatus(objStatus));
        }
Esempio n. 15
0
 public ActionResult CadastrarAtividade(Atividade atividade)
 {
     if (StatusDAO.BuscarPorNome("A Fazer") != null)
     {
         atividade.Status = StatusDAO.BuscarPorNome("A Fazer");
     }
     AtividadeDAO.Adicionar(atividade);
     return(RedirectToAction("Index", "Home"));
 }
Esempio n. 16
0
        public Boolean excluirStatus(int codStatus)
        {
            clsStatus objStatus = new clsStatus();

            objStatus.Codigo = codStatus;
            StatusDAO objStatusDAO = new StatusDAO();

            return(objStatusDAO.excluirStatus(objStatus));
        }
Esempio n. 17
0
        //private int ProjetoId;

        public JobController(JobDAO jobDAO, TarefaDAO tarefaDAO, DepartamentoDAO departamentoDAO, ProjetoDAO projetoDAO, StatusDAO statusDAO, IHostingEnvironment hosting)
        {
            _projetoDAO      = projetoDAO;
            _jobDAO          = jobDAO;
            _tarefaDAO       = tarefaDAO;
            _departamentoDAO = departamentoDAO;
            _statusDAO       = statusDAO;
            _hosting         = hosting;
        }
        public IActionResult Novo([FromServices] StatusDAO statusDAO,
                                  [FromServices] CursosDAO cursoDAO)
        {
            var id = int.Parse(Cookie.LerCookie("EventoSelecionado", Request));

            ViewData["Cursos"] = cursoDAO.ListarPorEvento(id);
            ViewData["Status"] = statusDAO.Listar();
            return(View());
        }
Esempio n. 19
0
        /// <summary> Retrieves in this StatusCollection object all StatusEntity objects which are related via a  relation of type 'm:n' with the passed in EmployeeEntity.
        /// All current elements in the collection are removed from the collection.</summary>
        /// <param name="employeeInstance">EmployeeEntity object to be used as a filter in the m:n relation</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
        /// <param name="pageNumber">The page number to retrieve.</param>
        /// <param name="pageSize">The page size of the page to retrieve.</param>
        /// <returns>true if the retrieval succeeded, false otherwise</returns>
        public virtual bool GetMultiManyToManyUsingEmployeeCollectionViaLoad(IEntity employeeInstance, long maxNumberOfItemsToReturn, ISortExpression sortClauses, int pageNumber, int pageSize)
        {
            if (!base.SuppressClearInGetMulti)
            {
                this.Clear();
            }
            StatusDAO dao = DAOFactory.CreateStatusDAO();

            return(dao.GetMultiUsingEmployeeCollectionViaLoad(base.Transaction, this, maxNumberOfItemsToReturn, sortClauses, base.EntityFactoryToUse, employeeInstance, pageNumber, pageSize));
        }
Esempio n. 20
0
        // GET: Status
        public ActionResult CarregarStatus(String codigoPedido, string loginP, string senhaP)
        {
            ViewBag.loginP = loginP;
            ViewBag.senhaP = senhaP;
            StatusDAO dao = new StatusDAO();

            List <ModPedido> ped = dao.ListarPedidoItemEmpresa(codigoPedido);

            ViewBag.codigoPedido = codigoPedido;
            return(PartialView(ped));
        }
Esempio n. 21
0
        public ActionResult AlterarStatus(string codigoPedido, string status)
        {
            ViewBag.lala1 = status;
            ViewBag.lala2 = codigoPedido;
            StatusDAO dao = new StatusDAO();

            string ped = dao.NovoStatus(status, codigoPedido);

            ViewBag.lala3 = ped;

            return(View());
        }
Esempio n. 22
0
        public string processar(EntidadeDominio entidade)
        {
            Check_in chk_in = (Check_in)entidade;
            Viagem   vg     = new Viagem()
            {
                Passageiros = new List <Bilhete>()
                {
                    chk_in.Entrada
                }
            };
            ViagemDAO vgDAO = new ViagemDAO()
            {
            };

            chk_in.Passagem.ID = ((Viagem)vgDAO.consultar(vg).ElementAt(0)).ID;
            Check_inDAO chkdao = new Check_inDAO();

            chkdao.salvar(chk_in);
            BagagemDAO bagagemDAO = new BagagemDAO();

            foreach (Bagagem a in chk_in.Bagagem)
            {
                a.dono = chk_in;
                bagagemDAO.salvar(a);
            }
            AssentoDAO assendao = new AssentoDAO();
            var        luiz     = (Assento)assendao.consultar(chk_in.Ocupante).ElementAt(0);

            chk_in.Ocupante.Tag       = luiz.Tag;
            chk_in.Ocupante.tipo.ID   = luiz.tipo.ID;
            chk_in.Ocupante.viagem.ID = luiz.viagem.ID;
            chk_in.Ocupante.ocupante  = chk_in;
            assendao.alterar(chk_in.Ocupante);
            List <EntidadeDominio> go     = new List <EntidadeDominio>();
            Departamento           dep    = new Departamento();
            DepartamentoDAO        depDAO = new DepartamentoDAO();

            go = depDAO.consultar(new Departamento()
            {
                Pass = chk_in.Passagem.Voo
            });
            if (go.Count > 0)
            {
                dep = (Departamento)go.ElementAt(0);
            }
            StatusDAO stDAO = new StatusDAO();

            stDAO.salvar(new Status()
            {
                Passageiro = chk_in.Entrada, IsDesembarque = false, Atual = dep
            });
            return("sucesso!");
        }
        public string processar(EntidadeDominio entidade)
        {
            Barrado   bar   = (Barrado)entidade;
            StatusDAO stDAO = new StatusDAO();

            bar.Passageiro = (Status)stDAO.consultar(new Status()
            {
                ID = bar.Passageiro.ID
            })[0];
            bar.Passageiro.Atual.ID = 0;
            stDAO.alterar(bar.Passageiro);
            return(null);
        }
Esempio n. 24
0
        public void AddCategory(String CategoryName, String ParentName)
        {
            Categories category = new Categories();

            category.Name   = CategoryName;
            category.Status = StatusDAO.getStatusById(CONST.STATUS.ACTIVE);
            DAO.Execute(category, Entity.CATEGORY, ExecuteType.ADD);
            category = CategoryDAO.getCategoryByName(CategoryName);
            CategoryRelations rel = new CategoryRelations();

            rel.Parent = CategoryDAO.getCategoryById(CONST.CATEGORY.CAT_TRANBAO);
            rel.Child  = category;
            DAO.Execute(rel, Entity.CATEGORYRELATION, ExecuteType.ADD);
        }
Esempio n. 25
0
        public ActionResult EtapaAnterior(int id)
        {
            Atividade atividadeBusca = AtividadeDAO.BuscarPorID(id);

            if (atividadeBusca.Status.DescricaoStatus.Equals("Em Execução"))
            {
                atividadeBusca.Status = StatusDAO.BuscarPorNome("A Fazer");
                AtividadeDAO.Atualizar(atividadeBusca);
            }
            else if (atividadeBusca.Status.DescricaoStatus.Equals("Concluído"))
            {
                atividadeBusca.Status = StatusDAO.BuscarPorNome("Em Execução");
                AtividadeDAO.Atualizar(atividadeBusca);
            }
            return(RedirectToAction("Index", "Home"));
        }
Esempio n. 26
0
        public static Messages ConvertToMessages(MessageDto MessagesDto)
        {
            Messages Messages = new Messages();

            if (MessagesDto != null)
            {
                Messages.Title       = MessagesDto.Title;
                Messages.Status      = StatusDAO.getStatusById(CONST.STATUS.UNREAD);
                Messages.Phone       = MessagesDto.Phone;
                Messages.Name        = MessagesDto.Name;
                Messages.Email       = MessagesDto.Email;
                Messages.Address     = MessagesDto.Address;
                Messages.CreatedDate = DateTime.Now;
                Messages.Contents    = MessagesDto.Contents;
            }
            return(Messages);
        }
Esempio n. 27
0
        /// <summary> Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are applied on.</summary>
        /// <param name="fieldIndex">Field index of field to which to apply the aggregate function and expression</param>
        /// <param name="expressionToExecute">The expression to execute. Can be null</param>
        /// <param name="aggregateToApply">Aggregate function to apply. </param>
        /// <param name="filter">The filter to apply to retrieve the scalar</param>
        /// <param name="relations">The relations to walk</param>
        /// <param name="groupByClause">The groupby clause to apply to retrieve the scalar</param>
        /// <returns>the scalar value requested</returns>
        public virtual object GetScalar(StatusFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply, IPredicate filter, IRelationCollection relations, IGroupByCollection groupByClause)
        {
            EntityFields fields = new EntityFields(1);

            fields[0] = EntityFieldFactory.Create(fieldIndex);
            if ((fields[0].ExpressionToApply == null) || (expressionToExecute != null))
            {
                fields[0].ExpressionToApply = expressionToExecute;
            }
            if ((fields[0].AggregateFunctionToApply == AggregateFunction.None) || (aggregateToApply != AggregateFunction.None))
            {
                fields[0].AggregateFunctionToApply = aggregateToApply;
            }
            StatusDAO dao = DAOFactory.CreateStatusDAO();

            return(dao.GetScalar(fields, base.Transaction, filter, relations, groupByClause));
        }
Esempio n. 28
0
        public static Comments ConvertToComments(CommentDto commentDto)
        {
            Comments comments = new Comments();

            if (commentDto != null)
            {
                comments.Title       = commentDto.Title;
                comments.Status      = StatusDAO.getStatusById(CONST.STATUS.ACTIVE);
                comments.Product     = ProductDAO.getProductById(commentDto.ProductId);
                comments.Phone       = commentDto.Phone;
                comments.Name        = commentDto.Name;
                comments.Email       = commentDto.Email;
                comments.CreatedDate = DateTime.Now;
                comments.Content     = commentDto.Content;
            }
            return(comments);
        }
Esempio n. 29
0
        public ActionResult ProximaEtapa(int id)
        {
            Atividade atividadeBusca = AtividadeDAO.BuscarPorID(id);

            if (atividadeBusca.RequisitoAtividade != 0)
            {
                Atividade atividadeDependente = AtividadeDAO.BuscarPorID(atividadeBusca.RequisitoAtividade);
                if (atividadeDependente.Status.DescricaoStatus.Equals("A Fazer") && atividadeBusca.Status.DescricaoStatus.Equals("A Fazer"))
                {
                    ViewBag.Erros = "Sua atividade é dependente. Efetue a atividade " + atividadeBusca.RequisitoAtividade + " primeiro";
                    return(RedirectToAction("Index", "Home"));
                }
                else if (atividadeDependente.Status.DescricaoStatus.Equals("Em Execução") && atividadeBusca.Status.DescricaoStatus.Equals("Em Execução"))
                {
                    ViewBag.Erros = "Sua atividade é dependente. Efetue a atividade " + atividadeBusca.RequisitoAtividade + " primeiro";
                    return(RedirectToAction("Index", "Home"));
                }

                if (atividadeBusca.Status.DescricaoStatus.Equals("A Fazer"))
                {
                    atividadeBusca.Status = StatusDAO.BuscarPorNome("Em Execução");
                    AtividadeDAO.Atualizar(atividadeBusca);
                }
                else if (atividadeBusca.Status.DescricaoStatus.Equals("Em Execução"))
                {
                    atividadeBusca.Status = StatusDAO.BuscarPorNome("Concluído");
                    AtividadeDAO.Atualizar(atividadeBusca);
                }
            }
            else
            {
                if (atividadeBusca.Status.DescricaoStatus.Equals("A Fazer"))
                {
                    atividadeBusca.Status = StatusDAO.BuscarPorNome("Em Execução");
                    AtividadeDAO.Atualizar(atividadeBusca);
                }
                else if (atividadeBusca.Status.DescricaoStatus.Equals("Em Execução"))
                {
                    atividadeBusca.Status = StatusDAO.BuscarPorNome("Concluído");
                    AtividadeDAO.Atualizar(atividadeBusca);
                }
            }
            return(RedirectToAction("Index", "Home"));
        }
Esempio n. 30
0
 //private readonly NotificationChannelDAO _notificationChannelDAO;
 //private readonly EmployeeDAO _employeeDAO;
 public StoreClerkController()
 {
     this._disbursementDAO         = new DisbursementDAO();
     this._requisitionDAO          = new RequisitionDAO();
     this._requisitionItemDAO      = new RequisitionItemDAO();
     this._stockRecordDAO          = new StockRecordDAO();
     this._disbursementItemDAO     = new DisbursementItemDAO();
     this._purchaseOrderDAO        = new PurchaseOrderDAO();
     this._itemDAO                 = new ItemDAO();
     this._statusDAO               = new StatusDAO();
     this._purchaseOrderDetailsDAO = new PurchaseOrderDetailsDAO();
     this._employeeDAO             = new EmployeeDAO();
     this._collectionpointDAO      = new CollectionPointDAO();
     this._notificationChannelDAO  = new NotificationChannelDAO();
     this._notificationDAO         = new NotificationDAO();
     this._supplierItemDAO         = new SupplierItemDAO();
     //this._notificationChannelDAO = new NotificationChannelDAO();
     //this._employeeDAO = new EmployeeDAO();
 }
Esempio n. 31
0
        public PosiljkaStatusDTO posiljkaStatusKarta(int posiljkaID)
        {
            MySqlConnection conn = new MySqlConnection(ConfigurationManager.ConnectionStrings["BP_PosteSrpske"].ConnectionString);

            conn.Open();

            // List<PosiljkaStatusDTO> posiljkeS = new List<PosiljkaStatusDTO>();
            PosiljkaStatusDTO pt = null;

            MySqlCommand cmd = conn.CreateCommand();

            cmd.CommandText = "SELECT * FROM posiljkastatus WHERE IdPosiljka = @IdPosiljka and IdStatus=1";//status poslane - te trebaju za prijem!
            //cmd.Parameters.AddWithValue("@kartaId", kartaID);
            cmd.Parameters.AddWithValue("@IdPosiljka", posiljkaID);

            MySqlDataReader reader = cmd.ExecuteReader();

            if (reader.Read())
            {
                PosiljkaDAO posDAO   = DAOFactory.getDAOFactory().getPosiljkaDAO();
                PosiljkaDTO posiljka = posDAO.vratiPosiljku(reader.GetInt32(1));

                KartaZakljuckaDAO kzDAO = DAOFactory.getDAOFactory().getKartaZakljuckaDAO();
                KartaZakljuckaDTO karta = kzDAO.vratiKartaZakljucka(reader.GetInt32(2));

                StatusDAO sDAO = DAOFactory.getDAOFactory().getStatusDAO();
                StatusDTO sDTO = sDAO.vratiStatus(reader.GetInt32(3));

                pt = new PosiljkaStatusDTO(sDTO, posiljka, karta, reader.GetInt32(0));
            }
            else
            {
                MessageBox.Show("Pošiljka ne postoji", "Informacija", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            reader.Close();
            conn.Close();
            return(pt);
        }