コード例 #1
0
ファイル: Drzave.cs プロジェクト: maricdev/InvoicingSoftware
 private void gridView_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     try
     {
         if (gridView.IsNewItemRow(e.RowHandle) == false) //IZMENA
         {
             using (var con = new MONTESINOEntities())
             {
                 var red   = gridView.GetFocusedDataRow();
                 var ps_id = Convert.ToInt32(red["Drzava_ID"]);
                 var ps    = con.Drzavas.SingleOrDefault(x => x.Drzava_ID == ps_id);
                 ps.Naziv = red["Naziv"].ToString().Trim();
                 con.SaveChanges();
             }
         }
     }
     catch (DbUpdateException ex)
     {
         if (ex.InnerException != null)
         {
             if (ex.InnerException.ToString().Contains("The DELETE statement conflicted with the REFERENCE constraint"))
             {
                 MessageBox.Show("Došlo je do greške prilikom brisanja. \nNije moguće obrsati elemnt koji se već koristi u drugoj tabeli.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
             else
             {
                 MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.InnerException.ToString().Trim().Substring(0, Math.Min(ex.InnerException.ToString().Trim().Length, 350)) + "\"");
             }
         }
     }
     catch (Exception ex)
     {
         MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.Message.ToString().Trim().Substring(0, Math.Min(ex.Message.ToString().Trim().Length, 350)) + "\"");
     }
 }
コード例 #2
0
ファイル: JM.cs プロジェクト: maricdev/InvoicingSoftware
        private void gridView_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;

                var     Kod     = gridView.GetFocusedRowCellValue("Kod").ToString().Trim();
                var     Naziv   = gridView.GetFocusedRowCellValue("Naziv").ToString().Trim();
                Boolean napravi = true;

                if (Kod == "" || Kod.Length > 3)
                {
                    e.Valid = false;
                    view.SetColumnError(gridView.Columns["Kod"], "[MAX: 3 KARAKTERA]: Polje ne sme biti prazno!");
                    napravi = false;
                }
                if (Naziv == "" || Naziv.Length > 255)
                {
                    e.Valid = false;
                    view.SetColumnError(gridView.Columns["Naziv"], "[MAX: 255 KARAKTERA]: Polje ne sme biti prazno!");
                    napravi = false;
                }

                if (gridView.IsNewItemRow(e.RowHandle) && napravi == true) //DODAVANJE
                {
                    var red = gridView.GetDataRow(e.RowHandle);

                    using (var con = new MONTESINOEntities())
                    {
                        var jm = new Model.JM()
                        {
                            Kod   = red["Kod"].ToString().Trim(),
                            Naziv = red["Naziv"].ToString().Trim(),
                        };
                        con.JMs.Add(jm);
                        con.SaveChanges();
                        red["JM_ID"] = jm.JM_ID;
                    }
                }
            }
            catch (DbUpdateException ex)
            {
                if (ex.InnerException != null)
                {
                    if (ex.InnerException.ToString().Contains("The DELETE statement conflicted with the REFERENCE constraint"))
                    {
                        MessageBox.Show("Došlo je do greške prilikom brisanja. \nNije moguće obrsati elemnt koji se već koristi u drugoj tabeli.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.InnerException.ToString().Trim().Substring(0, Math.Min(ex.InnerException.ToString().Trim().Length, 350)) + "\"");
                    }
                }
            }
            catch (Exception ex)
            {
                MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.Message.ToString().Trim().Substring(0, Math.Min(ex.Message.ToString().Trim().Length, 350)) + "\"");
            }
        }
