示例#1
0
        private string AjustarFiltroProntaEntrega(Pasta pasta)
        {
            var filtro = "";
            var listPe = _itemProntaEntrega.BuscarProntaEntregas(pasta.Grife);

            if (pasta.TipoUsuarioId == 19)
            {
                listPe = listPe.Where(x => x.TipoUsuario == null).ToList();
            }
            else if (pasta.TipoUsuarioId == 20)
            {
                listPe = listPe.Where(x => x.TipoUsuario == null || x.TipoUsuario.Equals("Franqueado")).ToList();
            }
            if (listPe.Any())
            {
                filtro = @" AND P.PRODUTO in (";
                foreach (var pe in listPe)
                {
                    filtro += "'" + pe.ProdutoId + "',";
                }
                filtro = filtro.Substring(0, filtro.Length - 1) + ")";
            }
            else
            {
                filtro = @" AND 'SEM PRONTA ENTREGA' = '0'";
            }
            return(filtro);
        }
示例#2
0
        private string GetArquivosPasta(string local, Pasta pasta)
        {
            var localSalvar = local;

            if (localSalvar != "")
            {
                localSalvar += "\\";
            }

            var _str = new StringBuilder();

            foreach (Arquivo arquivo in pasta.Arquivos)
            {
                if (arquivo.GerouConteudoGeradoApenasUmaVez)
                {
                    var pathArquivo = localSalvar + arquivo.GetNomeParaSalvarGeradoUmaVEz();
                    _str.AppendLine("    <Compile Include=\"" + pathArquivo + "\" />");
                }
                if (arquivo.GerouConteudoRegerado)
                {
                    var pathArquivo = localSalvar + arquivo.GetNomeParaSalvarRegeravel();
                    _str.AppendLine("    <Compile Include=\"" + pathArquivo + "\" />");
                }
            }

            foreach (var subPasta in pasta.SubPastas)
            {
                if (subPasta.Arquivos.Any() | subPasta.SubPastas.Any())
                {
                    _str.AppendLine(this.GetArquivosPasta(localSalvar + subPasta.Nome, subPasta));
                }
            }

            return(_str.ToString());
        }
示例#3
0
    static void Main(string[] args)
    {
        //Step 1: Define some dishes, and how many of each we can make
        FreshSalad caesarSalad = new FreshSalad("Crisp romaine lettuce", "Freshly-grated Parmesan cheese", "House-made Caesar dressing");

        caesarSalad.Display();

        Pasta fettuccineAlfredo = new Pasta("Fresh-made daily pasta", "Creamly garlic alfredo sauce");

        fettuccineAlfredo.Display();

        Console.WriteLine("\nMaking these dishes available.");

        //Step 2: Decorate the dishes; now if we attempt to order them once we're out of ingredients, we can notify the customer
        Available caesarAvailable  = new Available(caesarSalad, 3);
        Available alfredoAvailable = new Available(fettuccineAlfredo, 4);

        //Step 3: Order a bunch of dishes
        caesarAvailable.OrderItem("John");
        caesarAvailable.OrderItem("Sally");
        caesarAvailable.OrderItem("Manush");

        alfredoAvailable.OrderItem("Sally");
        alfredoAvailable.OrderItem("Francis");
        alfredoAvailable.OrderItem("Venkat");
        alfredoAvailable.OrderItem("Diana");
        alfredoAvailable.OrderItem("Dennis"); //There won't be enough for this order.

        caesarAvailable.Display();
        alfredoAvailable.Display();

        Console.ReadKey();
    }
