예제 #1
0
 public int createNewNotification(String text, int Zamestnanec_z_ID, int Tiket_t_ID)
 {
     Notifikace n = new Notifikace();
     n.text = text;
     n.Zamestnanec_z_ID = Zamestnanec_z_ID;
     n.Tiket_t_ID = Tiket_t_ID;
     return nr.saveNotification(n);
 }
예제 #2
0
        private void PrepareCommandInsert(SqlCommand command, Notifikace Notifikace)
        {
            command.Parameters.Add(new SqlParameter("@text", SqlDbType.VarChar, Notifikace.LEN_ATTR_text));
            command.Parameters["@text"].Value = Notifikace.text;

            command.Parameters.Add(new SqlParameter("@Zamestnanec_z_ID", SqlDbType.Int));
            command.Parameters["@Zamestnanec_z_ID"].Value = Notifikace.Zamestnanec_z_ID;

            command.Parameters.Add(new SqlParameter("@Tiket_t_ID", SqlDbType.Int));
            command.Parameters["@Tiket_t_ID"].Value = Notifikace.Tiket_t_ID;
        }
예제 #3
0
        private Collection<Notifikace> Read(SqlDataReader reader)
        {
            Collection<Notifikace> nots = new Collection<Notifikace>();

            while (reader.Read())
            {
                Notifikace not = new Notifikace();
                not.n_ID = reader.GetInt32(0);
                not.text = reader.GetString(1);
                not.Zamestnanec_z_ID = reader.GetInt32(2);
                not.Tiket_t_ID = reader.GetInt32(3);
                nots.Add(not);
            }
            return nots;
        }
예제 #4
0
 public int insert(Notifikace Notifikace)
 {
     SqlCommand command = db.CreateCommand(SQL_INSERT);
     PrepareCommandInsert(command, Notifikace);
     return db.ExecuteNonQuery(command);
 }
 public int saveNotification(Notifikace n)
 {
     return nm.insert(n);
 }