Exemplo n.º 1
0
        public List <Stok> EnvanterRapor()
        {
            List <Stok> liste = new List <Stok>();

            string sql = @"select a*, s.Adet, s.No from tblStok s
                        inner join tblAyakkabi a 
                        on s.AyakkabiId = a.Id 
                        inner join tblMarkalar m 
                        on m.Id = a.MarkaId
                        order by AyakkabiId, No";

            DataTable dtbl = DataHelper.TabloGetir(sql);

            foreach (DataRow item in dtbl.Rows)
            {
                Stok s = new Stok();

                s.Adet       = (int)item["Adet"];
                s.AyakkabiId = (int)item["AyakkabiId"];
                s.No         = (byte)item["No"];
                s.Id         = (int)item["Id"];
                s.Model      = item["Model"].ToString();

                liste.Add(s);
            }

            return(liste);
        }
Exemplo n.º 2
0
        public List <Ayakkabi> MarkayaGoreGetir(int markaId)
        {
            string sql = "select * from tblAyakkabi where MarkaId = " + markaId;
            //SqlParameter p1 = new SqlParameter("id", markaId);

            List <Ayakkabi> liste = new List <Ayakkabi>();

            DataTable dtbl = DataHelper.TabloGetir(sql);

            foreach (DataRow item in dtbl.Rows)
            {
                Ayakkabi a = new Ayakkabi();
                a.Id       = (int)item["Id"];
                a.MarkaId  = (int)item["MarkaId"];
                a.Model    = item["Model"].ToString();
                a.Cinsiyet = (Cinsiyet)item["Cinsiyet"];
                a.Cins     = (Cins)item["Cins"];

                //a.Marka = new Marka();
                //a.Marka.Id = (int)item["MarkaId"];
                //a.Marka.MarkaAdi = item["MarkaAdi"].ToString();

                liste.Add(a);
            }
            return(liste);
        }
Exemplo n.º 3
0
        public List <Ayakkabi> TumAtakkabilar()
        {
            List <Ayakkabi> liste = new List <Ayakkabi>();

            DataTable dtbl = DataHelper.TabloGetir(@"
                select a.*, m.MarkaAdi 
                from tblAyakkabi as a 
                inner join tblMarka as m on m.Id = a.MarkaId");

            foreach (DataRow item in dtbl.Rows)
            {
                Ayakkabi a = new Ayakkabi();
                a.Id       = (int)item["Id"];
                a.MarkaId  = (int)item["MarkaId"];
                a.Model    = item["Model"].ToString();
                a.Cinsiyet = (Cinsiyet)item["Cinsiyet"];
                a.Cins     = (Cins)item["Cins"];

                a.Marka          = new Marka();
                a.Marka.Id       = (int)item["MarkaId"];
                a.Marka.MarkaAdi = item["MarkaAdi"].ToString();

                liste.Add(a);
            }
            return(liste);
        }
Exemplo n.º 4
0
        public List <Marka> TumMarkalar()
        {
            DataTable dtbl = DataHelper.TabloGetir("select * from tblMarka");

            List <Marka> liste = new List <Marka>();

            foreach (DataRow item in dtbl.Rows)//DataRow yazdık ki indexleme yapılabilsin
            {
                Marka m = new Marka();
                m.Id       = (int)item["Id"];
                m.MarkaAdi = item["MarkaAdi"].ToString();
                liste.Add(m);
            }
            return(liste);
        }
Exemplo n.º 5
0
        public bool MarkaEkle(Marka yeni, out int id) //ilk değeri olmayan ve gelen değeri istediğimiz de out diyoruz
        {
            string       sql = "insert into tblMarka(MarkaAdi) values(@markaAdi)";
            SqlParameter p1  = new SqlParameter("markaAdi", yeni.MarkaAdi);

            bool result = DataHelper.KomutCalistir(sql, p1);

            if (result)
            {
                //string sql2 = "select Scope_Identity()"; //aynı
                /*string sql2 = "select @@Identity"*/;
                string    sql2 = "select max(Id) from tblMarka";
                DataTable dtbl = DataHelper.TabloGetir(sql2);
                id = (int)dtbl.Rows[0][0];
            }
            else
            {
                id = -1;
            }
            return(result);
        }
Exemplo n.º 6
0
        public List <Stok> EnvanterRapor()
        {
            //@ gormezden geiyor alt gecince
            List <Stok> liste = new List <Stok>();
            string      sql   = @"Select s.*,a.Model,m.MarkaAdi from tblStok s inner join
tblAyakkabi a on s.AyakkabiId=a.Id inner join tblMarkalar m on a.MarkaId=m.MarkaId Order by AyakkabiId,No";

            DataTable dt = DataHelper.TabloGetir(sql);

            foreach (DataRow item in dt.Rows)
            {
                Stok s = new Stok();
                s.Adet       = (int)item["Adet"];
                s.AyakkabiId = (int)item["AyakkabiId"];
                s.No         = (byte)item["No"];
                s.Id         = (int)item["Id"];
                s.Model      = item["Model"].ToString();
                s.MarkaAdi   = item["MarkaAdi"].ToString();
                liste.Add(s);
            }
            return(liste);
        }