示例#1
0
        public bool CreatePray(Pray pray)
        {
            var conn = _db.OpenConnection();

            try
            {
                var command = conn.CreateCommand();
                var cmdSql  = @"INSERT INTO sagradacruz.pray
                               (author, creation_date, city, content, prayed)
                               VALUES 
                               (@author, current_date(), @city, @content, NULL)";

                command.CommandText = cmdSql;

                _db.ClearParameters(ref command);
                _db.AddInParameter(ref command, "@author", pray.Author ?? "ANONIMO");
                _db.AddInParameter(ref command, "@city", pray.City ?? "NAO IDENTIFICADO");
                _db.AddInParameter(ref command, "@content", pray.Content ?? "VAZIO");

                var result = command.ExecuteNonQuery();

                return(result > 0);
            }
            catch (Exception ex)
            {
                return(false);
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
        }
示例#2
0
 public void deletePray(Pray p)
 {
     D.deletePray(p);
     if (p.synag.prays.Count == 0)
     {
         throw new Exception("Currently There R No Prays At That Synagogue - Maybe U Should Delete It..");
     }
 }
        public IActionResult NewPray(Pray pray)
        {
            PrayDAO dAO = new PrayDAO();

            var result = dAO.CreatePray(pray);

            return(Json(result));
        }
示例#4
0
 public void deletePray(Pray p)
 {
     if (GetPray(p.synag, p.time) != null)
     {
         DataSource.pray.Remove(p);
     }
     else
     {
         throw new Exception("That Pray Does Not Exist");
     }
 }
示例#5
0
        public void addPray(Pray p)
        {
            Synagogue s = getSynagogue(p.synag.name);

            if (s.prays.Find(m => m.time == p.time) == null)
            {
                return;
            }

            s.prays.Add(p);
            DataSource.pray.Add(p);

            //    if (p.pray == KindPray.Shacrit)
            //    s.Shacrit.Add(p);
            //else if (p.pray == KindPray.Minha)
            //    s.Minha.Add(p);
            //else s.Arvit.Add(p);
        }
示例#6
0
    void FixedUpdate()
    {
        if (Mathf.Abs(DistanceToCentre(transform.position)) > range + 1)
        {
            AddReward(-3f);
            HunterAgent hunt1 = ally1.GetComponent(typeof(HunterAgent)) as HunterAgent;
            hunt1.EndEpisode();
            HunterAgent hunt2 = ally2.GetComponent(typeof(HunterAgent)) as HunterAgent;
            hunt2.EndEpisode();
            EndEpisode();
            return;
        }

        if (this.StepCount > 1000)
        {
            EndEpisode();
            Pray p = target.GetComponent(typeof(Pray)) as Pray;
            p.Respawn();
        }
    }
示例#7
0
 public void addPray(Pray p)
 {
     D.addPray(p);
 }