示例#1
0
        public Kursi KursiSelectByEmri(String Emri)
        {
            SqlConnection con   = Generals.GetNewConnection();
            Kursi         kursi = null;

            try
            {
                SqlCommand cmd = new SqlCommand("SelectLendaByEmri", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@Emri", Emri);

                SqlDataReader rdr = cmd.ExecuteReader();
                kursi = new Kursi();
                while (rdr.Read())
                {
                    kursi.KursiID = (int)rdr["KursiID"];
                }
            }
            finally
            {
                con.Close();
            }
            return(kursi);
        }
示例#2
0
        public ProfesoriKursi GetProfKursiIDByProfesoriIDAndKursiID(int ProfesoriID, int KursiID)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("GetProfKursiByProfIDandKursiID", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ProfesoriID", ProfesoriID);
                cmd.Parameters.AddWithValue("@KursiID", KursiID);
                SqlDataReader rdr = cmd.ExecuteReader();

                ProfesoriKursi pk = new ProfesoriKursi();

                while (rdr.Read())
                {
                    pk.ProfesoriKursiID = (int)rdr["ProfesoriKursiID"];
                }

                return(pk);
            }
            finally
            {
                con.Close();
            }
        }
示例#3
0
        public DataTable readRequests()
        {
            SqlConnection con = Generals.GetNewConnection();

            DataTable dt = null;

            try
            {
                SqlCommand cmd = new SqlCommand("readRequests", con);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataReader rdr = cmd.ExecuteReader();
                dt = new DataTable();
                dt.Columns.Add("ProfesoriKursiID");
                dt.Columns.Add("Profesori");
                dt.Columns.Add("Kursi");
                dt.Columns.Add("Numri");
                while (rdr.Read())
                {
                    DataRow dr = dt.NewRow();
                    dr["ProfesoriKursiID"] = (int)rdr["ProfesoriKursiID"];
                    dr["Profesori"]        = rdr["Profesori"].ToString();
                    dr["Kursi"]            = rdr["Kursi"].ToString();
                    dr["Numri"]            = rdr["Numri"].ToString();
                    dt.Rows.Add(dr);
                }
            }
            finally
            {
                con.Close();
            }
            return(dt);
        }
