コード例 #1
0
        public IActionResult MarkaDelete(int markaid)
        {
            var entity = _markaService.GetById(markaid);

            if (entity != null)
            {
                _markaService.Delete(entity);
            }
            return(Redirect("/admin/marka/list"));
        }
コード例 #2
0
        public ActionResult MarkaSil(int id)
        {   /*var tablo =(from a in )*/
            bool control = _markaService.Delete(id);

            if (control)
            {
                return(Json("ok", JsonRequestBehavior.AllowGet));
            }
            return(View(_markaService.GetAll()));
        }
コード例 #3
0
        public IActionResult Delete(Marka marka)
        {
            var result = _markaService.Delete(marka);

            if (result.Success)
            {
                return(Ok(result.Message));
            }

            return(BadRequest(result.Message));
        }
コード例 #4
0
ファイル: StokTakip.cs プロジェクト: Pizayn/StokTakip
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (Convert.ToInt32(dgwTakip.CurrentRow.Cells[4].Value) == 1)
                {
                    try
                    {
                        _personalService.Delete(new Personal()
                        {
                            PersonalId = Convert.ToInt32(dgwTakip.CurrentRow.Cells[0].Value)
                        });
                        MessageBox.Show("Personal siliniyor");
                    }
                    catch
                    {
                        MessageBox.Show("Silmek istediğin personelin üzerine tıkladığından emin ol");
                    }

                    try
                    {
                        _kisiService.Delete(new Kisi()
                        {
                            KisiId = Convert.ToInt64(dgwTakip.CurrentRow.Cells[3].Value)
                        });
                        MessageBox.Show("Personal silindi");
                    }
                    catch
                    {
                        MessageBox.Show("Zimmetli Eşyası olan personeli silemezsin");
                    }
                }

                if (Convert.ToInt32(dgwTakip.CurrentRow.Cells[5].Value) == 1 || Convert.ToInt32(dgwTakip.CurrentRow.Cells[5].Value) == 0)
                {
                    try
                    {
                        _urunService.Delete(new Urun()
                        {
                            UrunId = Convert.ToInt32(dgwTakip.CurrentRow.Cells[1].Value)
                        });

                        MessageBox.Show("Ürün siliniyor");
                    }
                    catch
                    {
                        MessageBox.Show("Kullanılan Ürünü silemezsin");
                    }

                    try
                    {
                        _markaService.Delete(new Marka()
                        {
                            MarkaId = Convert.ToInt32(dgwTakip.CurrentRow.Cells[1].Value)
                        });
                        MessageBox.Show("Ürün silindi");
                    }
                    catch
                    {
                        MessageBox.Show("Kullanılan markayı silemezsin");
                    }
                }

                if (Convert.ToInt32(dgwTakip.CurrentRow.Cells[2].Value) == 1 ||
                    Convert.ToInt32(dgwTakip.CurrentRow.Cells[2].Value) == 0)
                {
                    try
                    {
                        _zimmetService.Delete(new Zimmet()
                        {
                            ZimmetId = Convert.ToInt32(dgwTakip.CurrentRow.Cells[0].Value)
                        });
                        MessageBox.Show("Zimmet Silindi");
                    }
                    catch
                    {
                        MessageBox.Show("TestZimmet");
                    }
                }
            }
            catch
            {
            }
        }