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(); } }
private void button1_Click(object sender, EventArgs e) { Shkolla.regjistroLenden(new Lenda() { emri = textBox1.Text }); }
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(); } }
public ActionResult CreateShkolla(Shkolla shkolla) { if (ModelState.IsValid) { DAL.DAL_Shkolla.Create(shkolla); return(RedirectToAction("ShowShkolla")); } return(View(shkolla)); }
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) ); }
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)); }
private void btnShikoStatistikat_Click(object sender, EventArgs e) { MessageBox.Show(Shkolla.shikoStatistikat()); }
private void ShfaqMesataren_Load(object sender, EventArgs e) { richTextBox1.Text = Shkolla.shikoMesataren(); }