protected void Unnamed1_Click(object sender, EventArgs e) { ENTITYURUN ent = new ENTITYURUN(); ENTITYPERSONEL ent1 = new ENTITYPERSONEL(); ENTITYMUSTERI ent2 = new ENTITYMUSTERI(); ENTITYSATIS ent3 = new ENTITYSATIS(); DropDownList1.DataValueField = "URUNID"; ent.Urunid = Convert.ToInt32(DropDownList1.SelectedIndex); ent1.Personelid = Convert.ToInt32(DropDownList2.SelectedIndex); ent2.Musteriid = Convert.ToInt32(DropDownList3.SelectedIndex); ent3.TUTAR = Convert.ToDecimal(TextBox1.Text); BALSATIS.SATISYAP(ent2, ent, ent1, ent3); }
public static int SATISYAP(ENTITYMUSTERI mus, ENTITYURUN ur, ENTITYPERSONEL per, ENTITYSATIS sat) { SqlCommand komut = new SqlCommand("INSERT INTO TBlSATIS(URUN,PERSONEL,TUTAR,MUSTERI) values(@p1,@p2,@p3,@p4)", SQLBAGLANTISI.bgl); if (komut.Connection.State != ConnectionState.Open) { komut.Connection.Open(); } komut.Parameters.AddWithValue("@p1", mus.Musteriid); komut.Parameters.AddWithValue("@p2", ur.Urunid); komut.Parameters.AddWithValue("@p3", sat.TUTAR); komut.Parameters.AddWithValue("@p4", mus.Musteriid); return(komut.ExecuteNonQuery()); }
public static List <ENTITYMUSTERI> MUSTERILISTESI() { List <ENTITYMUSTERI> DEGERLER = new List <ENTITYMUSTERI>(); SqlCommand komut = new SqlCommand("select * from TBLMUSTERI", SQLBAGLANTISI.bgl); if (komut.Connection.State != ConnectionState.Open) { komut.Connection.Open(); } SqlDataReader dr = komut.ExecuteReader(); while (dr.Read()) { ENTITYMUSTERI ent = new ENTITYMUSTERI(); ent.Musteriad = dr["MUSTERIAD"].ToString(); ent.Musterisoyad = dr["MUSTERISOYAD"].ToString(); DEGERLER.Add(ent); } komut.Connection.Close(); dr.Close(); return(DEGERLER); }
public static int SATISYAP(ENTITYMUSTERI MUS, ENTITYURUN UR, ENTITYPERSONEL PER, ENTITYSATIS SAT) { return(DALSATIS.SATISYAP(MUS, UR, PER, SAT)); }