public static int URUNEKLE(ENTITYURUN ent)
 {
     if (ent.Urunad != null && ent.Urunadet > 0 && ent.Urunfiyat > -1)
     {
         DALURUN.URUNEKLE(ent);
     }
     return(-1);
 }
        protected void Unnamed1_Click(object sender, EventArgs e)
        {
            ENTITYURUN ent = new ENTITYURUN();

            ent.Urunad    = TextBox1.Text;
            ent.Urunadet  = Convert.ToInt16(TextBox2.Text);
            ent.Urunfiyat = Convert.ToDecimal(TextBox3.Text);
            BLLURUN.URUNEKLE(ent);
        }
        public static int URUNEKLE(ENTITYURUN ent)
        {
            SqlCommand komut = new SqlCommand("INSERT INTO TBLURUNLER (URUNAD,URUNFIYAT,URUNADET) VALUES (@P1,@P2,@P3)", SQLBAGLANTISI.bgl);

            if (komut.Connection.State != ConnectionState.Open)
            {
                komut.Connection.Open();
            }
            komut.Parameters.AddWithValue("@P1", ent.Urunad);
            komut.Parameters.AddWithValue("@p2", ent.Urunfiyat);
            komut.Parameters.AddWithValue("@P3", ent.Urunadet);

            return(komut.ExecuteNonQuery());
        }
        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 <ENTITYURUN> URUNLISTELE()
        {
            List <ENTITYURUN> degerler = new List <ENTITYURUN>();
            SqlCommand        komut    = new SqlCommand("Select * from TBLURUNLER", SQLBAGLANTISI.bgl);

            if (komut.Connection.State != ConnectionState.Open)
            {
                komut.Connection.Open();
            }
            SqlDataReader dr = komut.ExecuteReader();

            while (dr.Read())
            {
                ENTITYURUN ent = new ENTITYURUN();
                ent.Urunad    = dr["URUNAD"].ToString();
                ent.Urunfiyat = Convert.ToDecimal(dr["URUNFIYAT"]);
                ent.Urunid    = Convert.ToInt32(dr["URUNID"]);
                ent.Urunadet  = Convert.ToInt32(dr["URUNADET"]);
                degerler.Add(ent);
            }
            dr.Close();
            return(degerler);
        }
Example #7
0
 public static int SATISYAP(ENTITYMUSTERI MUS, ENTITYURUN UR, ENTITYPERSONEL PER, ENTITYSATIS SAT)
 {
     return(DALSATIS.SATISYAP(MUS, UR, PER, SAT));
 }