コード例 #1
0
        public static void GetEvidencijaBySRK(DSEvidencijaPrijava.EvidencijaPrijavasDataTable dtPrijave, string student, string radnik, string kolicina)
        {
            dtPrijave.Clear();
            SqlConnection cn = Connection.GetConnection();

            if (cn.State == System.Data.ConnectionState.Closed)
            {
                cn.Open();
            }
            try {
                SqlCommand cmd = new SqlCommand("usp_GetEvidencijaBySRK", cn);
                cmd.CommandType = CommandType.StoredProcedure;

                if (student != "")
                {
                    cmd.Parameters.Add("@Student", SqlDbType.NVarChar).Value = student;
                }
                if (radnik != "")
                {
                    cmd.Parameters.Add("@Radnik", SqlDbType.NVarChar).Value = radnik;
                }
                if (kolicina != "")
                {
                    cmd.Parameters.Add("@Kolicina", SqlDbType.Int).Value = Convert.ToInt32(kolicina);
                }

                SqlDataAdapter adapter = new SqlDataAdapter(cmd);
                adapter.Fill(dtPrijave);
            }
            finally {
                cn.Close();
            }
        }
コード例 #2
0
        public static void GetEvidencijaPrijava(DSEvidencijaPrijava.EvidencijaPrijavasDataTable dtPrijave)
        {
            SqlConnection cn = Connection.GetConnection();

            if (cn.State == System.Data.ConnectionState.Closed)
            {
                cn.Open();
            }
            try {
                SqlCommand cmd = new SqlCommand("usp_GetEvidencijePrijava", cn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

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