Ejemplo n.º 1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            frmShortHazinehInp fbi = new frmShortHazinehInp();

            fbi.ShowDialog();

            hazineh_types ba = new hazineh_types();

            txttype.DataSource    = ba.SelectforComboBox();
            txttype.DisplayMember = "htype";

            txttype.Focus();
            txttype.SelectAll();
        }
Ejemplo n.º 2
0
        public void idsearch_Click()
        {
            hazineh_types ba = new hazineh_types();

            txttype.DataSource    = ba.SelectforComboBox();
            txttype.DisplayMember = "htype";

            hazineh fac = new hazineh();

            fac.radif = long.Parse(txtradif.Text);
            dt        = fac.SelectForEslah();

            if (dt.Rows.Count > 0)
            {
                btnUpdate.Enabled   = true;
                txtradif.Enabled    = false;
                grpinfo_box.Enabled = true;

                // Clear any previous bindings & Add new bindings to the DataView object...
                foreach (Control c in grpinfo_box.Controls)
                {
                    if (c.GetType() == typeof(TextBox) || c.GetType() == typeof(ComboBox) || c.GetType() == typeof(DateMaskedTextbox) || c.GetType() == typeof(CurrencyTextBox))
                    {
                        if (c != txtradif)
                        {
                            c.Text = dt.Rows[0][c.Name.Substring(3)].ToString();
                        }
                    }
                }
                // End of Clearing & Adding of Controls Binding

                txtdate.Focus();
            }
            else
            {
                MessageBox.Show("شماره مشخصه در سیستم موجود نمی باشد", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 3
0
        private void frmHazinehInp_Load(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo inp = new System.Globalization.CultureInfo("fa-IR");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(inp);
            cur_date = Date.currentDate_Getter();

            hazineh_types ba = new hazineh_types();

            txttype.DataSource    = ba.SelectforComboBox();
            txttype.DisplayMember = "htype";

            FillDataSetAndView();
            if (objCurrencyManager.Count == 0)
            {
                grpinfo_box.Enabled = false;

                btnAdd.Enabled          = false;
                btnMoveFirst.Enabled    = false;
                btnMovePrevious.Enabled = false;
                btnMoveNext.Enabled     = false;
                btnMoveLast.Enabled     = false;
                btnNew.Visible          = true;

                txtRecordPosition.Text     = "No Records";
                toolStripStatusLabel1.Text = "آماده ایجاد رکورد جدید";

                txtdate.Text = cur_date;
            }
            else
            {
                BindFields();
                objCurrencyManager.Position = objCurrencyManager.Count - 1;
                ShowPosition();
                btnAdd.Enabled = false;
            }
        }