예제 #1
0
        public void m_StoreDelete(int vrStoreID, string vrStoreName)
        {
            DialogResult vrResult;

            StockTrackingDataContext = new L_StockTrackingERPDataContext();
            vrResult = MessageBox.Show(vrStoreName + " deposunu silmek istiyor musunuz ?", "Silme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (vrResult == DialogResult.Yes)
            {
                var Store_CountControl = from albStoreCount in StockTrackingDataContext.p_StoreStockCountControl(vrStoreID) select albStoreCount.Column1;
                foreach (var storeCount in Store_CountControl)
                {
                    //MessageBox.Show(productCount.ToString());
                    if (storeCount.ToString() == "")
                    {
                        StockTrackingDataContext.p_StoreDelete(vrStoreID);
                        MessageBox.Show("Depo Silindi", "Silme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("İlgili Deponun Stokları Vardır Silinemez", "Silme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            else
            {
                MessageBox.Show("Depo Silme İşlemi İptal Edilmiştir", "Silme", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }