Пример #1
0
        private void frmStokSearch_Load(object sender, EventArgs e)
        {
            _stokKaydet  = true;
            managerFctry = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType());
            managerStk   = managerFctry.GetStokManager();
            mngStokCat   = managerFctry.GetStokCategoryManager();
            _mngStokHar  = managerFctry.GetStokHareketManager();
            mngKur       = managerFctry.GetKurManager();
            LoadStok();
            Form frm = this.Owner;

            if (frm is frmStok)
            {
                tsbtnYeniKayit.Enabled = false;
                _stokKaydet            = false;
            }
        }
Пример #2
0
        void YukleDatalari()
        {
            managerFctry = new ManagerFactory(Engine.GetConString(), Engine.GetSqlServerType());
            managerStk   = managerFctry.GetStokManager();

            mngKur     = managerFctry.GetKurManager();
            mngStokCat = managerFctry.GetStokCategoryManager();
            this.Activate();
            txtStokKodu.Focus();
            //Deneme(managerStk, "2");
            txtStGrup1.DataSource = () =>
            {
                try
                {
                    return(mngStokCat.GetListRootCategoriesKodAndName(txtStGrup1.Text).ToStringList(30, ""));
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
                return(null);
            };
            txtStGrup2.DataSource = () =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(txtStGrup1.Text) && !string.IsNullOrEmpty(txtStGrup2.Text))
                    {
                        return(mngStokCat.GetListParentSubCategoryKodAndName(txtStGrup1.Text, txtStGrup2.Text).ToStringList(30, ""));
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception exc)
                {
                    LogWrite.Write(exc);
                    MessageBox.Show(exc.Message);
                }
                return(null);
            };
            txtStGrup3.DataSource = () =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(txtStGrup2.Text) && !string.IsNullOrEmpty(txtStGrup2.Text))
                    {
                        return(mngStokCat.GetListParentSubCategoryKodAndName(txtStGrup2.Text, txtStGrup3.Text).ToStringList(30, ""));
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
                return(null);
            };
            txtStGrup4.DataSource = () =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(txtStGrup3.Text) && !string.IsNullOrEmpty(txtStGrup4.Text))
                    {
                        return(mngStokCat.GetListParentSubCategoryKodAndName(txtStGrup3.Text, txtStGrup4.Text).ToStringList(30, ""));
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
                return(null);
            };
            txtStGrup5.DataSource = () =>
            {
                try
                {
                    if (!string.IsNullOrEmpty(txtStGrup4.Text) && !string.IsNullOrEmpty(txtStGrup5.Text))
                    {
                        return(mngStokCat.GetListParentSubCategoryKodAndName(txtStGrup4.Text, txtStGrup5.Text).ToStringList(30, ""));
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
                return(null);
            };
            txtStokKodu.DataSource = () =>
            {
                try
                {
                    return(managerStk.StokKods(txtStokKodu.Text, UserInfo.Sube).ToStringList(35, txtStokKodu.Ayirac));
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message);
                    LogWrite.Write(exc);
                }
                return(null);
            };
            txtStokKodu.Text = "";
        }