Esempio n. 1
0
        public static List <Shkolla> List()
        {
            var LstL = new List <Shkolla>();
            var conn = DBHelper.GetConnection();
            var cmd  = new SqlCommand("usp_Shkolla_GetList", conn);

            cmd.CommandType = System.Data.CommandType.StoredProcedure;

            try
            {
                conn.Open();

                var rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    var shkolla = new Shkolla();
                    shkolla.Emertimi = rdr["Emertimi"].ToString();
                    shkolla.Id       = int.Parse(rdr["Id"].ToString());



                    LstL.Add(shkolla);
                }
                return(LstL);
            }
            catch (Exception e)
            {
                return(null);
            }
            finally
            {
                conn.Close();
            }
        }
Esempio n. 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     Shkolla.regjistroLenden(new Lenda()
     {
         emri = textBox1.Text
     });
 }
Esempio n. 3
0
        public static bool Create(Shkolla shkolla)
        {
            var conn = DBHelper.GetConnection();

            try
            {
                var cmd = new SqlCommand("usp_Shkolla_Insert", conn);
                cmd.CommandType = System.Data.CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@prmEmertimi", shkolla.Emertimi);



                conn.Open();
                cmd.ExecuteNonQuery();

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                conn.Close();
            }
        }
Esempio n. 4
0
        public ActionResult CreateShkolla(Shkolla shkolla)
        {
            if (ModelState.IsValid)
            {
                DAL.DAL_Shkolla.Create(shkolla);
                return(RedirectToAction("ShowShkolla"));
            }

            return(View(shkolla));
        }
Esempio n. 5
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     Shkolla.regjistroNoten(
         int.Parse(textBox1.Text),
         int.Parse(textBox2.Text),
         int.Parse(textBox3.Text),
         int.Parse(textBox4.Text),
         int.Parse(textBox5.Text)
         );
 }
Esempio n. 6
0
 private void button1_Click(object sender, EventArgs e)
 {
     Shkolla.regjistroNxenesin(new Nxenesi()
     {
         emri      = textBox1.Text,
         mbiemri   = textBox2.Text,
         mosha     = int.Parse(textBox3.Text),
         gjinia    = textBox4.Text,
         adresa    = textBox5.Text,
         birthdate = Convert.ToDateTime(textBox6.Text)
     }, int.Parse(textBox7.Text), int.Parse(textBox8.Text));
 }
Esempio n. 7
0
 private void btnShikoStatistikat_Click(object sender, EventArgs e)
 {
     MessageBox.Show(Shkolla.shikoStatistikat());
 }
Esempio n. 8
0
 private void ShfaqMesataren_Load(object sender, EventArgs e)
 {
     richTextBox1.Text = Shkolla.shikoMesataren();
 }