示例#4
0
        private void Pasta_Click(Object sender, System.EventArgs e)
        {
            try
            {
                Int32    Id;
                MenuItem menuItem = (MenuItem)sender;
                if (menuItem.Tag.ToString().Substring(0, menuItem.Tag.ToString().IndexOf(" ")) == "PastaD")
                {
                    if (Negocio.Util.Arquivos.ArquivoExiste(Negocio.Geral.CentralizadorDados))
                    {
                        Process.Start(Negocio.Geral.CentralizadorDados, menuItem.Tag.ToString().Substring(menuItem.Tag.ToString().IndexOf(" ")));
                    }
                }
                else
                {
                    Id = Int32.Parse(menuItem.Tag.ToString().Substring(menuItem.Tag.ToString().IndexOf(" ")));

                    if (Id > 0)
                    {
                        Pasta pasta = Conexao.TrataDAO.getAcesso <Pasta>().Retorna_pId(Id);
                        if (pasta != null)
                        {
                            /*if (Menus.CheckURLValid(pasta.Caminho)|| pasta.Caminho.ToLower().StartsWith("starteam:")
                            || new System.IO.DirectoryInfo(pasta.Caminho).Exists || new System.IO.FileInfo(pasta.Caminho).Exists)*/
                            System.Diagnostics.Process.Start(pasta.Caminho);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                WinControls.ApresentarErro(AssistErroException.TratarErro(ex));
            }
        }
示例#5
0
        private Pasta GetPastaProjeto(Solucao solucao)
        {
            var pasta = new Pasta(this.NomeProjeto);

            pasta.AddArquivo(new ArquivoVbProj(this));
            return(pasta);
        }
示例#6
0
        private void dgvPastas_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                DataGridView dgvTemp = (DataGridView)sender;
                if (!String.IsNullOrEmpty(dgvTemp.CurrentRow.Cells[colPastasCaminho.Index].Value.ToString().Trim()) &&
                    !String.IsNullOrEmpty(dgvTemp.CurrentRow.Cells[colPastasDescricao.Index].Value.ToString().Trim()))
                {
                    Pasta pasta = Conexao.TrataDAO.getAcesso <Pasta>().Retorna_pId(int.Parse(dgvTemp.CurrentRow.Cells[colPastasId.Index].Value.ToString()));

                    if (pasta == null)
                    {
                        pasta = new Pasta();
                    }

                    pasta.Caminho   = dgvTemp.CurrentRow.Cells[colPastasCaminho.Index].Value.ToString().Trim();
                    pasta.Descricao = dgvTemp.CurrentRow.Cells[colPastasDescricao.Index].Value.ToString().Trim();
                    pasta.Tarefa    = entidade;
                    if (pasta.Tarefa != null)
                    {
                        pasta.Tarefa.AddPasta(pasta);
                    }
                    pasta.Ambiente = Geral.AmbienteLocal;
                    Conexao.TrataDAO.getAcesso <Pasta>().Salvar(pasta);
                    CarregarPastas();
                }
            }
            catch (Exception ex)
            {
                WinControls.ApresentarErro(AssistErroException.TratarErro(ex));
            }
        }
示例#7
0
        public ActionResult GravarPasta(string Pasta, string PastaOld)
        {
            var form = (JObject)JsonConvert.DeserializeObject(Pasta);

            Pasta _anterior = new Pasta();
            Pasta _novo = new Pasta();

            _novo.PastaId = (int)Util.GetValue<int>(form, "PastaId");
            _novo.PastaPaiId = (int?)Util.GetValue<int?>(form, "PastaPaiId");
            _novo.SiteId = GetCurrentSite();
            _novo.Descricao = (string)Util.GetValue<string>(form, "Descricao");

            #region --> Validação
            PastaResponse resp = new PastaResponse();
            if (string.IsNullOrEmpty(_novo.Descricao) || string.IsNullOrWhiteSpace(_novo.Descricao))
            {
                resp.Resposta.Erro = true;
                resp.Resposta.Mensagem += "- Informar uma Descrição";
            }
            if (resp.Resposta.Erro)
            {
                return Json(resp, JsonRequestBehavior.AllowGet);
            }
            #endregion

            return Json(new PastaDAL().Gravar(_novo, _anterior), JsonRequestBehavior.AllowGet);
        }
示例#8
0
        private Pasta GetPastaInterface()
        {
            var pasta = new Pasta("INTERFACE");

            pasta.AddArquivo(new ArquivoIStrConexao());
            return(pasta);
        }
示例#9
0
    /// <summary>
    /// Collider Trigger delegate called when a collider in the chef interacts with the world
    /// </summary>
    /// <param name="colliderTriggerEvent">Event captured when a collision occurs</param>
    public void ColliderTrigger(ColliderTriggerEvent colliderTriggerEvent)
    {
        // check to see if the event is the enter type (we don't want to process constant
        // collisions or exits)
        if (colliderTriggerEvent.triggerType == ColliderTriggerEvent.TRIGGER_TYPE.Enter)
        {
            // check to see if the tag of the event is "Attack"
            if (colliderTriggerEvent.tag == "Attack")
            {
                // check to see what object we collided with

                if (colliderTriggerEvent.otherCollider.name == "Refrigerator")
                {
                    // play the sound of hitting the fridge
                    gameManager.soundFXManager.Play("hit_refrigerator");
                }
                else if (colliderTriggerEvent.otherCollider.name == "Oven")
                {
                    // play the sound of hitting the oven
                    gameManager.soundFXManager.Play("hit_metal");
                }
                else
                {
                    // we hit a pasta

                    _hitPasta = colliderTriggerEvent.otherCollider.gameObject.transform.parent.GetComponent <Pasta>();
                    if (_hitPasta != null)
                    {
                        // send a notification to the pasta that it was hit and how hard
                        _hitPasta.Hit(colliderTriggerEvent.otherColliderClosestPointToBone, _currentWeapon.damage);
                    }
                }
            }
        }
    }
示例#10
0
        public static Orden_Compra CrearOrden(int cant, Pizza pizza, Pasta pasta, ITamano tamano)
        {
            Orden_Compra Orden = null;

            Orden = new Orden_Compra(cant, pizza, pasta, tamano);
            return(Orden);
        }
        public void CookPasta()
        {
            Restaurant resto = Restaurant.Instance;
            Pasta      pasta = resto.CookPasta();

            Assert.IsType <Ravioli>(pasta);
        }
示例#12
0
        public PastaResponse Carregar(int PastaId)
        {
            PastaResponse resposta = new PastaResponse();
            Pasta pasta;

            try
            {
                using (ConexaoDB objetoConexao = new ConexaoDB())
                {
                    objetoConexao.AdicionarParametro("@PastaId", SqlDbType.Int, PastaId);
                    objetoConexao.AdicionarParametro("@SiteId", SqlDbType.Int, DBNull.Value);
                    using (DataTable dt = objetoConexao.RetornarTabela("USP_SEL_Pasta"))
                    {
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            DataRow dr = dt.Rows[0];
                            pasta = new Pasta();
                            CarregarDTO_Pasta(pasta, dr);

                            resposta.Pasta = pasta;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //logBLL.Error(ex);
                throw;
            }

            return resposta;
        }
示例#13
0
        public string Get()
        {
            Pasta  pasta   = new Pasta();
            string message = pasta.Boil();

            return(message);
        }
示例#14
0
        private Pasta GetPastaDelegates()
        {
            var pasta = new Pasta("DELEGATES");

            pasta.AddArquivo(new ArquivoDelegates());
            return(pasta);
        }
示例#15
0
    public IMeal Cook()
    {
        Pasta pasta = PastaCookingOperations.MakePasta();
        Sauce sauce = PastaCookingOperations.MakeSauce();

        return(PastaCookingOperations.Combine(pasta, sauce));
    }
示例#16
0
        public PastaResponse Gravar(Pasta Pasta, Pasta PastaOld)
        {
            PastaResponse resposta = new PastaResponse();
            try
            {
                using (ConexaoDB objetoConexao = new ConexaoDB())
                {
                    objetoConexao.AdicionarParametro("@PastaId", SqlDbType.Int, Pasta.PastaId);
                    objetoConexao.AdicionarParametro("@PastaPaiId", SqlDbType.Int, Pasta.PastaPaiId);
                    objetoConexao.AdicionarParametro("@SiteId", SqlDbType.Int, Pasta.SiteId);
                    objetoConexao.AdicionarParametro("@Descricao", SqlDbType.VarChar, Pasta.Descricao);
                    using (DataTable dt = objetoConexao.RetornarTabela("USP_INS_Pasta"))
                    {
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            resposta.Resposta.Erro = false;
                            resposta.Resposta.Mensagem = "";
                            resposta.Pasta = Pasta;
                            resposta.Pasta.PastaId = (int)dt.Rows[0]["PastaId"];
                        }
                    }
                }

            }
            catch (Exception ex)
            {
                resposta.Resposta.Erro = true;
                resposta.Resposta.Mensagem = ex.Message;
                //logBLL.Error(ex);
            }
            return resposta;
        }
示例#17
0
 public OrdenCompra(int cant, Pizza pizza, Pasta pasta, Itamanno tamanno)
 {
     this.cantidad = cant;
     this.Pizza    = pizza;
     this.Tamanno  = tamanno;
     this.Pasta    = pasta;
     Lista_Extras  = new List <Extras>();
 }
示例#18
0
        public static OrdenCompra CrearOrden(int cant, Pizza pizza, Pasta pasta, Itamanno tamanno)
        {
            OrdenCompra orden = null;

            orden = new OrdenCompra(cant, pizza, pasta, tamanno);

            return(orden);
        }
示例#19
0
文件: Exercice2.cs 项目: Baxom/Kata
        public void CheckPasta()
        {
            var pasta = new Pasta();

            Assert.That(pasta.Quantity, Is.EqualTo(50), $"Quantite Pasta, attendu : 50, lu : {pasta.Quantity}");
            Assert.That(pasta.UnitPrice, Is.EqualTo(12), $"UnitPrice Pasta, attendu : 12, lu : {pasta.UnitPrice}");
            Assert.That(pasta.Total, Is.EqualTo(600), $"Total Pasta, attendu : 600, lu : {pasta.Total}");
        }
示例#20
0
 public Orden_Compra(int cantidad, Pizza pizza, Pasta pasta, ITamano tamano)
 {
     this.Cantidad    = cantidad;
     this.Pizza       = pizza;
     this.Pasta       = pasta;
     this.Tamano      = tamano;
     this.ListaExtras = new List <Extra>();
 }
示例#21
0
 public ActionResult ReposicionarPasta(int PastaId, int PastaPaiId, int Posicao)
 {
     PastaDAL dal = new PastaDAL();
     Pasta pasta = new Pasta();
     pasta.PastaId = PastaId;
     pasta.PastaPaiId = PastaPaiId == 0 ? new Nullable<int>() : PastaPaiId;
     pasta.Posicao = Posicao + 1;
     return Json(dal.Reposicionar(pasta), JsonRequestBehavior.AllowGet);
 }
示例#22
0
        public ActionResult CarregarPasta(int PastaId)
        {
            PastaDAL dal = new PastaDAL();
            Pasta pasta = new Pasta();

            var resposta = dal.Carregar(PastaId);

            return Json(resposta, JsonRequestBehavior.AllowGet);
        }
示例#23
0
        private Pasta GetPastaGeral()
        {
            var pasta = new Pasta("GERAL");

            pasta.AddArquivo(new ArquivoBaseDAL());
            pasta.AddArquivo(new ArquivoNotMappeableBDAttribute());
            pasta.AddArquivo(new ArquivoSQLCommands());
            return(pasta);
        }
示例#24
0
        private Pasta GetPastaProjeto(Solucao solucao)
        {
            var pasta = new Pasta(this.NomeProjeto);

            pasta.AddSubPasta(this.GetPastaTabelas(solucao));
            pasta.AddSubPasta(this.GetPastaProcedure(solucao));

            pasta.AddArquivo(new ArquivoSqlProj(this));
            return(pasta);
        }
示例#25
0
        private Pasta GetPastaTabelas(Solucao solucao)
        {
            var pasta = new Pasta("Tabelas");

            foreach (var entidade in solucao.Entidades)
            {
                pasta.AddArquivo(new ArquivoTabela(entidade));
            }

            return(pasta);
        }
示例#26
0
        public Pasta OrderPasta(string model)
        {
            Pasta pasta = _factory.CreatePasta(model);

            if (pasta == null)
            {
                return(null);
            }

            return(pasta);
        }
示例#27
0
        private void CriarArquivosDaPasta(String local, Pasta pasta, ShowProgresso showProgresso)
        {
            var localCompleto = local + "\\" + pasta.Nome;

            foreach (var subPasta in pasta.SubPastas)
            {
                CriarArquivosDaPasta(localCompleto, subPasta, showProgresso);
            }

            Diretorios.CriarArquivos(pasta.Arquivos, localCompleto, showProgresso);
        }
示例#28
0
        private Pasta GetPastaProcedure(Solucao solucao)
        {
            var pasta = new Pasta("Procedures");

            foreach (var entidade in solucao.Entidades)
            {
                pasta.AddSubPasta(this.GetPastaProceduresEntidade(entidade));
            }

            return(pasta);
        }
示例#29
0
        private Pasta GetPastaProceduresEntidade(EntidadeGerada entidade)
        {
            var pasta = new Pasta(entidade.Nome);

            pasta.AddArquivo(new ArquivoProcedureList(entidade));
            pasta.AddArquivo(new ArquivoProcedureSelect(entidade));
            pasta.AddArquivo(new ArquivoProcedureInsert(entidade));
            pasta.AddArquivo(new ArquivoProcedureUpdate(entidade));
            pasta.AddArquivo(new ArquivoProcedureDelete(entidade));
            return(pasta);
        }
示例#30
0
    public void Shoot()
    {
        PastaManager.Instance.pastaAmounts[currentSelectedPasta] -= 1;
        Pasta           shotPasta  = PastaManager.Instance.pastas[currentSelectedPasta];
        PastaShotConfig shotConfig = cookedReady ? shotPasta.config.cookedShot : shotPasta.config.crudeShot;

        reloadSpeed = shotConfig.reloadSpeed;
        reloadCount = reloadSpeed;

        if (SoundManager.Instance)
        {
            SoundManager.Instance.PlaySound(shotConfig.firingSound);
        }


        if (cookedReady)
        {
            cookedReady = false;
        }
        cooking      = false;
        cookingCount = 0f;

        for (int i = 0; i < shotConfig.missileAmount; i++)
        {
            PastaProjectile projectile = PastaManager.Instance.CreateProjectileAtPosition(shotConfig, (Vector2)transform.position +
                                                                                          (shootingLeft ? new Vector2(-shotLocalPosition.x, shotLocalPosition.y) : shotLocalPosition), shotPasta);

            if (PlayerController._instance)
            {
                projectile.transform.position += PlayerController._instance.transform.position;
            }

            FXPlayer.Instance.PlayFX("Shot", projectile.transform.position);

            if (shotConfig.missileAmount > 1)
            {
                int   addedAngle       = shootingLeft ? 0 : 0;
                float angleIncrement   = shotConfig.missileSpreadAngle / (shotConfig.missileAmount - 1);
                float maxPositiveAngle = addedAngle + (shotConfig.missileSpreadAngle / 2f);

                projectile.transform.eulerAngles = new Vector3(0, 0, maxPositiveAngle - (angleIncrement * i));
            }
            else
            {
                projectile.transform.eulerAngles = Vector3.zero;
            }

            projectile.shotByPlayer = true;
            projectile.SetDirection(shootingLeft);
            projectile.Shoot();
        }
    }
示例#31
0
        public void AddNumberAlreadyUsed()
        {
            //Arrange - her sætter vi tingene op
            IMenuCatalog c = new MenuCatalog();

            IMenuItem i  = new Pasta(1, "Pasta", "A type of pasta", 10, MenuType.Pasta, true, false, true);
            IMenuItem i2 = new Pasta(1, "CopyPasta", "A duplicate type of pasta", 10, MenuType.Pasta, true, false, true);

            //Act - her udføres en handling
            c.Add(i);
            c.Add(i2);

            //Assert - her tjekkes om resultatet er som forventet
        }
示例#32
0
        public void SubtotalOfSingleIngredient()
        {
            //Arrange
            Ingredient pasta = new Pasta(null, DEFAULT_UNIT_SIZE);

            //Assert
            Assert.AreEqual(pasta.getIngredientSubtotal(), pasta.getSubtotal());

            //Act
            double subTotalExpected = 0.31 * DEFAULT_UNIT_SIZE;

            //Assert
            Assert.AreEqual(subTotalExpected, pasta.getSubtotal());
        }
        private static void CriarPastasEArquivos()
        {
            Raiz.Pai = Raiz;
            Pasta p1 = new Pasta("Primeira Pasta", Pastas);
            Pasta p2 = new Pasta("Segunda Pasta", Pastas);
            Pasta p3 = new Pasta("Terceira Pasta", Pastas);

            Raiz.Adicionar(p1);
            p1.Adicionar(p2);
            p2.Adicionar(p3);
            p2.Adicionar(new Pasta("Quarta Pasta", Pastas));
            p3.Adicionar(new Arquivo("Primeiro Arquivo", "Conteúdo de testes", Pastas));
            p3.Adicionar(new Arquivo("Segundo Arquivo", "Conteúdo de testes adfasdfasdf", Pastas));
        }
示例#34
0
        public void AddPastaTest()
        {
            //Arrange - her sætter vi tingene op
            IMenuCatalog c = new MenuCatalog();

            int       numberBefore = c.Count;
            IMenuItem i            = new Pasta(1, "Pasta", "A type of pasta", 10, MenuType.Pasta, true, false, true);

            //Act - her udføres en handling
            c.Add(i);
            int numberAfter = c.Count;

            //Assert - her tjekkes om resultatet er som forventet
            Assert.AreEqual(numberBefore + 1, numberAfter);
        }
示例#35
0
        public void TaxOfSingleIngredient()
        {
            //Arrange
            Ingredient pasta = new Pasta(null, DEFAULT_UNIT_SIZE);

            //Act
            double pastaRawSubtotal = pasta.getRawSubtotal();
            double taxExpected      = Ingredient.RoundUpTax(
                Math.Round(Constants.DEFAULT_TAX_RATE * pastaRawSubtotal, 2)
                );
            double taxActual = pasta.getTax();

            //Assert
            Assert.AreEqual(taxExpected, taxActual);
        }
示例#36
0
    /// <summary>
    /// Gets the number of pastas for each type that need to be active
    /// based on the total number of kills
    /// </summary>
    /// <returns>The number of active pastas</returns>
    public int GetCurrentPastaTypeCount(Pasta.TYPE pastaType)
    {
        // go through the difficulty levels, starting with the highest first
        foreach (DifficultyLevel dl in _internalDifficultyLevels)
        {
            // if the total kills is higher than this difficulty level threshold
            if (TotalPastaKills >= dl.totalKillThreshold)
            {
                // look for the correct pasta type and return the count
                switch (pastaType)
                {
                    case Pasta.TYPE.Pizza:
                        return dl.pizzaCount;
                }
            }
        }

        // no difficulty level reached or no pasta type found, just return zero
        return 0;
    }
示例#37
0
        public void TaxOfSingleIngredient()
        {
            //Arrange
            Ingredient pasta = new Pasta(null, DEFAULT_UNIT_SIZE);

            //Act
            double pastaRawSubtotal = pasta.getRawSubtotal();
            double taxExpected = Ingredient.RoundUpTax(
                Math.Round(Constants.DEFAULT_TAX_RATE * pastaRawSubtotal, 2)
            );
            double taxActual = pasta.getTax();

            //Assert
            Assert.AreEqual(taxExpected, taxActual);
        }
示例#38
0
        public void SubtotalOfSingleIngredient()
        {
            //Arrange
            Ingredient pasta = new Pasta(null, DEFAULT_UNIT_SIZE);

            //Assert
            Assert.AreEqual(pasta.getIngredientSubtotal(), pasta.getSubtotal());

            //Act
            double subTotalExpected = 0.31 * DEFAULT_UNIT_SIZE;

            //Assert
            Assert.AreEqual(subTotalExpected, pasta.getSubtotal());
        }
示例#39
0
    /// <summary>
    /// Collider Trigger delegate called when a collider in the chef interacts with the world
    /// </summary>
    /// <param name="colliderTriggerEvent">Event captured when a collision occurs</param>
    public void ColliderTrigger(ColliderTriggerEvent colliderTriggerEvent)
    {
        // check to see if the event is the enter type (we don't want to process constant
        // collisions or exits)
        if (colliderTriggerEvent.triggerType == ColliderTriggerEvent.TRIGGER_TYPE.Enter)
        {
            // check to see if the tag of the event is "Attack"
            if (colliderTriggerEvent.tag == "Attack")
            {
                // check to see what object we collided with

                if (colliderTriggerEvent.otherCollider.name == "Refrigerator")
                {
                    // play the sound of hitting the fridge
                    gameManager.soundFXManager.Play("hit_refrigerator");
                }
                else if (colliderTriggerEvent.otherCollider.name == "Oven")
                {
                    // play the sound of hitting the oven
                    gameManager.soundFXManager.Play("hit_metal");
                }
                else
                {
                    // we hit a pasta

                    _hitPasta = colliderTriggerEvent.otherCollider.gameObject.transform.parent.GetComponent<Pasta>();
                    if (_hitPasta != null)
                    {
                        // send a notification to the pasta that it was hit and how hard
                        _hitPasta.Hit(colliderTriggerEvent.otherColliderClosestPointToBone, _currentWeapon.damage);
                    }
                }
            }
        }
    }
示例#40
0
 public PastaResponse()
 {
     Resposta = new Resposta();
     Pasta = new Pasta();
 }
示例#41
0
        public List<Pasta> ListarPasta(int SiteId)
        {
            List<Pasta> lista = new List<Pasta>();
            Pasta reg;

            try
            {
                using (ConexaoDB objetoConexao = new ConexaoDB())
                {
                    objetoConexao.AdicionarParametro("@PastaId", SqlDbType.Int, DBNull.Value);
                    objetoConexao.AdicionarParametro("@SiteId", SqlDbType.Int, SiteId);
                    using (DataTable dt = objetoConexao.RetornarTabela("USP_SEL_Pasta"))
                    {
                        foreach (DataRow r in dt.Rows)
                        {
                            reg = new Pasta();
                            CarregarDTO_Pasta(reg, r);
                            lista.Add(reg);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                //logBLL.Error(ex);
                throw;
            }

            return lista;
        }
示例#42
0
        public PastaResponse Reposicionar(Pasta Pasta)
        {
            PastaResponse resposta = new PastaResponse();
            try
            {
                using (ConexaoDB objetoConexao = new ConexaoDB())
                {
                    objetoConexao.AdicionarParametro("@PastaId", SqlDbType.Int, Pasta.PastaId);
                    objetoConexao.AdicionarParametro("@PastaPaiId", SqlDbType.Int, Pasta.PastaPaiId);
                    objetoConexao.AdicionarParametro("@Posicao", SqlDbType.Int, Pasta.Posicao);
                    using (DataTable dt = objetoConexao.RetornarTabela("USP_UPD_Pasta_Reposicionar"))
                    {
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            resposta.Resposta.Erro = (bool)dt.Rows[0]["indErro"];
                            resposta.Resposta.Mensagem = (string)dt.Rows[0]["msgErro"];
                            resposta.Pasta = null;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                resposta.Resposta.Erro = true;
                resposta.Resposta.Mensagem = ex.Message;

                //logBLL.Error(ex);
            }
            return resposta;
        }
示例#43
0
 private void CarregarDTO_Pasta(Pasta dto, DataRow dr)
 {
     if (Util.GetNonNull(dr["PastaId"]))
         dto.PastaId = (int)dr["PastaId"];
     if (Util.GetNonNull(dr["PastaPaiId"]))
         dto.PastaPaiId = (int)dr["PastaPaiId"];
     if (Util.GetNonNull(dr["SiteId"]))
         dto.SiteId = (int)dr["SiteId"];
     if (Util.GetNonNull(dr["Descricao"]))
         dto.Descricao = dr["Descricao"].ToString();
     if (Util.GetNonNull(dr["Posicao"]))
         dto.Posicao = (int)dr["Posicao"];
 }
示例#44
0
 /// <summary>
 /// Deactivates a pasta so that it can be reused
 /// </summary>
 /// <param name="pasta">Pasta object to "kill"</param>
 public void KillPasta(Pasta pasta)
 {
     // set the pasta state to Dead
     pasta.State = Pasta.STATE.Dead;
 }