public BioProfile Read(long id)
        {
            const string sql = "SELECT Id, ObjectId, CreatedAt, ModifiedAt, DeletedAt FROM BioProfile WHERE Id=@Id";

            BioProfile entity = null;

            using (var connection = new SqlConnection(_connectionString))
            {
                connection.Open();

                using (var command = new SqlCommand(sql, connection))
                {
                    command.Parameters.AddWithValue("@Id", id);
                    var reader = command.ExecuteReader(CommandBehavior.SingleResult);

                    while (reader.Read())
                    {
                        entity = new BioProfile()
                        {
                            Id         = (System.Int64)reader["Id"],
                            ObjectId   = (System.Guid)reader["ObjectId"],
                            CreatedAt  = (System.DateTime)reader["CreatedAt"],
                            ModifiedAt = (System.DateTime)reader["ModifiedAt"],
                            DeletedAt  = (System.DateTime?)reader["DeletedAt"],
                        };
                    }
                }
            }

            return(entity);
        }
Example #2
0
 //for loading Tama's Bio
 public void TamaBio()
 {
     Debug.Log("Clicked Tama");
     currentlyViewBio = Tama;
     nameTag.transform.Find("Text").gameObject.GetComponent <Text>().text = Tama.getFullName();
     displayBioInformation(Tama);
 }
Example #3
0
    public void displayBioInformation(BioProfile sourceBio)
    {
        BioFile temp = sourceBio.getSpecificBio(sourceBio.getCurrentViewIndex());

        if (temp.isLocked())
        {
            setTextAreaToLockedPlaceHolder();
        }
        else
        {
            setTextArea(temp.getBioTitle(), temp.getBioContents());
        }
    }
        public bool Insert(BioProfile entity)
        {
            const string sql = "INSERT INTO BioProfile ( Id, ObjectId, CreatedAt, ModifiedAt, DeletedAt ) VALUES ( @Id, @ObjectId, @CreatedAt, @ModifiedAt, @DeletedAt )";

            long rows;

            using (var connection = new SqlConnection(_connectionString))
            {
                using (var command = new SqlCommand(sql, connection))
                {
                    command.Parameters.AddWithValue("@Id", entity.Id);
                    command.Parameters.AddWithValue("@ObjectId", entity.ObjectId);
                    command.Parameters.AddWithValue("@CreatedAt", entity.CreatedAt);
                    command.Parameters.AddWithValue("@ModifiedAt", entity.ModifiedAt);
                    command.Parameters.AddWithValue("@DeletedAt", entity.DeletedAt);

                    rows = command.ExecuteNonQuery();
                }
            }

            return(rows > 0);
        }
 public bool Update(BioProfile entity)
 {
     return(false);
 }
Example #6
0
 //for loading Neru's Bio
 public void NeruBio()
 {
     currentlyViewBio = Neru;
     nameTag.transform.Find("Text").gameObject.GetComponent <Text>().text = Neru.getFullName();
     displayBioInformation(Neru);
 }
Example #7
0
 //for loading Elliot's Bio
 public void ElliotBio()
 {
     currentlyViewBio = Elliot;
     nameTag.transform.Find("Text").gameObject.GetComponent <Text>().text = Elliot.getFullName();
     displayBioInformation(Elliot);
 }
Example #8
0
 //for loading Akira's Bio
 public void AkiraBio()
 {
     currentlyViewBio = Akira;
     nameTag.transform.Find("Text").gameObject.GetComponent <Text>().text = Akira.getFullName();
     displayBioInformation(Akira);
 }