コード例 #1
0
 void initData()
 {
     _mngFac     = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType());
     _mngCatStok = _mngFac.GetStokCategoryManager();
     _mngCatCari = _mngFac.GetCariCategoryManager();
     dataGridView1.AutoGenerateColumns = false;
 }
コード例 #2
0
 public frmYeniCariStokKategori(StokCariCategory stokCari)
 {
     InitializeComponent();
     _mngFac     = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType());
     _mngStkCat  = _mngFac.GetStokCategoryManager();
     _mngCariCat = _mngFac.GetCariCategoryManager();
     _stokCari   = stokCari;
     LoadCategory();
     treeView1.ExpandAll();
 }
コード例 #3
0
        public frmCariRehber()
        {
            _cariKaydet = true;
            InitializeComponent();
            mngFct     = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType());
            mngCari    = mngFct.GetCariManager();
            mngCariCat = mngFct.GetCariCategoryManager();


            LoadCari();
        }
コード例 #4
0
        void InitializeData()
        {
            mngFct     = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType());
            mngCari    = mngFct.GetCariManager();
            mngCariCat = mngFct.GetCariCategoryManager();
            // LoadAllCari();
            IList <Cari> listef = mngCari.GetBySUBE_KODU(UserInfo.Sube.Id);

            filterDataGridView1.grd.DataSource = listef;
            ManagerIl mngIl = new ManagerIl();

            //txtIl.DataSource = () =>
            //  {
            //    try
            //    {
            //      System.Globalization.CultureInfo dil;
            //      dil = new System.Globalization.CultureInfo("tr-TR");

            //      //txtIl.SelectionStart = txtIl.Text.Length;
            //      string str = txtIl.Text.ToUpper(dil);
            //      return mngIl.IlListe(str) ;
            //    }
            //    catch (Exception exc)
            //    {
            //      MessageBox.Show(exc.Message);
            //      LogWrite.Write(exc);
            //    }
            //    return null;
            //  };
            //txtIlce.DataSource = () =>
            //{
            //  try
            //  {
            //    if (string.IsNullOrEmpty(txtIl.Text))
            //      return null;
            //    System.Globalization.CultureInfo dil;
            //    dil = new System.Globalization.CultureInfo("tr-TR");

            //    //txtIl.SelectionStart = txtIl.Text.Length;
            //    string str = txtIl.Text.ToUpper(dil);
            //    int il = mngIl.SehirId(str);
            //    string ilce = txtIlce.Text.ToUpper(dil);
            //    return mngIl.IlceListe(ilce,il);
            //  }
            //  catch (Exception exc)
            //  {
            //    MessageBox.Show(exc.Message);
            //    LogWrite.Write(exc);
            //  }
            //  return null;
            //};
            txtCariKodu.DataSource = () =>
            {
                try {
                    return(mngCari.GetCariKodsBySubeKodu(UserInfo.Sube.Id, txtCariKodu.Text).ToStringList(15, txtCariKodu.Ayirac));
                } catch (Exception exc) {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
                return(null);
            };
            txtCariGrup1.DataSource = () =>
            {
                try {
                    List <string> liste = mngCariCat.GetListRootCategoriesKodAndName(txtCariGrup1.Text).ToStringList(30, "");
                    return(liste);
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
                return(null);
            };
            txtCariGrup2.DataSource = () =>
            {
                try {
                    CariCategory parent = mngCariCat.GetById(txtCariGrup1.Text, false);
                    if (parent == null)
                    {
                        return(null);
                    }
                    else
                    {
                        List <string> liste = mngCariCat.GetListParentSubCategoryKodAndName(parent.Id, txtCariGrup2.Text).ToStringList(30, "");
                        return(liste);
                    }
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
                return(null);
            };
            txtCariGrup3.DataSource = () =>
            {
                try {
                    CariCategory parent = mngCariCat.GetById(txtCariGrup2.Text, false);
                    if (parent == null)
                    {
                        return(null);
                    }
                    else
                    {
                        List <string> liste = mngCariCat.GetListParentSubCategoryKodAndName(parent.Id, txtCariGrup3.Text).ToStringList(30, "");
                        return(liste);
                    }
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
                return(null);
            };
            txtCariGrup4.DataSource = () =>
            {
                try {
                    CariCategory parent = mngCariCat.GetById(txtCariGrup3.Text, false);
                    if (parent == null)
                    {
                        return(null);
                    }
                    else
                    {
                        List <string> liste = mngCariCat.GetListParentSubCategoryKodAndName(parent.Id, txtCariGrup4.Text).ToStringList(30, "");
                        return(liste);
                    }
                } catch (Exception exc) {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
                return(null);
            };
        }