Exemplo n.º 1
0
 void formuYenileButton_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         Commons.Loading(this.ActiveMdiChild.Text + " ekranındaki bilgiler güncelleniyor. ..");
         if (this.ActiveMdiChild is xFrmUrunRapor)
         {
             xFrmUrunRapor frm = this.ActiveMdiChild as xFrmUrunRapor;
             frm.GetUrunRapor();
         }
         else if (this.ActiveMdiChild is xFrmStok)
         {
             xFrmStok frm = this.ActiveMdiChild as xFrmStok;
             frm.GetKategoriler();
             frm.GetUrunler();
             frm.GetFirmalar();
             frm.GetData();
         }
         else if (this.ActiveMdiChild is xFrmTeklif)
         {
             xFrmTeklif frm = this.ActiveMdiChild as xFrmTeklif;
             frm.GetDefault();
             frm.GetStokListe();
             frm.GetTeklif();
         }
         else if (this.ActiveMdiChild is xFrmTeklifDetay)
         {
             xFrmTeklifDetay frm = this.ActiveMdiChild as xFrmTeklifDetay;
             frm.GetTeklifler();
         }
         else if (this.ActiveMdiChild is xFrmUrun)
         {
             xFrmUrun frm = this.ActiveMdiChild as xFrmUrun;
             frm.GetKategoriler();
             frm.GetData();
         }
         else if (this.ActiveMdiChild is xFrmKategori)
         {
             xFrmKategori frm = this.ActiveMdiChild as xFrmKategori;
             frm.GetData();
         }
         else if (this.ActiveMdiChild is xFrmFirma)
         {
             xFrmFirma frm = this.ActiveMdiChild as xFrmFirma;
             frm.GetData();
         }
         else if (this.ActiveMdiChild is xFrmDoviz)
         {
             xFrmDoviz frm = this.ActiveMdiChild as xFrmDoviz;
             frm.GetData();
         }
     }
     catch (Exception ex)
     {
         Commons.Status(Commons.GetErrorCode("FMN", 6) + ex.Message);
     }
     finally
     {
         Commons.Status(this.ActiveMdiChild.Text + " ekranındaki bilgiler güncellendi!");
         Commons.Loaded();
     }
 }
Exemplo n.º 2
0
        internal static void Update(TableNames table)
        {
            try
            {
                xFrmStok            stokForm      = System.Windows.Forms.Application.OpenForms["xFrmStok"] as xFrmStok;
                xFrmHizliStokGirisi stokFormHizli = System.Windows.Forms.Application.OpenForms["xFrmHizliStokGirisi"] as xFrmHizliStokGirisi;
                switch (table)
                {
                case TableNames.Kategori:
                    if (stokForm != null)
                    {
                        stokForm.GetKategoriler();
                    }
                    if (stokFormHizli != null)
                    {
                        stokFormHizli.GetKategoriler();
                    }
                    xFrmUrun urunForm = System.Windows.Forms.Application.OpenForms["xFrmUrun"] as xFrmUrun;
                    if (urunForm != null)
                    {
                        urunForm.GetKategoriler();
                    }
                    foreach (System.Windows.Forms.Form item in System.Windows.Forms.Application.OpenForms)
                    {
                        if (item is xFrmTeklif)
                        {
                            xFrmTeklif teklifForm = item as xFrmTeklif;
                            teklifForm.GetKategoriler();
                        }
                    }
                    break;

                case TableNames.Urun:
                    if (stokForm != null)
                    {
                        stokForm.GetUrunler();
                        stokForm.GetUrunlerForKategori();
                    }
                    if (stokFormHizli != null)
                    {
                        stokFormHizli.GetUrunlerForKategori();
                    }
                    break;

                case TableNames.Firma:
                    if (stokForm != null)
                    {
                        stokForm.GetFirmalar();
                    }
                    if (stokFormHizli != null)
                    {
                        stokFormHizli.GetFirmalar();
                    }
                    break;

                case TableNames.Stok:
                    xFrmUrunRapor urunRaporForm = System.Windows.Forms.Application.OpenForms["xFrmUrunRapor"] as xFrmUrunRapor;
                    if (urunRaporForm != null)
                    {
                        urunRaporForm.GetUrunRapor();
                    }
                    foreach (System.Windows.Forms.Form item in System.Windows.Forms.Application.OpenForms)
                    {
                        if (item is xFrmTeklif)
                        {
                            xFrmTeklif teklifForm = item as xFrmTeklif;
                            teklifForm.GetStokListe();
                        }
                    }
                    break;

                case TableNames.Teklif:
                    xFrmTeklifDetay teklifDetayForm = System.Windows.Forms.Application.OpenForms["xFrmTeklifDetay"] as xFrmTeklifDetay;
                    if (teklifDetayForm != null)
                    {
                        teklifDetayForm.GetTeklifler();
                    }
                    break;

                case TableNames.Doviz:
                    foreach (System.Windows.Forms.Form item in System.Windows.Forms.Application.OpenForms)
                    {
                        if (item is xFrmTeklif)
                        {
                            xFrmTeklif teklifForm = item as xFrmTeklif;
                            teklifForm.GetDoviz();
                        }
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Commons.Status(Commons.GetErrorCode("CMN", 19) + ex.Message);
            }
        }