Beispiel #1
0
        public static bool UpdateKlijent(Klijent k)
        {
            SqlParameter[] parameters = new SqlParameter[5];

            parameters[0] = new SqlParameter("@IDKlijent", SqlDbType.Int)
            {
                Direction = ParameterDirection.Input,
                Value     = k.IDKlijent
            };

            parameters[1] = new SqlParameter("@Naziv", SqlDbType.NVarChar, 30)
            {
                Direction = ParameterDirection.Input,
                Value     = k.Naziv
            };

            parameters[2] = new SqlParameter("@Telefon", SqlDbType.NVarChar, 15)
            {
                Direction = ParameterDirection.Input,
                Value     = k.Telefon
            };

            parameters[3] = new SqlParameter("@Email", SqlDbType.NVarChar, 25)
            {
                Direction = ParameterDirection.Input,
                Value     = k.Email
            };

            parameters[4] = new SqlParameter("@output", SqlDbType.Int)
            {
                Direction = ParameterDirection.Output
            };

            SqlHelper.ExecuteDataset(cs, CommandType.StoredProcedure, "AzurirajKlijenta", parameters);

            int output = (int)parameters[4].Value;

            return(output == 1);
        }
Beispiel #2
0
        public static void AddNewKlijent(Klijent k)
        {
            SqlParameter[] parameters = new SqlParameter[3];

            parameters[0] = new SqlParameter("@Naziv", SqlDbType.NVarChar, 30)
            {
                Direction = ParameterDirection.Input,
                Value     = k.Naziv
            };

            parameters[1] = new SqlParameter("@Telefon", SqlDbType.NVarChar, 15)
            {
                Direction = ParameterDirection.Input,
                Value     = k.Telefon
            };

            parameters[2] = new SqlParameter("@Email", SqlDbType.NVarChar, 25)
            {
                Direction = ParameterDirection.Input,
                Value     = k.Email
            };

            SqlHelper.ExecuteDataset(cs, CommandType.StoredProcedure, "DodajNovogKlijenta", parameters);
        }
 public Projekt(int idProjekt, string naziv, DateTime datumOtvaranja, Djelatnik voditelj, Klijent klijent, string opisProjekta)
     : this(naziv, datumOtvaranja, voditelj, klijent, opisProjekta)
     => IDProjekt = idProjekt;