示例#4
0
        public DataTable getRequestsByProfesoriKursi(int ProfesoriKursiid)
        {
            SqlConnection con = Generals.GetNewConnection();
            DataTable     dt  = null;

            try
            {
                SqlCommand cmd = new SqlCommand("getRequestsByProfesoriKursi", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ProfesoriKursiid", ProfesoriKursiid);

                SqlDataReader rdr = cmd.ExecuteReader();
                dt = new DataTable();
                dt.Columns.Add("RequestID");
                dt.Columns.Add("StudentiID");
                dt.Columns.Add("Emri");
                dt.Columns.Add("Mbiemri");
                dt.Columns.Add("Programi");
                while (rdr.Read())
                {
                    DataRow dr = dt.NewRow();
                    dr["RequestID"]  = (int)rdr["RequestID"];
                    dr["StudentiID"] = (int)rdr["StudentiID"];
                    dr["Emri"]       = rdr["Emri"].ToString();
                    dr["Mbiemri"]    = rdr["Mbiemri"].ToString();
                    dr["Programi"]   = rdr["Programi"].ToString();
                    dt.Rows.Add(dr);
                }
            }
            finally
            {
                con.Close();
            }
            return(dt);
        }
示例#5
0
        public InternalUser UseriSelectByEmail(string email)
        {
            SqlConnection con  = Generals.GetNewConnection();
            InternalUser  user = null;

            try
            {
                SqlCommand cmd = new SqlCommand("UseriSelectByEmail", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@email", email);

                SqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    user          = new InternalUser();
                    user.email    = rdr["email"].ToString();
                    user.password = rdr["Passwordi"].ToString();
                    user.id       = (int)rdr["personiid"];
                    user.role     = rdr["Roli"].ToString();
                }
            }
            finally
            {
                con.Close();
            }
            return(user);
        }
示例#6
0
        public void Insert(Punetori p)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("Punetoriinsert", con);

                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@Emri", (p.Emri));
                cmd.Parameters.AddWithValue("@Mbiemri", (p.Mbiemri));
                cmd.Parameters.AddWithValue("@Email", (p.Email));
                cmd.Parameters.AddWithValue("@Gjinia", p.Gjinia);
                cmd.Parameters.AddWithValue("@adresa", p.Adresa);

                cmd.Parameters.AddWithValue("@Departamenti", p.Departamenti);
                cmd.Parameters.AddWithValue("@KrijuarNga", p.KrijuarNga);

                cmd.Parameters.AddWithValue("@IDLeternjoftimi", p.IDLeternjoftimi);
                cmd.Parameters.AddWithValue("@Datlindja", p.Datlindja);

                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
示例#7
0
        public Profesori ProfesoriSelectByEmriAndMbiemri(String Emri, String Mbiemri)
        {
            SqlConnection con       = Generals.GetNewConnection();
            Profesori     profesori = null;

            try
            {
                SqlCommand cmd = new SqlCommand("ProfesoriSelectByEmriAndMbiemri", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@EmriProfes", Emri);
                cmd.Parameters.AddWithValue("@MbiemriProfes", Mbiemri);
                SqlDataReader rdr = cmd.ExecuteReader();

                Profesori p = new Profesori();

                while (rdr.Read())
                {
                    p.PersoniID = (int)rdr["ProfesoriID"];
                }
            }
            finally
            {
                con.Close();
            }
            return(profesori);
        }
示例#8
0
        public Studenti StudentiSelectByID(int id)
        {
            SqlConnection con      = Generals.GetNewConnection();
            Studenti      studenti = null;

            try
            {
                SqlCommand cmd = new SqlCommand("StudentiSelectByID", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@StudentiID", id);

                SqlDataReader rdr = cmd.ExecuteReader();

                SqlCommand cmdpersoni = new SqlCommand("PersoniSelectByID", con);
                cmdpersoni.CommandType = CommandType.StoredProcedure;
                cmdpersoni.Parameters.AddWithValue("@personiID", id);
                SqlDataReader rdrpersoni = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    studenti = new Studenti();
                    string vitiakademik = rdr["VitiAkademik"].ToString();
                    studenti.PersoniID   = (int)rdrpersoni["PersoniID"];
                    studenti.Emri        = rdrpersoni["Emri"].ToString();
                    studenti.Mbiemri     = rdrpersoni["Mbiemri"].ToString();
                    studenti.Email       = rdrpersoni["Email"].ToString();
                    studenti.Mosha       = (int)rdrpersoni["Mosha"];
                    studenti.NrTelefonit = rdrpersoni["NrTelefonit"].ToString();
                    studenti.Gjinia      = (char)rdrpersoni["Gjinia"];
                    if (rdrpersoni["CreatedBy"] != DBNull.Value)
                    {
                        studenti.CreatedBy = (int)rdrpersoni["CreatedBy"];
                    }
                    if (rdrpersoni["CreatedDate"] != DBNull.Value)
                    {
                        studenti.CreatedDate = rdrpersoni["CreatedDate"].ToString();
                    }
                    if (rdrpersoni["ModifiedBy"] != DBNull.Value)
                    {
                        studenti.ModifiedBy = (int)rdrpersoni["ModifiedBy"];
                    }
                    if (rdrpersoni["ModifiedDate"] != DBNull.Value)
                    {
                        studenti.ModifiedDate = rdrpersoni["ModifiedDate"].ToString();
                    }
                }
            }
            finally
            {
                con.Close();
            }
            return(studenti);
        }
示例#9
0
        public Administratori AdministratoriSelectByID(int id)
        {
            SqlConnection  con            = Generals.GetNewConnection();
            Administratori administratori = null;

            try
            {
                SqlCommand cmd = new SqlCommand("AdministratoriSelectByID", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@AdministratoriID", id);

                SqlDataReader rdr = cmd.ExecuteReader();

                SqlCommand cmdpersoni = new SqlCommand("PersoniSelectByID", con);
                cmdpersoni.CommandType = CommandType.StoredProcedure;
                cmdpersoni.Parameters.AddWithValue("@personiID", id);
                SqlDataReader rdrpersoni = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    administratori             = new Administratori();
                    administratori.PersoniID   = (int)rdrpersoni["PersoniID"];
                    administratori.Emri        = rdrpersoni["Emri"].ToString();
                    administratori.Mbiemri     = rdrpersoni["Mbiemri"].ToString();
                    administratori.Email       = rdrpersoni["Email"].ToString();
                    administratori.Mosha       = (int)rdrpersoni["Mosha"];
                    administratori.NrTelefonit = rdrpersoni["NrTelefonit"].ToString();
                    administratori.Aktiv       = (bool)rdrpersoni["Aktiv"];
                    administratori.Mbiemri     = rdrpersoni["Mbiemri"].ToString();
                    if (rdrpersoni["CreatedBy"] != DBNull.Value)
                    {
                        administratori.CreatedBy = (int)rdrpersoni["CreatedBy"];
                    }
                    if (rdrpersoni["CreatedDate"] != DBNull.Value)
                    {
                        administratori.CreatedDate = rdrpersoni["CreatedDate"].ToString();
                    }
                    if (rdrpersoni["ModifiedBy"] != DBNull.Value)
                    {
                        administratori.ModifiedBy = (int)rdrpersoni["ModifiedBy"];
                    }
                    if (rdrpersoni["ModifiedDate"] != DBNull.Value)
                    {
                        administratori.ModifiedDate = rdrpersoni["ModifiedDate"].ToString();
                    }
                }
            }
            finally
            {
                con.Close();
            }
            return(administratori);
        }
示例#10
0
        public List <StudentiKerkesa> GetStudentsByProfesoriIDKursiID(int profesori, int kursi, String emriKursit)
        {
            SqlConnection          con       = Generals.GetNewConnection();
            List <StudentiKerkesa> studentet = new List <StudentiKerkesa>();

            try
            {
                SqlCommand cmd = new SqlCommand("GetStudentsRequestByProfesoriIDKursiID", con);
                cmd.Parameters.AddWithValue("@Profesoriid", profesori);
                cmd.Parameters.AddWithValue("@kursiid", kursi);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    StudentiKerkesa studenti     = new StudentiKerkesa();
                    string          vitiakademik = rdr["VitiAkademik"].ToString();
                    studenti.kerkesaID   = (int)rdr["requestid"];
                    studenti.PersoniID   = (int)rdr["PersoniID"];
                    studenti.Emri        = rdr["Emri"].ToString();
                    studenti.Mbiemri     = rdr["Mbiemri"].ToString();
                    studenti.Email       = rdr["Email"].ToString();
                    studenti.Mosha       = (int)rdr["Mosha"];
                    studenti.NrTelefonit = rdr["NrTelefonit"].ToString();
                    studenti.Gjinia      = (char)rdr["Gjinia"];
                    if (rdr["CreatedBy"] != DBNull.Value)
                    {
                        studenti.CreatedBy = (int)rdr["CreatedBy"];
                    }
                    if (rdr["CreatedDate"] != DBNull.Value)
                    {
                        studenti.CreatedDate = rdr["CreatedDate"].ToString();
                    }
                    if (rdr["ModifiedBy"] != DBNull.Value)
                    {
                        studenti.ModifiedBy = (int)rdr["ModifiedBy"];
                    }
                    if (rdr["ModifiedDate"] != DBNull.Value)
                    {
                        studenti.ModifiedDate = rdr["ModifiedDate"].ToString();
                    }
                    studenti.kursi = emriKursit;
                    studentet.Add(studenti);
                }
            }
            finally
            {
                con.Close();
            }
            return(studentet);
        }
示例#11
0
        public Syllabusi SyllabusiSelectByID(int id)
        {
            SqlConnection con       = Generals.GetNewConnection();
            Syllabusi     syllabusi = null;

            try
            {
                SqlCommand cmd = new SqlCommand("SyllabusiSelectByID", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@syllabusiid", id);

                SqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    syllabusi                  = new Syllabusi();
                    syllabusi.SyllabusiID      = (int)rdr["SyllabusiID"];
                    syllabusi.Kreditet         = (double)rdr["Kreditet"];
                    syllabusi.Pershkrimi       = rdr["Pershkrimi"].ToString();
                    syllabusi.Literatura       = rdr["Literatura"].ToString();
                    syllabusi.MetodaVleresimit = rdr["MetodaVleresimit"].ToString();
                    syllabusi.NumriUshtrimeve  = (int)rdr["NumriUshtrimeve"];
                    syllabusi.NumriLigjeratave = (int)rdr["NumriLigjeratave"];
                    if (rdr["CreatedBy"] != DBNull.Value)
                    {
                        syllabusi.CreatedBy = (int)rdr["CreatedBy"];
                    }
                    if (rdr["CreatedDate"] != DBNull.Value)
                    {
                        syllabusi.CreatedDate = rdr["CreatedDate"].ToString();
                    }
                    if (rdr["ModifiedBy"] != DBNull.Value)
                    {
                        syllabusi.ModifiedBy = (int)rdr["ModifiedBy"];
                    }
                    if (rdr["ModifiedDate"] != DBNull.Value)
                    {
                        syllabusi.ModifiedDate = rdr["ModifiedDate"].ToString();
                    }
                }
            }
            finally
            {
                con.Close();
            }
            return(syllabusi);
        }
示例#12
0
        public void delete(int id)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("PunetoriUpdateOnDelete", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@IDPunetori", IDPunetori);
                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
示例#13
0
        public void denyRequest(int ProfesoriKursiid)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("denyRequestsByAdministratoriOnAll", con);
                cmd.Parameters.AddWithValue("@ProfesoriKursiid", ProfesoriKursiid);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
示例#14
0
        public Useri UseriSelectByID(int id)
        {
            SqlConnection con   = Generals.GetNewConnection();
            Useri         useri = null;

            try
            {
                SqlCommand cmd = new SqlCommand("UseriSelectByID", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@UseriID", id);

                SqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    useri            = new Useri();
                    useri.UseriID    = (int)rdr["UseriID"];
                    useri.Username   = rdr["Username"].ToString();
                    useri.Passwordi  = rdr["Passwordi"].ToString();
                    useri.Prioriteti = (int)rdr["Prioriteti"];
                    useri.PersoniID  = (int)rdr["PersoniID"];
                    if (rdr["CreatedBy"] != DBNull.Value)
                    {
                        useri.CreatedBy = (int)rdr["CreatedBy"];
                    }
                    if (rdr["CreatedDate"] != DBNull.Value)
                    {
                        useri.CreatedDate = rdr["CreatedDate"].ToString();
                    }
                    if (rdr["ModifiedBy"] != DBNull.Value)
                    {
                        useri.ModifiedBy = (int)rdr["ModifiedBy"];
                    }
                    if (rdr["ModifiedDate"] != DBNull.Value)
                    {
                        useri.ModifiedDate = rdr["ModifiedDate"].ToString();
                    }
                }
            }
            finally
            {
                con.Close();
            }
            return(useri);
        }
示例#15
0
        public Kursi KursiSelectByID(int id)
        {
            SqlConnection con   = Generals.GetNewConnection();
            Kursi         kursi = null;

            try
            {
                SqlCommand cmd = new SqlCommand("KursiSelectByID", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@KursiID", id);

                SqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    kursi            = new Kursi();
                    kursi.KursiID    = (int)rdr["KursiID"];
                    kursi.ProgramiID = (int)rdr["ProgramiID"];
                    kursi.Emri       = rdr["Emri"].ToString();
                    kursi.Aktiv      = (bool)rdr["Emri"];
                    if (rdr["CreatedBy"] != DBNull.Value)
                    {
                        kursi.CreatedBy = (int)rdr["CreatedBy"];
                    }
                    if (rdr["CreatedDate"] != DBNull.Value)
                    {
                        kursi.CreatedDate = rdr["CreatedDate"].ToString();
                    }
                    if (rdr["ModifiedBy"] != DBNull.Value)
                    {
                        kursi.ModifiedBy = (int)rdr["ModifiedBy"];
                    }
                    if (rdr["ModifiedDate"] != DBNull.Value)
                    {
                        kursi.ModifiedDate = rdr["ModifiedDate"].ToString();
                    }
                }
            }
            finally
            {
                con.Close();
            }
            return(kursi);
        }
示例#16
0
        public void Aprovo(int idkerkesa)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("requestUpdateByID", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@requestid", idkerkesa);

                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
示例#17
0
        public void denyRequestForStudent(int studentiID, int profesoriKursi)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("denyRequestForStudent", con);
                cmd.Parameters.AddWithValue("@studentiID", studentiID);
                cmd.Parameters.AddWithValue("@profesoriKursi", profesoriKursi);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
示例#18
0
        public Programi ProgramiSelectByID(int id)
        {
            SqlConnection con      = Generals.GetNewConnection();
            Programi      programi = null;

            try
            {
                SqlCommand cmd = new SqlCommand("ProgramiSelectByID", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@ProgramiID", id);

                SqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    programi            = new Programi();
                    programi.ProgramiID = (int)rdr["ProgramiID"];
                    programi.Emri       = rdr["Emri"].ToString();
                    programi.Aktiv      = rdr["Aktiv"].ToString().Equals("1");
                    if (rdr["CreatedBy"] != DBNull.Value)
                    {
                        programi.CreatedBy = (int)rdr["CreatedBy"];
                    }
                    if (rdr["CreatedDate"] != DBNull.Value)
                    {
                        programi.CreatedDate = rdr["CreatedDate"].ToString();
                    }
                    if (rdr["ModifiedBy"] != DBNull.Value)
                    {
                        programi.ModifiedBy = (int)rdr["ModifiedBy"];
                    }
                    if (rdr["ModifiedDate"] != DBNull.Value)
                    {
                        programi.ModifiedDate = rdr["ModifiedDate"].ToString();
                    }
                }
            }
            finally
            {
                con.Close();
            }
            return(programi);
        }
示例#19
0
        public List <Kursi> GetKursetByProfesoriID(int profesori)
        {
            SqlConnection con    = Generals.GetNewConnection();
            List <Kursi>  kurset = new List <Kursi>();

            try
            {
                SqlCommand cmd = new SqlCommand("GetKursiByProfesoriID", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ProfesoriID", profesori);
                SqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    Kursi kursi = new Kursi();
                    kursi.KursiID = (int)rdr["KursiID"];
                    kursi.Emri    = rdr["Emri"].ToString();
                    kursi.Aktiv   = rdr["Aktiv"].ToString().Equals("1");
                    if (rdr["CreatedBy"] != DBNull.Value)
                    {
                        kursi.CreatedBy = (int)rdr["CreatedBy"];
                    }
                    if (rdr["CreatedDate"] != DBNull.Value)
                    {
                        kursi.CreatedDate = rdr["CreatedDate"].ToString();
                    }
                    if (rdr["ModifiedBy"] != DBNull.Value)
                    {
                        kursi.ModifiedBy = (int)rdr["ModifiedBy"];
                    }
                    if (rdr["ModifiedDate"] != DBNull.Value)
                    {
                        kursi.ModifiedDate = rdr["ModifiedDate"].ToString();
                    }
                    kurset.Add(kursi);
                }
            }
            finally
            {
                con.Close();
            }
            return(kurset);
        }
示例#20
0
        public void SelectByID(int ID)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("PunetoriselectByID", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@IDPunetori", ID);
                Punetori      p   = new Punetori();
                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    p.IDPunetori = (int)rdr["IDPunetori"];
                    p.Emri       = ((string)rdr["Emri"]).ToString();
                    p.Mbiemri    = ((string)rdr["Mbiemri"]).ToString();
                    p.Email      = ((string)rdr["Email"]).ToString();
                    p.Gjinia     = ((String)rdr["Gjinia"])[0];

                    if (rdr["KrijuarNga"] != DBNull.Value)
                    {
                        p.KrijuarNga = (int)rdr["KrijuarNga"];
                    }
                    if (rdr["ModifikuarNga"] != DBNull.Value)
                    {
                        p.ModifikuarNga = (int)rdr["ModifikuarNga"];
                    }
                    if (rdr["Departamenti"] != DBNull.Value)
                    {
                        p.Departamenti = (int)rdr["Departamenti"];
                    }
                    p.IDLeternjoftimi = (long)rdr["IDLeternjoftimi"];
                    p.Datlindja       = rdr["Datlindja"].ToString().Split(' ')[0];
                    p.Mosha           = DateTime.Now.Year - Convert.ToInt32(p.Datlindja.Split('/')[0]);
                    p.Adresa          = (int)rdr["Adresa"];
                }
            }
            finally
            {
                con.Close();
            }
        }
示例#21
0
        public void update(Punetori p)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("Punetoriupdate", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@IDPunetori", p.IDPunetori);
                cmd.Parameters.AddWithValue("@Emri", (p.Emri));
                cmd.Parameters.AddWithValue("@Mbiemri", (p.Mbiemri));
                cmd.Parameters.AddWithValue("@Email", (p.Email));
                cmd.Parameters.AddWithValue("@Gjinia", p.Gjinia);
                cmd.Parameters.AddWithValue("@Adresa", p.Adresa);
                cmd.Parameters.AddWithValue("@IDLeternjoftimi", p.IDLeternjoftimi);
                cmd.Parameters.AddWithValue("@ModifikuarNga", p.ModifikuarNga);
                cmd.ExecuteNonQuery();
            }
            finally { con.Close(); }
        }
