Exemplo n.º 1
0
        public static void getKurseviViewbyKursAndModul(DS_PretragaKandidata.view_KurseviDataTable dt_kursevi, int TrainingTypeID = 0, int TrainingSubTypeID = 0)
        {
            dt_kursevi.Clear();
            using (SqlConnection cn = Connection.GetOpenConnection())
            {
                SqlCommand com = new SqlCommand("usp_getKursevi", cn);
                com.CommandType = System.Data.CommandType.StoredProcedure;

                com.Parameters.AddWithValue("@TrainingTypeID", TrainingTypeID);
                com.Parameters.AddWithValue("@TrainingSubTypeID", TrainingSubTypeID);

                SqlDataAdapter adapter = new SqlDataAdapter(com);
                adapter.Fill(dt_kursevi);
            }
        }
Exemplo n.º 2
0
        public static void getKurseviViewbyKurs(DS_PretragaKandidata.view_KurseviDataTable dt_kursevi, int TrainingTypeID = 0)
        {
            dt_kursevi.Clear();
            using (SqlConnection cn = Connection.GetOpenConnection())
            {
                string     TTID = TrainingTypeID.ToString();
                SqlCommand com  = new SqlCommand();
                com.Connection = cn;
                if (TrainingTypeID != 0)
                {
                    com.CommandText = "select * from view_Kursevi where TrainingTypeID=" + TTID;
                }
                else
                {
                    com.CommandText = "select * from view_Kursevi";
                }

                SqlDataAdapter adapter = new SqlDataAdapter(com);
                adapter.Fill(dt_kursevi);
            }
        }