コード例 #3
0
        private void BrisanjeSubjekta() // FUNKCIJA ZA BRISANJE SUBJEKTA
        {
            try
            {
                if (gridView.SelectedRowsCount > 0)
                {
                    var Subjekat_ID = gridView.GetFocusedRowCellValue("Subjekat_ID");
                    var Naziv2      = gridView.GetFocusedRowCellValue("Naziv2");

                    if (Subjekat_ID != null)
                    {
                        DialogResult dialogResult = MessageBox.Show("Da li ste sigurni da želite obrisati \"" + Naziv2 + "\" iz šifarnika subjekata?", "Potvrda", MessageBoxButtons.YesNo);
                        if (dialogResult == DialogResult.Yes)
                        {
                            using (var con = new MONTESINOEntities())
                            {
                                con.Subjekats.RemoveRange(con.Subjekats.Where(x => x.Subjekat_ID.ToString() == Subjekat_ID.ToString()));
                                con.SaveChanges();
                                ucitajTabelu();
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Morate prvo da izaberete subjekta iz tabele!", "Upozorenje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            catch (DbUpdateException ex)
            {
                if (ex.InnerException != null)
                {
                    if (ex.InnerException.ToString().Contains("The DELETE statement conflicted with the REFERENCE constraint"))
                    {
                        MessageBox.Show("Došlo je do greške prilikom brisanja. \nNije moguće obrsati elemnt koji se već koristi u drugoj tabeli.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.InnerException.ToString().Trim().Substring(0, Math.Min(ex.InnerException.ToString().Trim().Length, 350)) + "\"");
                    }
                }
            }
            catch (Exception ex)
            {
                MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.Message.ToString().Trim().Substring(0, Math.Min(ex.Message.ToString().Trim().Length, 350)) + "\"");
            }
        }
コード例 #4
0
 private void gridView_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         var red = gridView.GetFocusedDataRow();
         if (e.KeyCode == Keys.Delete && e.Modifiers == Keys.Control && red != null)
         {
             if (MessageBox.Show("Da li ste sigurni da želite obrisati izabrani red?", "Potvrda", MessageBoxButtons.YesNo) !=
                 DialogResult.Yes)
             {
                 return;
             }
             using (var con = new MONTESINOEntities())
             {
                 var jm_id = Convert.ToInt32(red["Status_ID"]);
                 con.Status.RemoveRange(con.Status.Where(x => x.Status_ID == jm_id));
                 con.SaveChanges();
                 GridView view = sender as GridView;
                 view.DeleteRow(view.FocusedRowHandle);
             }
         }
     }
     catch (DbUpdateException ex)
     {
         if (ex.InnerException != null)
         {
             if (ex.InnerException.ToString().Contains("The DELETE statement conflicted with the REFERENCE constraint"))
             {
                 MessageBox.Show("Došlo je do greške prilikom brisanja. \nNije moguće obrsati elemnt koji se već koristi u drugoj tabeli.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             }
             else
             {
                 MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.InnerException.ToString().Trim().Substring(0, Math.Min(ex.InnerException.ToString().Trim().Length, 350)) + "\"");
             }
         }
     }
     catch (Exception ex)
     {
         MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.Message.ToString().Trim().Substring(0, Math.Min(ex.Message.ToString().Trim().Length, 350)) + "\"");
     }
 }
コード例 #5
0
ファイル: Firma.cs プロジェクト: maricdev/InvoicingSoftware
        private void btnPotvrdi_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmbSubjekat.Text.Trim() != cmbSubjekat.Properties.NullText.Trim() && cmbSubjekat.Text.Trim() != "" && cmbValuta.Text.Trim() != cmbValuta.Properties.NullText.Trim() && cmbValuta.Text.Trim() != "" && cmbOdgovornaOsoba.Text.Trim() != cmbOdgovornaOsoba.Properties.NullText.Trim() && cmbOdgovornaOsoba.Text.Trim() != "")
                {
                    DataRowView rowViewSubjekat        = (DataRowView)cmbSubjekat.GetSelectedDataRow();
                    DataRowView rowViewValuta          = (DataRowView)cmbValuta.GetSelectedDataRow();
                    DataRowView rowViewOdgovornaOsoba  = (DataRowView)cmbOdgovornaOsoba.GetSelectedDataRow();
                    DataRowView rowViewStatusPredracun = (DataRowView)cmbStatusPredracun.GetSelectedDataRow();
                    DataRowView rowViewStatusRacun     = (DataRowView)cmbStatusRacun.GetSelectedDataRow();
                    DataRow     redSubjekat            = rowViewSubjekat.Row;
                    DataRow     redValuta          = rowViewValuta.Row;
                    DataRow     redOdgovornaOsoba  = rowViewOdgovornaOsoba.Row;
                    DataRow     redStatusPredracun = rowViewStatusPredracun.Row;
                    DataRow     redStatusRacun     = rowViewStatusRacun.Row;

                    if (MainForm.getData.GetTablePodesavanja().Rows.Count > 0) // IZMENI PODESAVANJA
                    {
                        using (var con = new MONTESINOEntities())
                        {
                            var temp = con.Podesavanjes.First();
                            temp.Subjekat_ID        = Convert.ToInt32(redSubjekat["Subjekat_ID"]);
                            temp.Valuta_ID          = Convert.ToInt32(redValuta["Valuta_ID"]);
                            temp.OdgovorneOsobe_ID  = Convert.ToInt32(redOdgovornaOsoba["OdgovorneOsobe_ID"]);
                            temp.StatusPredracun_ID = Convert.ToInt32(redStatusPredracun["Status_ID"]);
                            temp.StatusRacun_ID     = Convert.ToInt32(redStatusRacun["Status_ID"]);
                            temp.RokVazenja         = Convert.ToInt16(txtRokVazenja.Text.Trim());
                            con.SaveChanges();
                            this.Close();
                        }
                    }
                    else // NAPRAVI PODESAVANJA
                    {
                        using (var con = new MONTESINOEntities())
                        {
                            var novaPod = new Podesavanje()
                            {
                                Subjekat_ID       = Convert.ToInt32(redSubjekat["Subjekat_ID"]),
                                Valuta_ID         = Convert.ToInt32(redValuta["Valuta_ID"]),
                                OdgovorneOsobe_ID = Convert.ToInt32(redOdgovornaOsoba["OdgovorneOsobe_ID"]),
                                RokVazenja        = Convert.ToInt16(txtRokVazenja.Text.Trim())
                            };
                            con.Podesavanjes.Add(novaPod);
                            con.SaveChanges();
                            this.Close();
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Morate popuniti sva polja!", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (DbUpdateException ex)
            {
                if (ex.InnerException != null)
                {
                    if (ex.InnerException.ToString().Contains("The DELETE statement conflicted with the REFERENCE constraint"))
                    {
                        MessageBox.Show("Došlo je do greške prilikom brisanja. \nNije moguće obrsati elemnt koji se već koristi u drugoj tabeli.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.InnerException.ToString().Trim().Substring(0, Math.Min(ex.InnerException.ToString().Trim().Length, 350)) + "\"");
                    }
                }
            }
            catch (Exception ex)
            {
                MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.Message.ToString().Trim().Substring(0, Math.Min(ex.Message.ToString().Trim().Length, 350)) + "\"");
            }
        }
コード例 #6
0
        private void gridView_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e)
        {
            try
            {
                GridView view = sender as GridView;

                var     Naziv       = gridView.GetFocusedRowCellValue("Naziv").ToString().Trim();
                var     Status_ID   = gridView.GetFocusedRowCellValue("Status_ID").ToString().Trim();
                var     jePredracun = gridView.GetFocusedRowCellValue("jePredracun").ToString().Trim();
                var     jeRacun     = gridView.GetFocusedRowCellValue("jeRacun").ToString().Trim();
                Boolean napravi     = true;

                if (Naziv == "" || Naziv.Length > 255)
                {
                    e.Valid = false;
                    view.SetColumnError(gridView.Columns["Naziv"], "[MAX: 255 KARAKTERA]: Polje ne sme biti prazno!");
                    napravi = false;
                }

                if (MainForm.getData.GetTablePodesavanja().Rows.Count > 0)
                {
                    DataRow sub = MainForm.getData.GetTablePodesavanja().Rows[0];
                    Boolean aktivanPredracun = false;
                    Boolean aktivanRacun     = false;
                    if (Status_ID.ToString().Trim() == sub["StatusPredracun_ID"].ToString().Trim())
                    {
                        aktivanPredracun = true;
                    }
                    if (Status_ID.ToString().Trim() == sub["StatusRacun_ID"].ToString().Trim())
                    {
                        aktivanRacun = true;
                    }

                    if (jePredracun.ToString().Trim() == "0" && aktivanPredracun == true)
                    {
                        e.Valid = false;
                        view.SetColumnError(gridView.Columns["jePredracun"], "Status mora biti aktivan jer je postavljen kao podrazumevana vrednost. \n Ukoliko želite da promenite stanje trenutnog statusa, morate prvo promeniti podrazumevanu vrednost u podacima firme.");
                        napravi = false;
                    }
                    if (jeRacun.ToString().Trim() == "0" && aktivanRacun == true)
                    {
                        e.Valid = false;
                        view.SetColumnError(gridView.Columns["jeRacun"], "Status mora biti aktivan jer je postavljen kao podrazumevana vrednost. \n Ukoliko želite da promenite stanje trenutnog statusa, morate prvo promeniti podrazumevanu vrednost u podacima firme.");
                        napravi = false;
                    }
                }

                if (gridView.IsNewItemRow(e.RowHandle) && napravi == true) //DODAVANJE
                {
                    var red = gridView.GetDataRow(e.RowHandle);

                    if (red["jePredracun"].ToString().Trim() == "")
                    {
                        red["jePredracun"] = "0";
                    }
                    if (red["jeRacun"].ToString().Trim() == "")
                    {
                        red["jeRacun"] = "0";
                    }

                    using (var con = new MONTESINOEntities())
                    {
                        var jm = new Model.Status()
                        {
                            Naziv       = red["Naziv"].ToString().Trim(),
                            jePredracun = red["jePredracun"].ToString().Trim(),
                            jeRacun     = red["jePredracun"].ToString().Trim()
                        };
                        con.Status.Add(jm);
                        con.SaveChanges();
                        red["Status_ID"] = jm.Status_ID;
                    }
                }
            }
            catch (DbUpdateException ex)
            {
                if (ex.InnerException != null)
                {
                    if (ex.InnerException.ToString().Contains("The DELETE statement conflicted with the REFERENCE constraint"))
                    {
                        MessageBox.Show("Došlo je do greške prilikom brisanja. \nNije moguće obrsati elemnt koji se već koristi u drugoj tabeli.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.InnerException.ToString().Trim().Substring(0, Math.Min(ex.InnerException.ToString().Trim().Length, 350)) + "\"");
                    }
                }
            }
            catch (Exception ex)
            {
                MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.Message.ToString().Trim().Substring(0, Math.Min(ex.Message.ToString().Trim().Length, 350)) + "\"");
            }
        }
