Exemplo n.º 1
0
        public static void getRadniciByNLU(DSRadinici.RadniksDataTable dtRadnici, string Imetxt, string Prezimetxt, string Usernametxt)
        {
            dtRadnici.Clear();
            SqlConnection cn = Connection.GetConnection();

            if (cn.State == ConnectionState.Closed)
            {
                cn.Open();
            }

            try {
                SqlCommand cmd = new SqlCommand("usp_GetRadnikByNLU", cn);
                cmd.CommandType = CommandType.StoredProcedure;

                if (Imetxt != "")
                {
                    cmd.Parameters.Add("@Ime", SqlDbType.NVarChar).Value = Imetxt;
                }
                if (Prezimetxt != "")
                {
                    cmd.Parameters.Add("@Prezime", SqlDbType.NVarChar).Value = Prezimetxt;
                }
                if (Usernametxt != "")
                {
                    cmd.Parameters.Add("@Username", SqlDbType.NVarChar).Value = Usernametxt;
                }

                SqlDataAdapter adapter = new SqlDataAdapter(cmd);
                adapter.Fill(dtRadnici);
            }
            finally {
                cn.Close();
            }
        }
Exemplo n.º 2
0
        public static void getRadnici(DSRadinici.RadniksDataTable dtRadnici)
        {
            dtRadnici.Clear();
            SqlConnection cn = Connection.GetConnection();

            if (cn.State == ConnectionState.Closed)
            {
                cn.Open();
            }

            try {
                SqlCommand cmd = new SqlCommand("usp_Select_Radniks", cn);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataAdapter adapter = new SqlDataAdapter(cmd);
                adapter.Fill(dtRadnici);
            }
            finally {
                cn.Close();
            }
        }