Пример #1
0
        public ActionResult UrunEkle(TBL_URUNLER p1)
        {
            var ktg = db.TBL_KATEGORILER.Where(m => m.KATEGORIID == p1.TBL_KATEGORILER.KATEGORIID).FirstOrDefault();

            p1.TBL_KATEGORILER = ktg;
            db.TBL_URUNLER.Add(p1);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult YeniUrun(TBL_URUNLER u1)
        {
            var ktg = db.TBL_KATEGORI.Where(m => m.KATEGORIID == u1.TBL_KATEGORI.KATEGORIID).FirstOrDefault();

            u1.TBL_KATEGORI = ktg;
            db.TBL_URUNLER.Add(u1);
            db.SaveChanges();
            return(RedirectToAction("UrunListele"));
        }
Пример #3
0
        private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            int         id     = int.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID").ToString());
            TBL_URUNLER selrow = ticaridbml.TBL_URUNLERs.First(p => p.ID == id);

            //TBL_URUNLER selrow = gridView1.GetRow(gridView1.FocusedRowHandle) as TBL_URUNLER;
            textE_Ur_Ad.Text      = selrow.URUNAD.ToString();
            textE_Ur_Marka.Text   = selrow.MARKA.ToString();
            textE_Ur_Model.Text   = selrow.MODEL.ToString();
            maskedT_Ur_Yıl.Text   = selrow.YIL.ToString();
            numericU_Ur_Adet.Text = selrow.ADET.ToString();
            textE_Ur_Al.Text      = selrow.ALISFIYAT.ToString();
            textE_Ur_Sat.Text     = selrow.SATISFIYAT.ToString();
            richT_Ur_Detay.Text   = selrow.DETAY.ToString();
        }
Пример #4
0
        public ActionResult Guncelle(TBL_URUNLER p)
        {
            var urun = db.TBL_URUNLER.Find(p.URUNID);

            urun.URUNAD = p.URUNAD;
            urun.MARKA  = p.MARKA;
            urun.STOK   = p.STOK;
            urun.FIYAT  = p.FIYAT;
            //urun.URUNKATEGORI = p.URUNKATEGORI;
            var ktgr = db.TBL_KATEGORILER.Where(m => m.KATEGORIID == p.TBL_KATEGORILER.KATEGORIID).FirstOrDefault();

            urun.URUNKATEGORI = ktgr.KATEGORIID;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #5
0
        public ActionResult Guncelle(TBL_URUNLER p1)
        {
            var urn = db.TBL_URUNLER.Find(p1.URUNID);

            urn.URUNAD = p1.URUNAD;
            //urn.TBL_KATEGORI.KATGORIAD = p1.TBL_KATEGORI.KATGORIAD;
            var ktg = db.TBL_KATEGORI.Where(m => m.KATEGORIID == p1.TBL_KATEGORI.KATEGORIID).FirstOrDefault();

            urn.URUNKATEGORI = ktg.KATEGORIID;
            urn.URUNMARKA    = p1.URUNMARKA;
            urn.FİYAT        = p1.FİYAT;
            urn.STOK         = p1.STOK;
            db.SaveChanges();
            return(RedirectToAction("UrunListele"));
        }
Пример #6
0
        private void simpleB_Ur_Guncel_Click(object sender, EventArgs e)
        {
            int         id    = int.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID").ToString());
            TBL_URUNLER urtbl = ticaridbml.TBL_URUNLERs.First(p => p.ID == id);

            urtbl.URUNAD     = Convert.ToString(textE_Ur_Ad.EditValue);
            urtbl.MARKA      = Convert.ToString(textE_Ur_Marka.EditValue);
            urtbl.MODEL      = Convert.ToString(textE_Ur_Model.EditValue);
            urtbl.YIL        = Convert.ToString(maskedT_Ur_Yıl.Text);
            urtbl.ADET       = Convert.ToInt16(numericU_Ur_Adet.Value);
            urtbl.ALISFIYAT  = Convert.ToDecimal(textE_Ur_Al.Text);
            urtbl.SATISFIYAT = Convert.ToDecimal(textE_Ur_Sat.Text);
            urtbl.DETAY      = Convert.ToString(richT_Ur_Detay.Text);
            ticaridbml.SubmitChanges();
            make_null();
            show_ur();
        }
Пример #7
0
        private void simpleB_Ur_Sil_Click(object sender, EventArgs e)
        {
            List <int> selected_list = new List <int>();

            for (int i = 0; i < gridView1.DataRowCount; i++)
            {
                if (gridView1.IsRowSelected(i))
                {
                    selected_list.Add(i);
                }
            }
            selected_list.Reverse();
            foreach (int i in selected_list)
            {
                int         id     = int.Parse(gridView1.GetListSourceRowCellValue(i, "ID").ToString());
                TBL_URUNLER selrow = ticaridbml.TBL_URUNLERs.First(p => p.ID == id);
                ticaridbml.TBL_URUNLERs.DeleteOnSubmit(selrow);
                ticaridbml.SubmitChanges();
                show_ur();
            }
        }
Пример #8
0
        private void simpleB_Ur_Kaydet_Click(object sender, EventArgs e)
        {
            if (textE_Ur_Ad.EditValue == null)
            {
                make_null();
                XtraMessageBox.Show("Tüm boşlukları doldurunuz", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            TBL_URUNLER urtbl = new TBL_URUNLER();

            urtbl.URUNAD     = Convert.ToString(textE_Ur_Ad.EditValue);
            urtbl.MARKA      = Convert.ToString(textE_Ur_Marka.EditValue);
            urtbl.MODEL      = Convert.ToString(textE_Ur_Model.EditValue);
            urtbl.YIL        = Convert.ToString(maskedT_Ur_Yıl.Text);
            urtbl.ADET       = Convert.ToInt16(numericU_Ur_Adet.Value);
            urtbl.ALISFIYAT  = Convert.ToDecimal(textE_Ur_Al.EditValue);
            urtbl.SATISFIYAT = Convert.ToDecimal(textE_Ur_Sat.EditValue);
            urtbl.DETAY      = Convert.ToString(richT_Ur_Detay.Text);
            ticaridbml.TBL_URUNLERs.InsertOnSubmit(urtbl);
            ticaridbml.SubmitChanges();
            make_null();
            show_ur();
        }