示例#22
0
        public DataTable GetAllKursetByEmriKursit(String Emri)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("selectProfesoriKursiByEmriKursit", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Emri", Emri);

                SqlDataReader rdr = cmd.ExecuteReader();

                DataTable dt = new DataTable();
                dt.Columns.Add("EmriKursit");
                dt.Columns.Add("EmriProfes");
                dt.Columns.Add("Kreditet");
                dt.Columns.Add("NumriLigjeratave");
                dt.Columns.Add("NumriUshtrimeve");
                dt.Columns.Add("KursiID");

                while (rdr.Read())
                {
                    DataRow dr = dt.NewRow();

                    dr["EmriKursit"]       = rdr["EmriKursit"].ToString();
                    dr["EmriProfes"]       = rdr["Emri"].ToString() + " " + rdr["Mbiemri"].ToString();
                    dr["Kreditet"]         = (int)rdr["Kreditet"];
                    dr["NumriLigjeratave"] = (int)rdr["NumriLigjeratave"];
                    dr["KursiID"]          = (int)rdr["KursiID"];

                    dt.Rows.Add(dr);
                }

                return(dt);
            }
            finally
            {
                con.Close();
            }
        }
示例#23
0
        public DataTable GetRequestsForStudenti(int StudentiID)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("SelectAllRequestsByStudentiID", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@StudentiID", StudentiID);

                SqlDataReader rdr = cmd.ExecuteReader();

                DataTable dt = new DataTable();
                dt.Columns.Add("RequestCreatedDate");
                dt.Columns.Add("EmriProfes");
                dt.Columns.Add("EmriKursit");
                dt.Columns.Add("aprovuarNgaProfesori");
                dt.Columns.Add("aprovuarNgaAdministratori");

                while (rdr.Read())
                {
                    DataRow dr = dt.NewRow();

                    dr["RequestCreatedDate"]        = rdr["RequestCreatedDate"].ToString();
                    dr["EmriProfes"]                = rdr["EmriProfes"].ToString() + " " + rdr["MbiemriProfes"].ToString();
                    dr["EmriKursit"]                = rdr["EmriKursit"].ToString();
                    dr["aprovuarNgaProfesori"]      = rdr["aprovuarNgaProfesori"].ToString();
                    dr["aprovuarNgaAdministratori"] = rdr["aprovuarNgaAdministratori"].ToString();

                    dt.Rows.Add(dr);
                }

                return(dt);
            }
            finally
            {
                con.Close();
            }
        }
示例#24
0
        public List <Request> readAllRequest()
        {
            SqlConnection  con         = Generals.GetNewConnection();
            List <Request> requestlist = new List <Request>();

            try
            {
                SqlCommand cmd = new SqlCommand("readAllRequest", con);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    Request request = new Request();
                    request.requestid                 = (int)rdr["requestid"];
                    request.ProfesoriKursi            = (int)rdr["ProfesoriKursi"];
                    request.studenti                  = (int)rdr["studenti"];
                    request.aprovuarNgaAdministratori = rdr["aprovuarNgaAdministratori"].ToString();
                    request.aprovuarNgaProfesori      = rdr["aprovuarNgaProfesori"].ToString();
                    if (rdr["CreatedBy"] != DBNull.Value)
                    {
                        request.CreatedBy = (int)rdr["CreatedBy"];
                    }
                    if (rdr["CreatedDate"] != DBNull.Value)
                    {
                        request.CreatedDate = rdr["CreatedDate"].ToString();
                    }
                    requestlist.Add(request);
                }
            }
            finally
            {
                con.Close();
            }
            return(requestlist);
        }