コード例 #7
0
        private void NapraviArtikal()
        {
            try
            {
                //PROVERA DA LI SU SVA POLJA POPUNJENA
                if (txtNaziv.Text.Trim() != "" && txtSifra.Text.Trim() != "" && txtCena.Text.Trim() != "" && cmbPS.Text.Trim() != cmbPS.Properties.NullText.Trim() && cmbJM.Text.Trim() != cmbJM.Properties.NullText.Trim() && cmbPS.Text.Trim() != "" && cmbJM.Text.Trim() != "")
                {
                    //OVDE POCINJE UPISIVANJE KORSNIKA
                    using (var con = new MONTESINOEntities())
                    {
                        var sifra = con.Artikals.SingleOrDefault(x => x.Sifra.ToString().Trim() == txtSifra.Text.Trim());

                        if (sifra == null)
                        {
                            DataRowView rowView1 = (DataRowView)cmbPS.GetSelectedDataRow();
                            DataRow     redPS    = rowView1.Row;
                            DataRowView rowView2 = (DataRowView)cmbJM.GetSelectedDataRow();
                            DataRow     redJM    = rowView2.Row;

                            var noviArt = new Artikal()
                            {
                                Sifra   = txtSifra.Text.Trim(),
                                Naziv   = txtNaziv.Text.Trim(),
                                Opis    = txtOpis.Text.Trim(),
                                Cena    = Convert.ToDecimal(txtCena.Text.Trim()),
                                PS_ID   = Convert.ToInt32(redPS["PS_ID"].ToString().Trim()),
                                JM_ID   = Convert.ToInt32(redJM["JM_ID"].ToString().Trim()),
                                Vrsta   = (rbArtikal.Checked ? "A" : "U").Trim(),
                                Aktivan = (checkAktivan.Checked ? "1" : "0").Trim()
                            };
                            con.Artikals.Add(noviArt);
                            con.SaveChanges();
                            this.DialogResult = DialogResult.OK;
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show("Ident sa unetom šifrom " + sifra.Naziv + " već postoji!", "Upozorenje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Morate popuniti sva polja sa zvezdicom!", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (DbUpdateException ex)
            {
                if (ex.InnerException != null)
                {
                    if (ex.InnerException.ToString().Contains("The DELETE statement conflicted with the REFERENCE constraint"))
                    {
                        MessageBox.Show("Došlo je do greške prilikom brisanja. \nNije moguće obrsati elemnt koji se već koristi u drugoj tabeli.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.InnerException.ToString().Trim().Substring(0, Math.Min(ex.InnerException.ToString().Trim().Length, 350)) + "\"");
                    }
                }
            }
            catch (Exception ex)
            {
                MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.Message.ToString().Trim().Substring(0, Math.Min(ex.Message.ToString().Trim().Length, 350)) + "\"");
            }
        }
コード例 #8
0
        private void IzmeniSubjekta()
        {
            try
            {
                //PROVERA DA LI SU SVA POLJA POPUNJENA
                if (txtNaziv.Text.Trim() != "" && txtPunNaziv.Text.Trim() != "" && txtOIB.Text.Trim() != "" && txtAdresa.Text.Trim() != "" && txtTelefon.Text.Trim() != "" && txtEmail.Text.Trim() != "" && cmbDrzava.Text.Trim() != cmbDrzava.Properties.NullText.Trim() && cmbPosta.Text.Trim() != cmbPosta.Properties.NullText.Trim() && cmbDrzava.Text.Trim() != "" && cmbPosta.Text.Trim() != "")
                {
                    if (txtOIB.Text.Trim().Length == 11)
                    {
                        //OVDE POCINJE UPISIVANJE KORSNIKA
                        using (var con = new MONTESINOEntities())
                        {
                            //PROVERA PRILIKOM MENJANJA OIB-A, DA LI KORISNIK SA DRUGIM SUBJEKAT_ID-OM IMA ISTI OIB
                            var provera = con.Subjekats.SingleOrDefault(x => x.Subjekat_ID.ToString().Trim() != sub.Subjekat_ID.ToString().Trim() && x.OIB.ToString().Trim() == txtOIB.Text.Trim());

                            if (provera == null)
                            {
                                DataRowView rowView1  = (DataRowView)cmbDrzava.GetSelectedDataRow();
                                DataRow     redDrzava = rowView1.Row;
                                DataRowView rowView2  = (DataRowView)cmbPosta.GetSelectedDataRow();
                                DataRow     redPosta  = rowView2.Row;

                                var oib = con.Subjekats.SingleOrDefault(b => b.Subjekat_ID.ToString().Trim() == sub.Subjekat_ID.ToString().Trim());

                                oib.Naziv       = txtNaziv.Text.Trim();
                                oib.Naziv2      = txtPunNaziv.Text.Trim();
                                oib.jeKupac     = (checkKupac.Checked ? "1" : "0").Trim();
                                oib.jeDobavljac = (checkDobavljac.Checked ? "1" : "0").Trim();
                                oib.OIB         = txtOIB.Text.Trim().Trim();
                                oib.Adresa      = txtAdresa.Text.Trim();
                                oib.Posta_ID    = Convert.ToInt32(redPosta["Posta_ID"].ToString().Trim());
                                oib.Telefon     = txtTelefon.Text.Trim();
                                oib.Email       = txtEmail.Text.Trim();
                                oib.Drzava_ID   = Convert.ToInt32(redPosta["Drzava_ID"].ToString().Trim());
                                con.SaveChanges();
                                this.DialogResult = DialogResult.OK;
                                this.Close();
                            }
                            else
                            {
                                MessageBox.Show("Subjekat " + provera.Naziv2 + " ima isti OIB!", "Upozorenje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("OIB mora da ima tačno 11 karaktera!", "Upozorenje", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    MessageBox.Show("Morate popuniti sva polja!", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (DbUpdateException ex)
            {
                if (ex.InnerException != null)
                {
                    if (ex.InnerException.ToString().Contains("The DELETE statement conflicted with the REFERENCE constraint"))
                    {
                        MessageBox.Show("Došlo je do greške prilikom brisanja. \nNije moguće obrsati elemnt koji se već koristi u drugoj tabeli.", "Greška", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else
                    {
                        MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.InnerException.ToString().Trim().Substring(0, Math.Min(ex.InnerException.ToString().Trim().Length, 350)) + "\"");
                    }
                }
            }
            catch (Exception ex)
            {
                MainForm.logger.Error("Naziv klase: " + this.GetType().Name + "\n Funkcija: " + System.Reflection.MethodBase.GetCurrentMethod().Name + "\n\"" + ex.Message.ToString().Trim().Substring(0, Math.Min(ex.Message.ToString().Trim().Length, 350)) + "\"");
            }
        }